All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aic7xxx: fix firmware build with O=path
@ 2017-06-29  4:17 Jakub Kicinski
  2017-07-04  0:29 ` Jakub Kicinski
  2017-07-19  1:35 ` Jakub Kicinski
  0 siblings, 2 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-06-29  4:17 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, oss-drivers, Jakub Kicinski

Building firmware with O=path was apparently broken in aic7 for ever.
Message of the previous commit to the Makefile (from 2008) mentions
this unfortunate state of affairs already.  Fix this, mostly to make
randconfig builds more reliable.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 drivers/scsi/aic7xxx/Makefile        | 12 ++++----
 drivers/scsi/aic7xxx/aicasm/Makefile | 53 ++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 741d81861d17..07b60a780c06 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -55,9 +55,9 @@ aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
 $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
-	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
+	$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic7xxx_reg.h \
 			      $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
-			      $(src)/aic7xxx.seq
+			      $(srctree)/$(src)/aic7xxx.seq
 
 $(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
 else
@@ -72,14 +72,14 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
 $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
-	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
+	$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \
 			      $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
-			      $(src)/aic79xx.seq
+			      $(srctree)/$(src)/aic79xx.seq
 
 $(aic79xx-gen-y): $(obj)/aic79xx_seq.h
 else
 $(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
 endif
 
-$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
-	$(MAKE) -C $(src)/aicasm
+$(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
+	$(MAKE) -C $(srctree)/$(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index b98c5c1056c3..45e2d49c1fff 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -1,19 +1,21 @@
 PROG=	aicasm
 
+OUTDIR ?= ./
+
 .SUFFIXES= .l .y .c .h
 
 CSRCS=	aicasm.c aicasm_symbol.c
 YSRCS=	aicasm_gram.y aicasm_macro_gram.y
 LSRCS=	aicasm_scan.l aicasm_macro_scan.l
 
-GENHDRS=	aicdb.h $(YSRCS:.y=.h)
-GENSRCS=	$(YSRCS:.y=.c) $(LSRCS:.l=.c)
+GENHDRS=	$(addprefix ${OUTDIR}/,aicdb.h $(YSRCS:.y=.h))
+GENSRCS=	$(addprefix ${OUTDIR}/,$(YSRCS:.y=.c) $(LSRCS:.l=.c))
 
 SRCS=	${CSRCS} ${GENSRCS}
 LIBS=	-ldb
 clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
 # Override default kernel CFLAGS.  This is a userland app.
-AICASM_CFLAGS:= -I/usr/include -I.
+AICASM_CFLAGS:= -I/usr/include -I. -I$(OUTDIR)
 LEX= flex
 YACC= bison
 YFLAGS= -d
@@ -32,22 +34,25 @@ YFLAGS+= -t -v
 LFLAGS= -d
 endif
 
-$(PROG):  ${GENHDRS} $(SRCS)
-	$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS)
+$(PROG):  $(OUTDIR) ${GENHDRS} $(SRCS)
+	$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(OUTDIR)/$(PROG) $(LIBS)
+
+$(OUTDIR):
+	mkdir -p $(OUTDIR)
 
-aicdb.h:
+$(OUTDIR)/aicdb.h:
 	@if [ -e "/usr/include/db4/db_185.h" ]; then		\
-		echo "#include <db4/db_185.h>" > aicdb.h;	\
+		echo "#include <db4/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db3/db_185.h" ]; then		\
-		echo "#include <db3/db_185.h>" > aicdb.h;	\
+		echo "#include <db3/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db2/db_185.h" ]; then		\
-		echo "#include <db2/db_185.h>" > aicdb.h;	\
+		echo "#include <db2/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db1/db_185.h" ]; then		\
-		echo "#include <db1/db_185.h>" > aicdb.h;	\
+		echo "#include <db1/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db/db_185.h" ]; then		\
-		echo "#include <db/db_185.h>" > aicdb.h;	\
+		echo "#include <db/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db_185.h" ]; then		\
-		echo "#include <db_185.h>" > aicdb.h;		\
+		echo "#include <db_185.h>" > $@;		\
 	 else							\
 		echo "*** Install db development libraries";	\
 	 fi
