diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-07-18 21:58:34 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-07-24 22:06:36 -0400 |
commit | 516b7db593f3a541e2e98867575c3c697f41a247 (patch) | |
tree | ddb4509c4a577bf0aa6552d35eee78ea04a0d541 | |
parent | 70c54e210ee9a2939f39ca58ee0b52afa24addec (diff) |
scsi: aic7xxx: fix firmware build with O=path
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>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/aic7xxx/Makefile | 12 | ||||
-rw-r--r-- | 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) := \ | |||
55 | 55 | ||
56 | ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) | 56 | ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) |
57 | $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm | 57 | $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm |
58 | $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \ | 58 | $(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic7xxx_reg.h \ |
59 | $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \ | 59 | $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \ |
60 | $(src)/aic7xxx.seq | 60 | $(srctree)/$(src)/aic7xxx.seq |
61 | 61 | ||
62 | $(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h | 62 | $(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h |
63 | else | 63 | else |
@@ -72,14 +72,14 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \ | |||
72 | 72 | ||
73 | ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y) | 73 | ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y) |
74 | $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm | 74 | $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm |
75 | $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \ | 75 | $(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \ |
76 | $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \ | 76 | $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \ |
77 | $(src)/aic79xx.seq | 77 | $(srctree)/$(src)/aic79xx.seq |
78 | 78 | ||
79 | $(aic79xx-gen-y): $(obj)/aic79xx_seq.h | 79 | $(aic79xx-gen-y): $(obj)/aic79xx_seq.h |
80 | else | 80 | else |
81 | $(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped | 81 | $(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped |
82 | endif | 82 | endif |
83 | 83 | ||
84 | $(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl] | 84 | $(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl] |
85 | $(MAKE) -C $(src)/aicasm | 85 | $(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 @@ | |||
1 | PROG= aicasm | 1 | PROG= aicasm |
2 | 2 | ||
3 | OUTDIR ?= ./ | ||
4 | |||
3 | .SUFFIXES= .l .y .c .h | 5 | .SUFFIXES= .l .y .c .h |
4 | 6 | ||
5 | CSRCS= aicasm.c aicasm_symbol.c | 7 | CSRCS= aicasm.c aicasm_symbol.c |
6 | YSRCS= aicasm_gram.y aicasm_macro_gram.y | 8 | YSRCS= aicasm_gram.y aicasm_macro_gram.y |
7 | LSRCS= aicasm_scan.l aicasm_macro_scan.l | 9 | LSRCS= aicasm_scan.l aicasm_macro_scan.l |
8 | 10 | ||
9 | GENHDRS= aicdb.h $(YSRCS:.y=.h) | 11 | GENHDRS= $(addprefix ${OUTDIR}/,aicdb.h $(YSRCS:.y=.h)) |
10 | GENSRCS= $(YSRCS:.y=.c) $(LSRCS:.l=.c) | 12 | GENSRCS= $(addprefix ${OUTDIR}/,$(YSRCS:.y=.c) $(LSRCS:.l=.c)) |
11 | 13 | ||
12 | SRCS= ${CSRCS} ${GENSRCS} | 14 | SRCS= ${CSRCS} ${GENSRCS} |
13 | LIBS= -ldb | 15 | LIBS= -ldb |
14 | clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) | 16 | clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) |
15 | # Override default kernel CFLAGS. This is a userland app. | 17 | # Override default kernel CFLAGS. This is a userland app. |
16 | AICASM_CFLAGS:= -I/usr/include -I. | 18 | AICASM_CFLAGS:= -I/usr/include -I. -I$(OUTDIR) |
17 | LEX= flex | 19 | LEX= flex |
18 | YACC= bison | 20 | YACC= bison |
19 | YFLAGS= -d | 21 | YFLAGS= -d |
@@ -32,22 +34,25 @@ YFLAGS+= -t -v | |||
32 | LFLAGS= -d | 34 | LFLAGS= -d |
33 | endif | 35 | endif |
34 | 36 | ||
35 | $(PROG): ${GENHDRS} $(SRCS) | 37 | $(PROG): $(OUTDIR) ${GENHDRS} $(SRCS) |
36 | $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS) | 38 | $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(OUTDIR)/$(PROG) $(LIBS) |
39 | |||
40 | $(OUTDIR): | ||
41 | mkdir -p $(OUTDIR) | ||
37 | 42 | ||
38 | aicdb.h: | 43 | $(OUTDIR)/aicdb.h: |
39 | @if [ -e "/usr/include/db4/db_185.h" ]; then \ | 44 | @if [ -e "/usr/include/db4/db_185.h" ]; then \ |
40 | echo "#include <db4/db_185.h>" > aicdb.h; \ | 45 | echo "#include <db4/db_185.h>" > $@; \ |
41 | elif [ -e "/usr/include/db3/db_185.h" ]; then \ | 46 | elif [ -e "/usr/include/db3/db_185.h" ]; then \ |
42 | echo "#include <db3/db_185.h>" > aicdb.h; \ | 47 | echo "#include <db3/db_185.h>" > $@; \ |
43 | elif [ -e "/usr/include/db2/db_185.h" ]; then \ | 48 | elif [ -e "/usr/include/db2/db_185.h" ]; then \ |
44 | echo "#include <db2/db_185.h>" > aicdb.h; \ | 49 | echo "#include <db2/db_185.h>" > $@; \ |
45 | elif [ -e "/usr/include/db1/db_185.h" ]; then \ | 50 | elif [ -e "/usr/include/db1/db_185.h" ]; then \ |
46 | echo "#include <db1/db_185.h>" > aicdb.h; \ | 51 | echo "#include <db1/db_185.h>" > $@; \ |
47 | elif [ -e "/usr/include/db/db_185.h" ]; then \ | 52 | elif [ -e "/usr/include/db/db_185.h" ]; then \ |
48 | echo "#include <db/db_185.h>" > aicdb.h; \ | 53 | echo "#include <db/db_185.h>" > $@; \ |
49 | elif [ -e "/usr/include/db_185.h" ]; then \ | 54 | elif [ -e "/usr/include/db_185.h" ]; then \ |
50 | echo "#include <db_185.h>" > aicdb.h; \ | 55 | echo "#include <db_185.h>" > $@; \ |
51 | else \ | 56 | else \ |
52 | echo "*** Install db development libraries"; \ | 57 | echo "*** Install db development libraries"; \ |
53 | fi | 58 | fi |
@@ -58,23 +63,23 @@ clean: | |||
58 | # Create a dependency chain in generated files | 63 | # Create a dependency chain in generated files |
59 | # to avoid concurrent invocations of the single | 64 | # to avoid concurrent invocations of the single |
60 | # rule that builds them all. | 65 | # rule that builds them all. |
61 | aicasm_gram.c: aicasm_gram.h | 66 | $(OUTDIR)/aicasm_gram.c: $(OUTDIR)/aicasm_gram.h |
62 | aicasm_gram.c aicasm_gram.h: aicasm_gram.y | 67 | $(OUTDIR)/aicasm_gram.c $(OUTDIR)/aicasm_gram.h: aicasm_gram.y |
63 | $(YACC) $(YFLAGS) -b $(<:.y=) $< | 68 | $(YACC) $(YFLAGS) -b $(<:.y=) $< |
64 | mv $(<:.y=).tab.c $(<:.y=.c) | 69 | mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c) |
65 | mv $(<:.y=).tab.h $(<:.y=.h) | 70 | mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h) |
66 | 71 | ||
67 | # Create a dependency chain in generated files | 72 | # Create a dependency chain in generated files |
68 | # to avoid concurrent invocations of the single | 73 | # to avoid concurrent invocations of the single |
69 | # rule that builds them all. | 74 | # rule that builds them all. |
70 | aicasm_macro_gram.c: aicasm_macro_gram.h | 75 | $(OUTDIR)/aicasm_macro_gram.c: $(OUTDIR)/aicasm_macro_gram.h |
71 | aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y | 76 | $(OUTDIR)/aicasm_macro_gram.c $(OUTDIR)/aicasm_macro_gram.h: aicasm_macro_gram.y |
72 | $(YACC) $(YFLAGS) -b $(<:.y=) -p mm $< | 77 | $(YACC) $(YFLAGS) -b $(<:.y=) -p mm $< |
73 | mv $(<:.y=).tab.c $(<:.y=.c) | 78 | mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c) |
74 | mv $(<:.y=).tab.h $(<:.y=.h) | 79 | mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h) |
75 | 80 | ||
76 | aicasm_scan.c: aicasm_scan.l | 81 | $(OUTDIR)/aicasm_scan.c: aicasm_scan.l |
77 | $(LEX) $(LFLAGS) -o$@ $< | 82 | $(LEX) $(LFLAGS) -o $@ $< |
78 | 83 | ||
79 | aicasm_macro_scan.c: aicasm_macro_scan.l | 84 | $(OUTDIR)/aicasm_macro_scan.c: aicasm_macro_scan.l |
80 | $(LEX) $(LFLAGS) -Pmm -o$@ $< | 85 | $(LEX) $(LFLAGS) -Pmm -o $@ $< |