Skip to contentSkip to conversation

md/raid6 breaks separate source/object tree

KBUILD [email protected] 1 participant 2 messages Jan 24, 2004

lore
Share & tools
lore
#0 lore raw

Date: Lør, 24 Jan 2004 20:10:25 +0800 skrev Richard Chan <[email protected]> :

Quoted 5 lines

md/raid6 is using an in-tree perl script to generate a C file. This breaks kbuild separate src/obj tree.

Somehow the src in $(PERL) $(src)/drivers/md/unroll.pl is not getting substituted.

Replace $(src)/unroll.pl with $(srctree)/$(src)/unroll.pl in drivers/md/Makefile and it works again.

Fix is already sent to hpa/akpm - but I do not have it available here (on WEB mail).

Sam

#1 lore raw
Quoted 3 lines · On Sat, Jan 24, 2004 at 01:26:51PM +0100, [email protected] wrote:

Fix is already sent to hpa/akpm - but I do not have it available here (on WEB mail).

Here it is - it is a bit long because I made output look nice when doing a build without V=1.

Sam

md/Makefile renamed from md/Makefile.old +40 -23
@@ -24,26 +24,43 @@ obj-$(CONFIG_MD_MULTIPATH)	+= multipath.
 obj-$(CONFIG_BLK_DEV_MD)	+= md.o
 obj-$(CONFIG_BLK_DEV_DM)	+= dm-mod.o
 
-# Files generated that shall be removed upon make clean
-clean-files := raid6int*.c raid6tables.c mktables
-
-$(obj)/raid6int1.c:   $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 1 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6int2.c:   $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 2 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6int4.c:   $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 4 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6int8.c:   $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 8 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6int16.c:  $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 16 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6int32.c:  $(src)/raid6int.uc $(src)/unroll.pl
-	$(PERL) $(src)/unroll.pl 32 < $< > $@ || ( rm -f $@ && exit 1 )
-
-$(obj)/raid6tables.c: $(obj)/mktables
-	$(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
+quiet_cmd_unroll = UNROLL  $@
+      cmd_unroll = $(PERL) $(srctree)/$(src)/unroll.pl $(UNROLL) \
+                   < $< > $@ || ( rm -f $@ && exit 1 )
+
+targets += raid6int1.c
+$(obj)/raid6int1.c:   UNROLL := 1
+$(obj)/raid6int1.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int2.c
+$(obj)/raid6int2.c:   UNROLL := 2
+$(obj)/raid6int2.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int4.c
+$(obj)/raid6int4.c:   UNROLL := 4
+$(obj)/raid6int4.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int8.c
+$(obj)/raid6int8.c:   UNROLL := 8
+$(obj)/raid6int8.c:   $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int16.c
+$(obj)/raid6int16.c:  UNROLL := 16
+$(obj)/raid6int16.c:  $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+targets += raid6int32.c
+$(obj)/raid6int32.c:  UNROLL := 32
+$(obj)/raid6int32.c:  $(src)/raid6int.uc $(src)/unroll.pl FORCE
+	$(call if_changed,unroll)
+
+quiet_cmd_mktable = TABLE   $@
+      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
+
+targets += raid6tables.c
+$(obj)/raid6tables.c: $(obj)/mktables FORCE
+	$(call if_changed,mktable)