@@ -58,23 +63,23 @@ $(PROG):  ${GENHDRS} $(SRCS)
 # Create a dependency chain in generated files
 # to avoid concurrent invocations of the single
 # rule that builds them all.
-aicasm_gram.c: aicasm_gram.h
-aicasm_gram.c aicasm_gram.h: aicasm_gram.y
+$(OUTDIR)/aicasm_gram.c: $(OUTDIR)/aicasm_gram.h
+$(OUTDIR)/aicasm_gram.c $(OUTDIR)/aicasm_gram.h: aicasm_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) $<
-	mv $(<:.y=).tab.c $(<:.y=.c)
-	mv $(<:.y=).tab.h $(<:.y=.h)
+	mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
+	mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
 
 # Create a dependency chain in generated files
 # to avoid concurrent invocations of the single
 # rule that builds them all.
-aicasm_macro_gram.c: aicasm_macro_gram.h
-aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
+$(OUTDIR)/aicasm_macro_gram.c: $(OUTDIR)/aicasm_macro_gram.h
+$(OUTDIR)/aicasm_macro_gram.c $(OUTDIR)/aicasm_macro_gram.h: aicasm_macro_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
-	mv $(<:.y=).tab.c $(<:.y=.c)
-	mv $(<:.y=).tab.h $(<:.y=.h)
+	mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
+	mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
 
-aicasm_scan.c: aicasm_scan.l
-	$(LEX) $(LFLAGS) -o$@ $<
+$(OUTDIR)/aicasm_scan.c: aicasm_scan.l
+	$(LEX) $(LFLAGS) -o $@ $<
 
-aicasm_macro_scan.c: aicasm_macro_scan.l
-	$(LEX) $(LFLAGS) -Pmm -o$@ $<
+$(OUTDIR)/aicasm_macro_scan.c: aicasm_macro_scan.l
+	$(LEX) $(LFLAGS) -Pmm -o $@ $<
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-06-29  4:17 [PATCH] aic7xxx: fix firmware build with O=path Jakub Kicinski
@ 2017-07-04  0:29 ` Jakub Kicinski
  2017-07-19  1:35 ` Jakub Kicinski
  1 sibling, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-04  0:29 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, oss-drivers

On Wed, 28 Jun 2017 21:17:16 -0700, Jakub Kicinski wrote:
> Building firmware with O=path was apparently broken in aic7 for ever.
> Message of the previous commit to the Makefile (from 2008) mentions
> this unfortunate state of affairs already.  Fix this, mostly to make
> randconfig builds more reliable.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Did anyone have a chance to look at this one?  It would be nice if it
could make its way into 4.13 :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-06-29  4:17 [PATCH] aic7xxx: fix firmware build with O=path Jakub Kicinski
  2017-07-04  0:29 ` Jakub Kicinski
@ 2017-07-19  1:35 ` Jakub Kicinski
  2017-07-19  1:45   ` Martin K. Petersen
  1 sibling, 1 reply; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-19  1:35 UTC (permalink / raw)
  To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, oss-drivers

On Wed, 28 Jun 2017 21:17:16 -0700, Jakub Kicinski wrote:
> Building firmware with O=path was apparently broken in aic7 for ever.
> Message of the previous commit to the Makefile (from 2008) mentions
> this unfortunate state of affairs already.  Fix this, mostly to make
> randconfig builds more reliable.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

I just noticed this patch got marked as "Deferred, archived" in
patchwork.  I'm not entirely sure by whom and why?  Could someone
explain what is the issue?  I would really appreciate if we could 
merge this patch and have this driver not break builds randomly...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-19  1:35 ` Jakub Kicinski
@ 2017-07-19  1:45   ` Martin K. Petersen
  2017-07-19  1:52     ` Jakub Kicinski
  0 siblings, 1 reply; 10+ messages in thread
