* aicasm: fix kbuild for separated build directories
@ 2016-02-12 22:42 James Bottomley
2016-02-17 23:46 ` Michal Marek
0 siblings, 1 reply; 6+ messages in thread
From: James Bottomley @ 2016-02-12 22:42 UTC (permalink / raw)
To: linux-scsi; +Cc: Michal Marek
I've recently been experimenting with building in emulated architecture
containers which allow me to build natively on my laptop a kernel for
any architecture which qemu will emulate. To do this, I've been
building into build/$(uname -m) and this caused the aicasm stuff to
fail to build (using CONFIG_AIC7XXX_BUILD_FIRMWARE=y). I think this
patch corrects the problem, but I'm not hugely familiar with the kbuild
infrastructure so I cc'd an expert for a second opinion.
James
---
diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 741d818..c21c922 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -5,7 +5,7 @@
#
# Let kbuild descend into aicasm when cleaning
-subdir- += aicasm
+subdir- += aicasm/
obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx.o
obj-$(CONFIG_SCSI_AIC79XX) += aic79xx.o
@@ -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 \
- $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
- $(src)/aic79xx.seq
+ $(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \
+ $(aicasm-79xx-opts-y) -o $@ \
+ $(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:
+ $(Q)$(MAKE) $(build)=drivers/scsi/aic7xxx/aicasm all
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index b98c5c1..73559f0 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -1,19 +1,22 @@
-PROG= aicasm
+PROG= $(obj)/aicasm
+
+all: $(PROG)
.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
+CSRCS= $(srctree)/$(src)/aicasm.c $(srctree)/$(src)/aicasm_symbol.c
+YSRCS= $(src)/aicasm_gram.y $(src)/aicasm_macro_gram.y
+LSRCS= $(src)/aicasm_scan.l $(src)/aicasm_macro_scan.l
-GENHDRS= aicdb.h $(YSRCS:.y=.h)
-GENSRCS= $(YSRCS:.y=.c) $(LSRCS:.l=.c)
+GENHDRS= $(obj)/aicdb.h $(patsubst $(src)/%.y,$(obj)/%.h,$(YSRCS))
+GENSRCS= $(patsubst $(src)/%.y,$(obj)/%.c,$(YSRCS)) \
+ $(patsubst $(src)/%.l,$(obj)/%.c,$(LSRCS))
-SRCS= ${CSRCS} ${GENSRCS}
+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$(srctree)/$(src)
LEX= flex
YACC= bison
YFLAGS= -d
@@ -32,22 +35,23 @@ YFLAGS+= -t -v
LFLAGS= -d
endif
-$(PROG): ${GENHDRS} $(SRCS)
- $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS)
+$(PROG): $(GENHDRS) $(SRCS)
+ echo "SRCS=$(SRCS)"
+ $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $@ $(LIBS)
-aicdb.h:
+$(obj)/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>" > $(obj)/aicdb.h; \
elif [ -e "/usr/include/db3/db_185.h" ]; then \
- echo "#include <db3/db_185.h>" > aicdb.h; \
+ echo "#include <db3/db_185.h>" > $(obj)/aicdb.h; \
elif [ -e "/usr/include/db2/db_185.h" ]; then \
- echo "#include <db2/db_185.h>" > aicdb.h; \
+ echo "#include <db2/db_185.h>" > $(obj)/aicdb.h; \
elif [ -e "/usr/include/db1/db_185.h" ]; then \
- echo "#include <db1/db_185.h>" > aicdb.h; \
+ echo "#include <db1/db_185.h>" > $(obj)/aicdb.h; \
elif [ -e "/usr/include/db/db_185.h" ]; then \
- echo "#include <db/db_185.h>" > aicdb.h; \
+ echo "#include <db/db_185.h>" > $(obj)/aicdb.h; \
elif [ -e "/usr/include/db_185.h" ]; then \
- echo "#include <db_185.h>" > aicdb.h; \
+ echo "#include <db_185.h>" > $(obj)/aicdb.h; \
else \
echo "*** Install db development libraries"; \
fi
@@ -58,23 +62,21 @@ clean:
# 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
- $(YACC) $(YFLAGS) -b $(<:.y=) $<
- mv $(<:.y=).tab.c $(<:.y=.c)
- mv $(<:.y=).tab.h $(<:.y=.h)
+$(obj)/aicasm_gram.c $(obj)/aicasm_gram.h: $(src)/aicasm_gram.y
+ $(YACC) $(YFLAGS) -b $(@:.h=) $<
+ mv $(@:.h=).tab.c $(@:.h=.c)
+ mv $(@:.h=).tab.h $(@:.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
- $(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
- mv $(<:.y=).tab.c $(<:.y=.c)
- mv $(<:.y=).tab.h $(<:.y=.h)
+$(obj)/aicasm_macro_gram.c $(obj)/aicasm_macro_gram.h: $(src)/aicasm_macro_gram.y
+ $(YACC) $(YFLAGS) -b $(@:.h=) -p mm $<
+ mv $(@:.h=).tab.c $(@:.h=.c)
+ mv $(@:.h=).tab.h $(@:.h=.h)
-aicasm_scan.c: aicasm_scan.l
+$(obj)/aicasm_scan.c: $(src)/aicasm_scan.l
$(LEX) $(LFLAGS) -o$@ $<
-aicasm_macro_scan.c: aicasm_macro_scan.l
+$(obj)/aicasm_macro_scan.c: $(src)/aicasm_macro_scan.l
$(LEX) $(LFLAGS) -Pmm -o$@ $<
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: aicasm: fix kbuild for separated build directories
2016-02-12 22:42 aicasm: fix kbuild for separated build directories James Bottomley
@ 2016-02-17 23:46 ` Michal Marek
2016-02-24 1:54 ` Martin K. Petersen
2016-03-02 16:17 ` James Bottomley
0 siblings, 2 replies; 6+ messages in thread
From: Michal Marek @ 2016-02-17 23:46 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
On Fri, Feb 12, 2016 at 02:42:26PM -0800, James Bottomley wrote:
> I've recently been experimenting with building in emulated architecture
> containers which allow me to build natively on my laptop a kernel for
> any architecture which qemu will emulate. To do this, I've been
> building into build/$(uname -m) and this caused the aicasm stuff to
> fail to build (using CONFIG_AIC7XXX_BUILD_FIRMWARE=y). I think this
> patch corrects the problem, but I'm not hugely familiar with the kbuild
> infrastructure so I cc'd an expert for a second opinion.
Hi James,
Sorry for the late reply. Letting kbuild handle the aicasm directory is
a step in the right direction. However, it still failed for me and
instead of trying to understand how the rules work, I removed them and
used the existing kbuild infrastructure. Please try the patch below on
top of yours.
Michal
>From 6d8ec207b67f51f9f54a3721b161d5b5f1b7f93e Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Thu, 18 Feb 2016 00:26:39 +0100
Subject: [PATCH] aicasm: Convert Makefile to a regular kbuild file
Use the existing infrastructure to generate the lexer and parser and
compile the aicasm binary.
This patch should be followed by
make REGENERATE_PARSERS=1 drivers/scsi/aic7xxx/
git add drivers/scsi/aic7xxx/aicasm/*_shipped
git commit
This is what we do in other places, to be able to build the kernel
without flex/bison.
Signed-off-by: Michal Marek <mmarek@suse.com>
---
drivers/scsi/aic7xxx/aicasm/Makefile | 74 ++++++-------------------
drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l | 2 +-
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l | 2 +-
3 files changed, 18 insertions(+), 60 deletions(-)
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index 73559f0..c132d8a 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -1,43 +1,25 @@
-PROG= $(obj)/aicasm
+all: $(obj)/aicasm
-all: $(PROG)
+hostprogs-y += aicasm
+aicasm-objs := aicasm.o aicasm_symbol.o \
+ aicasm_scan.lex.o aicasm_macro_scan.lex.o \
+ aicasm_gram.tab.o aicasm_macro_gram.tab.o
-.SUFFIXES= .l .y .c .h
+clean-files := aicasm_scan.lex.c aicasm_macro_scan.lex.c \
+ aicasm_gram.tab.c aicasm_gram.tab.h \
+ aicasm_macro_gram.tab.c aicasm_macro_gram.tab.h \
+ aicdb.h
-CSRCS= $(srctree)/$(src)/aicasm.c $(srctree)/$(src)/aicasm_symbol.c
-YSRCS= $(src)/aicasm_gram.y $(src)/aicasm_macro_gram.y
-LSRCS= $(src)/aicasm_scan.l $(src)/aicasm_macro_scan.l
+$(obj)/aicasm_symbol.o: $(obj)/aicdb.h
-GENHDRS= $(obj)/aicdb.h $(patsubst $(src)/%.y,$(obj)/%.h,$(YSRCS))
-GENSRCS= $(patsubst $(src)/%.y,$(obj)/%.c,$(YSRCS)) \
- $(patsubst $(src)/%.l,$(obj)/%.c,$(LSRCS))
+$(obj)/aicasm_scan.lex.o: $(obj)/aicasm_gram.tab.h
-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. -I$(srctree)/$(src)
-LEX= flex
-YACC= bison
-YFLAGS= -d
+$(obj)/aicasm_macro_scan.lex.o: $(obj)/aicasm_macro_gram.tab.h
-NOMAN= noman
-
-ifneq ($(HOSTCC),)
-AICASM_CC= $(HOSTCC)
-else
-AICASM_CC= $(CC)
-endif
-
-ifdef DEBUG
-CFLAGS+= -DDEBUG -g
-YFLAGS+= -t -v
-LFLAGS= -d
-endif
-
-$(PROG): $(GENHDRS) $(SRCS)
- echo "SRCS=$(SRCS)"
- $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $@ $(LIBS)
+HOSTLOADLIBES_aicasm += -ldb
+HOST_EXTRACFLAGS := -I$(src)
+LEX_PREFIX_aicasm_macro_scan := mm
+YACC_PREFIX_aicasm_macro_gram := mm
$(obj)/aicdb.h:
@if [ -e "/usr/include/db4/db_185.h" ]; then \
@@ -56,27 +38,3 @@ $(obj)/aicdb.h:
echo "*** Install db development libraries"; \
fi
-clean:
- rm -f $(clean-files)
-
-# Create a dependency chain in generated files
-# to avoid concurrent invocations of the single
-# rule that builds them all.
-$(obj)/aicasm_gram.c $(obj)/aicasm_gram.h: $(src)/aicasm_gram.y
- $(YACC) $(YFLAGS) -b $(@:.h=) $<
- mv $(@:.h=).tab.c $(@:.h=.c)
- mv $(@:.h=).tab.h $(@:.y=.h)
-
-# Create a dependency chain in generated files
-# to avoid concurrent invocations of the single
-# rule that builds them all.
-$(obj)/aicasm_macro_gram.c $(obj)/aicasm_macro_gram.h: $(src)/aicasm_macro_gram.y
- $(YACC) $(YFLAGS) -b $(@:.h=) -p mm $<
- mv $(@:.h=).tab.c $(@:.h=.c)
- mv $(@:.h=).tab.h $(@:.h=.h)
-
-$(obj)/aicasm_scan.c: $(src)/aicasm_scan.l
- $(LEX) $(LFLAGS) -o$@ $<
-
-$(obj)/aicasm_macro_scan.c: $(src)/aicasm_macro_scan.l
- $(LEX) $(LFLAGS) -Pmm -o$@ $<
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
index c0457b8..aa7316c 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
@@ -59,7 +59,7 @@
#include "aicasm.h"
#include "aicasm_symbol.h"
-#include "aicasm_macro_gram.h"
+#include "aicasm_macro_gram.tab.h"
#define MAX_STR_CONST 4096
static char string_buf[MAX_STR_CONST];
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
index 93c8667..4e08095 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
@@ -59,7 +59,7 @@
#include "aicasm.h"
#include "aicasm_symbol.h"
-#include "aicasm_gram.h"
+#include "aicasm_gram.tab.h"
/* This is used for macro body capture too, so err on the large size. */
#define MAX_STR_CONST 4096
--
1.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: aicasm: fix kbuild for separated build directories
2016-02-17 23:46 ` Michal Marek
@ 2016-02-24 1:54 ` Martin K. Petersen
2016-03-02 16:17 ` James Bottomley
1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2016-02-24 1:54 UTC (permalink / raw)
To: Michal Marek; +Cc: James Bottomley, linux-scsi
>>>>> "Michal" == Michal Marek <mmarek@suse.cz> writes:
Michal> Sorry for the late reply. Letting kbuild handle the aicasm
Michal> directory is a step in the right direction. However, it still
Michal> failed for me and instead of trying to understand how the rules
Michal> work, I removed them and used the existing kbuild
Michal> infrastructure. Please try the patch below on top of yours.
James?
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: aicasm: fix kbuild for separated build directories
2016-02-17 23:46 ` Michal Marek
2016-02-24 1:54 ` Martin K. Petersen
@ 2016-03-02 16:17 ` James Bottomley
2016-03-02 16:25 ` Michal Marek
1 sibling, 1 reply; 6+ messages in thread
From: James Bottomley @ 2016-03-02 16:17 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-scsi
On Thu, 2016-02-18 at 00:46 +0100, Michal Marek wrote:
> On Fri, Feb 12, 2016 at 02:42:26PM -0800, James Bottomley wrote:
> > I've recently been experimenting with building in emulated
> > architecture containers which allow me to build natively on my
> > laptop a kernel for any architecture which qemu will emulate. To
> > do this, I've been building into build/$(uname -m) and this caused
> > the aicasm stuff to fail to build (using CONFIG_AIC7XXX_BUILD_FIRMW
> > ARE=y). I think this patch corrects the problem, but I'm not
> > hugely familiar with the kbuild infrastructure so I cc'd an expert
> > for a second opinion.
>
> Hi James,
>
> Sorry for the late reply. Letting kbuild handle the aicasm directory
> is a step in the right direction. However, it still failed for me and
> instead of trying to understand how the rules work, I removed them
> and used the existing kbuild infrastructure. Please try the patch
> below on top of yours.
Sorry for the late testing. This patch causes the build to fail again
for me:
make[5]: *** No rule to make target
'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.c', needed by
'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.o'. Stop.
/home/jejb/git/scsi-misc/drivers/scsi/aic7xxx/Makefile:85: recipe for
target 'drivers/scsi/aic7xxx/aicasm/aicasm' failed
make[4]: *** [drivers/scsi/aic7xxx/aicasm/aicasm] Error 2
/home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for target
'drivers/scsi/aic7xxx' failed
make[3]: *** [drivers/scsi/aic7xxx] Error 2
make[3]: *** Waiting for unfinished jobs....
/home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for target
'drivers/scsi' failed
I think the problem is simply that we now have two separate options for
building the firmware: REGENERATE_PARSERS and
CONFIG_AIC7XXX_BUILD_FIRMWARE and the latter needs to be eliminated.
I'll see if I can work out what's missing.
James
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: aicasm: fix kbuild for separated build directories
2016-03-02 16:17 ` James Bottomley
@ 2016-03-02 16:25 ` Michal Marek
2016-03-02 19:11 ` James Bottomley
0 siblings, 1 reply; 6+ messages in thread
From: Michal Marek @ 2016-03-02 16:25 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
On 2016-03-02 17:17, James Bottomley wrote:
> On Thu, 2016-02-18 at 00:46 +0100, Michal Marek wrote:
>> On Fri, Feb 12, 2016 at 02:42:26PM -0800, James Bottomley wrote:
>>> I've recently been experimenting with building in emulated
>>> architecture containers which allow me to build natively on my
>>> laptop a kernel for any architecture which qemu will emulate. To
>>> do this, I've been building into build/$(uname -m) and this caused
>>> the aicasm stuff to fail to build (using CONFIG_AIC7XXX_BUILD_FIRMW
>>> ARE=y). I think this patch corrects the problem, but I'm not
>>> hugely familiar with the kbuild infrastructure so I cc'd an expert
>>> for a second opinion.
>>
>> Hi James,
>>
>> Sorry for the late reply. Letting kbuild handle the aicasm directory
>> is a step in the right direction. However, it still failed for me and
>> instead of trying to understand how the rules work, I removed them
>> and used the existing kbuild infrastructure. Please try the patch
>> below on top of yours.
>
> Sorry for the late testing. This patch causes the build to fail again
> for me:
>
> make[5]: *** No rule to make target
> 'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.c', needed by
> 'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.o'. Stop.
> /home/jejb/git/scsi-misc/drivers/scsi/aic7xxx/Makefile:85: recipe for
> target 'drivers/scsi/aic7xxx/aicasm/aicasm' failed
> make[4]: *** [drivers/scsi/aic7xxx/aicasm/aicasm] Error 2
> /home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for target
> 'drivers/scsi/aic7xxx' failed
> make[3]: *** [drivers/scsi/aic7xxx] Error 2
> make[3]: *** Waiting for unfinished jobs....
> /home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for target
> 'drivers/scsi' failed
>
> I think the problem is simply that we now have two separate options for
> building the firmware: REGENERATE_PARSERS and
> CONFIG_AIC7XXX_BUILD_FIRMWARE and the latter needs to be eliminated.
> I'll see if I can work out what's missing.
Did you run the build with REGENERATE_PARSERS=1? It needs to be done
once and the _shipped files need to be added to git. I did not include
them in my patch for the sake of brevity.
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: aicasm: fix kbuild for separated build directories
2016-03-02 16:25 ` Michal Marek
@ 2016-03-02 19:11 ` James Bottomley
0 siblings, 0 replies; 6+ messages in thread
From: James Bottomley @ 2016-03-02 19:11 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-scsi
On Wed, 2016-03-02 at 17:25 +0100, Michal Marek wrote:
> On 2016-03-02 17:17, James Bottomley wrote:
> > On Thu, 2016-02-18 at 00:46 +0100, Michal Marek wrote:
> > > On Fri, Feb 12, 2016 at 02:42:26PM -0800, James Bottomley wrote:
> > > > I've recently been experimenting with building in emulated
> > > > architecture containers which allow me to build natively on my
> > > > laptop a kernel for any architecture which qemu will emulate.
> > > > To
> > > > do this, I've been building into build/$(uname -m) and this
> > > > caused
> > > > the aicasm stuff to fail to build (using
> > > > CONFIG_AIC7XXX_BUILD_FIRMW
> > > > ARE=y). I think this patch corrects the problem, but I'm not
> > > > hugely familiar with the kbuild infrastructure so I cc'd an
> > > > expert
> > > > for a second opinion.
> > >
> > > Hi James,
> > >
> > > Sorry for the late reply. Letting kbuild handle the aicasm
> > > directory
> > > is a step in the right direction. However, it still failed for me
> > > and
> > > instead of trying to understand how the rules work, I removed
> > > them
> > > and used the existing kbuild infrastructure. Please try the patch
> > > below on top of yours.
> >
> > Sorry for the late testing. This patch causes the build to fail
> > again
> > for me:
> >
> > make[5]: *** No rule to make target
> > 'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.c', needed by
> > 'drivers/scsi/aic7xxx/aicasm/aicasm_scan.lex.o'. Stop.
> > /home/jejb/git/scsi-misc/drivers/scsi/aic7xxx/Makefile:85: recipe
> > for
> > target 'drivers/scsi/aic7xxx/aicasm/aicasm' failed
> > make[4]: *** [drivers/scsi/aic7xxx/aicasm/aicasm] Error 2
> > /home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for
> > target
> > 'drivers/scsi/aic7xxx' failed
> > make[3]: *** [drivers/scsi/aic7xxx] Error 2
> > make[3]: *** Waiting for unfinished jobs....
> > /home/jejb/git/scsi-misc/scripts/Makefile.build:407: recipe for
> > target
> > 'drivers/scsi' failed
> >
> > I think the problem is simply that we now have two separate options
> > for
> > building the firmware: REGENERATE_PARSERS and
> > CONFIG_AIC7XXX_BUILD_FIRMWARE and the latter needs to be
> > eliminated.
> > I'll see if I can work out what's missing.
>
> Did you run the build with REGENERATE_PARSERS=1? It needs to be done
> once and the _shipped files need to be added to git. I did not
> include
> them in my patch for the sake of brevity.
The Build with REGENERATE_PARSERS works. The build with this make line
make -j 4 O=build/x86_64
Fails if these config options are set:
CONFIG_AIC7XXX_BUILD_FIRMWARE=y
CONFIG_AIC79XX_BUILD_FIRMWARE=y
I think the fix is just to excise those options from the build system.
James
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-02 19:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 22:42 aicasm: fix kbuild for separated build directories James Bottomley
2016-02-17 23:46 ` Michal Marek
2016-02-24 1:54 ` Martin K. Petersen
2016-03-02 16:17 ` James Bottomley
2016-03-02 16:25 ` Michal Marek
2016-03-02 19:11 ` James Bottomley
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.