From: Andrew Morton <akpm@osdl.org>
To: Richard Chan <rspchan@starhub.net.sg>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [KBUILD] md/raid6 breaks separate source/object tree
Date: Sat, 24 Jan 2004 13:32:34 -0800 [thread overview]
Message-ID: <20040124133234.41093c17.akpm@osdl.org> (raw)
In-Reply-To: <401260B1.7090909@starhub.net.sg>
Richard Chan <rspchan@starhub.net.sg> wrote:
>
> md/raid6 is using an in-tree perl script to generate a C file.
> This breaks kbuild separate src/obj tree.
>
> CC [M] drivers/md/raid6main.o
> CC [M] drivers/md/raid6algos.o
> CC [M] drivers/md/raid6recov.o
> HOSTCC drivers/md/mktables
> drivers/md/mktables > drivers/md/raid6tables.c || ( rm -f
> drivers/md/raid6tables.c && exit 1 )
> CC [M] drivers/md/raid6tables.o
> perl drivers/md/unroll.pl 1 <
> /usr/src/linux-2.6.2-rc1.1.A/drivers/md/raid6int.uc >
> drivers/md/raid6int1.c || ( rm -f drivers/md/raid6int1.c && exit 1 )
> Can't open perl script "drivers/md/unroll.pl": No such file or directory
>
> Somehow the src in $(PERL) $(src)/drivers/md/unroll.pl is not getting
> substituted.
Does this patch (from Sam) fix it?
--- 25/drivers/md/Makefile~raid-makefile-cleanup 2004-01-24 01:26:56.000000000 -0800
+++ 25-akpm/drivers/md/Makefile 2004-01-24 01:26:56.000000000 -0800
@@ -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)
_
next prev parent reply other threads:[~2004-01-24 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-24 12:10 Richard Chan
2004-01-24 21:32 ` Andrew Morton [this message]
2004-01-24 12:26 sam
2004-01-24 20:44 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040124133234.41093c17.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rspchan@starhub.net.sg \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®