From: Martin K. Petersen @ 2017-07-19  1:45 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel, oss-drivers


Jakub,

> I just noticed this patch got marked as "Deferred, archived" in
> patchwork.  I'm not entirely sure by whom and why?  Could someone
> explain what is the issue?  I would really appreciate if we could 
> merge this patch and have this driver not break builds randomly...

It's an indication that the patch sat around without any reviews for way
too long.

People generally don't go chasing around in their mail archives for
several week old patches to review. The best thing to do for patches I
mark as deferred is to resubmit them so they get back on people's radar.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-19  1:45   ` Martin K. Petersen
@ 2017-07-19  1:52     ` Jakub Kicinski
  0 siblings, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-19  1:52 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Hannes Reinecke, James E.J. Bottomley, linux-scsi, linux-kernel,
	oss-drivers

On Tue, 18 Jul 2017 21:45:49 -0400, Martin K. Petersen wrote:
> Jakub,
> 
> > I just noticed this patch got marked as "Deferred, archived" in
> > patchwork.  I'm not entirely sure by whom and why?  Could someone
> > explain what is the issue?  I would really appreciate if we could 
> > merge this patch and have this driver not break builds randomly...  
> 
> It's an indication that the patch sat around without any reviews for way
> too long.
> 
> People generally don't go chasing around in their mail archives for
> several week old patches to review. The best thing to do for patches I
> mark as deferred is to resubmit them so they get back on people's radar.

OK, I will repost then.  Thanks for the explanation!  I hope someone
will find time to review, the driver is a bit old :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-19  1:58 Jakub Kicinski
  2017-07-21 18:51 ` Jakub Kicinski
@ 2017-07-25  2:07 ` Martin K. Petersen
  1 sibling, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2017-07-25  2:07 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen, linux-scsi


Jakub,

> Building firmware with O=path was apparently broken in aic7 for ever.
> Message of the previous commit to the Makefile (from 2008) mentions
> this unfortunate state of affairs already.  Fix this, mostly to make
> randconfig builds more reliable.

Applied to 4.13/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-24  7:00   ` Hannes Reinecke
@ 2017-07-24 21:14     ` Jakub Kicinski
  0 siblings, 0 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-24 21:14 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi

On Mon, 24 Jul 2017 09:00:41 +0200, Hannes Reinecke wrote:
> On 07/21/2017 08:51 PM, Jakub Kicinski wrote:
> > On Tue, 18 Jul 2017 18:58:34 -0700, Jakub Kicinski wrote:  
> >> Building firmware with O=path was apparently broken in aic7 for ever.
> >> Message of the previous commit to the Makefile (from 2008) mentions
> >> this unfortunate state of affairs already.  Fix this, mostly to make
> >> randconfig builds more reliable.
> >>
> >> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>  
> > 
> > Gentle ping :)  Hannes, are you still maintaining aic7xxx?
> >   
> Yes, I do.
> 
> Patch looks reasonable; Kconfig is still black magic to me, though :-)

To me as well, but is seems to work fine in my tests :)

> Reviewed-by: Hannes Reinecke <hare@suse.com>

Thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-21 18:51 ` Jakub Kicinski
@ 2017-07-24  7:00   ` Hannes Reinecke
  2017-07-24 21:14     ` Jakub Kicinski
  0 siblings, 1 reply; 10+ messages in thread
From: Hannes Reinecke @ 2017-07-24  7:00 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi

On 07/21/2017 08:51 PM, Jakub Kicinski wrote:
> On Tue, 18 Jul 2017 18:58:34 -0700, Jakub Kicinski wrote:
>> Building firmware with O=path was apparently broken in aic7 for ever.
>> Message of the previous commit to the Makefile (from 2008) mentions
>> this unfortunate state of affairs already.  Fix this, mostly to make
>> randconfig builds more reliable.
>>
>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> 
> Gentle ping :)  Hannes, are you still maintaining aic7xxx?
> 
Yes, I do.

Patch looks reasonable; Kconfig is still black magic to me, though :-)

Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@suse.com			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] aic7xxx: fix firmware build with O=path
  2017-07-19  1:58 Jakub Kicinski
@ 2017-07-21 18:51 ` Jakub Kicinski
  2017-07-24  7:00   ` Hannes Reinecke
  2017-07-25  2:07 ` Martin K. Petersen
  1 sibling, 1 reply; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-21 18:51 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi

On Tue, 18 Jul 2017 18:58:34 -0700, Jakub Kicinski wrote:
> Building firmware with O=path was apparently broken in aic7 for ever.
> Message of the previous commit to the Makefile (from 2008) mentions
> this unfortunate state of affairs already.  Fix this, mostly to make
> randconfig builds more reliable.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Gentle ping :)  Hannes, are you still maintaining aic7xxx?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] aic7xxx: fix firmware build with O=path
@ 2017-07-19  1:58 Jakub Kicinski
  2017-07-21 18:51 ` Jakub Kicinski
  2017-07-25  2:07 ` Martin K. Petersen
  0 siblings, 2 replies; 10+ messages in thread
From: Jakub Kicinski @ 2017-07-19  1:58 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, Jakub Kicinski

Building firmware with O=path was apparently broken in aic7 for ever.
Message of the previous commit to the Makefile (from 2008) mentions
this unfortunate state of affairs already.  Fix this, mostly to make
randconfig builds more reliable.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 drivers/scsi/aic7xxx/Makefile        | 12 ++++----
 drivers/scsi/aic7xxx/aicasm/Makefile | 53 ++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 741d81861d17..07b60a780c06 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -55,9 +55,9 @@ aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
 $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
-	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
+	$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic7xxx_reg.h \
 			      $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
-			      $(src)/aic7xxx.seq
+			      $(srctree)/$(src)/aic7xxx.seq
 
 $(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
 else
@@ -72,14 +72,14 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
 $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
-	$(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
+	$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \
 			      $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
-			      $(src)/aic79xx.seq
+			      $(srctree)/$(src)/aic79xx.seq
 
 $(aic79xx-gen-y): $(obj)/aic79xx_seq.h
 else
 $(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
 endif
 
-$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
-	$(MAKE) -C $(src)/aicasm
+$(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
+	$(MAKE) -C $(srctree)/$(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index b98c5c1056c3..45e2d49c1fff 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -1,19 +1,21 @@
 PROG=	aicasm
 
+OUTDIR ?= ./
+
 .SUFFIXES= .l .y .c .h
 
 CSRCS=	aicasm.c aicasm_symbol.c
 YSRCS=	aicasm_gram.y aicasm_macro_gram.y
 LSRCS=	aicasm_scan.l aicasm_macro_scan.l
 
-GENHDRS=	aicdb.h $(YSRCS:.y=.h)
-GENSRCS=	$(YSRCS:.y=.c) $(LSRCS:.l=.c)
+GENHDRS=	$(addprefix ${OUTDIR}/,aicdb.h $(YSRCS:.y=.h))
+GENSRCS=	$(addprefix ${OUTDIR}/,$(YSRCS:.y=.c) $(LSRCS:.l=.c))
 
 SRCS=	${CSRCS} ${GENSRCS}
 LIBS=	-ldb
 clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
 # Override default kernel CFLAGS.  This is a userland app.
-AICASM_CFLAGS:= -I/usr/include -I.
+AICASM_CFLAGS:= -I/usr/include -I. -I$(OUTDIR)
 LEX= flex
 YACC= bison
 YFLAGS= -d
@@ -32,22 +34,25 @@ YFLAGS+= -t -v
 LFLAGS= -d
 endif
 
-$(PROG):  ${GENHDRS} $(SRCS)
-	$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS)
+$(PROG):  $(OUTDIR) ${GENHDRS} $(SRCS)
+	$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(OUTDIR)/$(PROG) $(LIBS)
+
+$(OUTDIR):
+	mkdir -p $(OUTDIR)
 
-aicdb.h:
+$(OUTDIR)/aicdb.h:
 	@if [ -e "/usr/include/db4/db_185.h" ]; then		\
-		echo "#include <db4/db_185.h>" > aicdb.h;	\
+		echo "#include <db4/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db3/db_185.h" ]; then		\
-		echo "#include <db3/db_185.h>" > aicdb.h;	\
+		echo "#include <db3/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db2/db_185.h" ]; then		\
-		echo "#include <db2/db_185.h>" > aicdb.h;	\
+		echo "#include <db2/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db1/db_185.h" ]; then		\
-		echo "#include <db1/db_185.h>" > aicdb.h;	\
+		echo "#include <db1/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db/db_185.h" ]; then		\
-		echo "#include <db/db_185.h>" > aicdb.h;	\
+		echo "#include <db/db_185.h>" > $@;	\
 	 elif [ -e "/usr/include/db_185.h" ]; then		\
-		echo "#include <db_185.h>" > aicdb.h;		\
+		echo "#include <db_185.h>" > $@;		\
 	 else							\
 		echo "*** Install db development libraries";	\
 	 fi
@@ -58,23 +63,23 @@ $(PROG):  ${GENHDRS} $(SRCS)
 # Create a dependency chain in generated files
 # to avoid concurrent invocations of the single
 # rule that builds them all.
-aicasm_gram.c: aicasm_gram.h
-aicasm_gram.c aicasm_gram.h: aicasm_gram.y
+$(OUTDIR)/aicasm_gram.c: $(OUTDIR)/aicasm_gram.h
+$(OUTDIR)/aicasm_gram.c $(OUTDIR)/aicasm_gram.h: aicasm_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) $<
-	mv $(<:.y=).tab.c $(<:.y=.c)
-	mv $(<:.y=).tab.h $(<:.y=.h)
+	mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
+	mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
 
 # Create a dependency chain in generated files
 # to avoid concurrent invocations of the single
 # rule that builds them all.
-aicasm_macro_gram.c: aicasm_macro_gram.h
-aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
+$(OUTDIR)/aicasm_macro_gram.c: $(OUTDIR)/aicasm_macro_gram.h
+$(OUTDIR)/aicasm_macro_gram.c $(OUTDIR)/aicasm_macro_gram.h: aicasm_macro_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
-	mv $(<:.y=).tab.c $(<:.y=.c)
-	mv $(<:.y=).tab.h $(<:.y=.h)
+	mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
+	mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
 
-aicasm_scan.c: aicasm_scan.l
-	$(LEX) $(LFLAGS) -o$@ $<
+$(OUTDIR)/aicasm_scan.c: aicasm_scan.l
+	$(LEX) $(LFLAGS) -o $@ $<
 
-aicasm_macro_scan.c: aicasm_macro_scan.l
-	$(LEX) $(LFLAGS) -Pmm -o$@ $<
+$(OUTDIR)/aicasm_macro_scan.c: aicasm_macro_scan.l
+	$(LEX) $(LFLAGS) -Pmm -o $@ $<
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-25  2:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29  4:17 [PATCH] aic7xxx: fix firmware build with O=path Jakub Kicinski
2017-07-04  0:29 ` Jakub Kicinski
2017-07-19  1:35 ` Jakub Kicinski
2017-07-19  1:45   ` Martin K. Petersen
2017-07-19  1:52     ` Jakub Kicinski
2017-07-19  1:58 Jakub Kicinski
2017-07-21 18:51 ` Jakub Kicinski
2017-07-24  7:00   ` Hannes Reinecke
2017-07-24 21:14     ` Jakub Kicinski
2017-07-25  2:07 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.