* kbuild: prevent make from deleting _shipped files
@ 2011-07-31 15:37 Peter Foley
2011-07-31 16:21 ` Arnaud Lacombe
0 siblings, 1 reply; 12+ messages in thread
From: Peter Foley @ 2011-07-31 15:37 UTC (permalink / raw)
To: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek,
lacombar
commit 7373f4f (kbuild: add implicit rules for parser generation)
created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
because it considers them intermediate files. Mark the _shipped files PRECIOUS
to prevent make from deleting them.
Signed-off-by: Peter Foley <pefoley2@verizon.net>
---
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index aeea84a..5d986d9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
quiet_cmd_gperf = GPERF $@
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
+.PRECIOUS: $(src)/%.hash.c_shipped
$(src)/%.hash.c_shipped: $(src)/%.gperf
$(call cmd,gperf)
@@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
quiet_cmd_flex = LEX $@
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
+.PRECIOUS: $(src)/%.lex.c_shipped
$(src)/%.lex.c_shipped: $(src)/%.l
$(call cmd,flex)
@@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
+.PRECIOUS: $(src)/%.tab.c_shipped
$(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison)
quiet_cmd_bison_h = YACC $@
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
+.PRECIOUS: $(src)/%.tab.h_shipped
$(src)/%.tab.h_shipped: $(src)/%.y
$(call cmd,bison_h)
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 15:37 kbuild: prevent make from deleting _shipped files Peter Foley
@ 2011-07-31 16:21 ` Arnaud Lacombe
2011-07-31 16:58 ` Arnaud Lacombe
0 siblings, 1 reply; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 16:21 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
> commit 7373f4f (kbuild: add implicit rules for parser generation)
> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
> because it considers them intermediate files. Mark the _shipped files PRECIOUS
> to prevent make from deleting them.
>
> Signed-off-by: Peter Foley <pefoley2@verizon.net>
What make are you using, and what command triggers the issue ?
Those rules should only be visible on parser regeneration (ie.
REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
issue:
% make -v
GNU Make 3.82
% make REGENERATE_PARSERS=y defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
[...]
The shipped file are still there:
% ls scripts/kconfig/*_shipped
scripts/kconfig/zconf.hash.c_shipped
scripts/kconfig/zconf.lex.c_shipped
scripts/kconfig/zconf.tab.c_shipped
Thanks,
- Arnaud
> ---
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index aeea84a..5d986d9 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
> quiet_cmd_gperf = GPERF $@
> cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
>
> +.PRECIOUS: $(src)/%.hash.c_shipped
> $(src)/%.hash.c_shipped: $(src)/%.gperf
> $(call cmd,gperf)
>
> @@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
> quiet_cmd_flex = LEX $@
> cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.lex.c_shipped
> $(src)/%.lex.c_shipped: $(src)/%.l
> $(call cmd,flex)
>
> @@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
> quiet_cmd_bison = YACC $@
> cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.tab.c_shipped
> $(src)/%.tab.c_shipped: $(src)/%.y
> $(call cmd,bison)
>
> quiet_cmd_bison_h = YACC $@
> cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.tab.h_shipped
> $(src)/%.tab.h_shipped: $(src)/%.y
> $(call cmd,bison_h)
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 16:21 ` Arnaud Lacombe
@ 2011-07-31 16:58 ` Arnaud Lacombe
2011-07-31 17:08 ` Peter Foley
0 siblings, 1 reply; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 16:58 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
>> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
>> because it considers them intermediate files. Mark the _shipped files PRECIOUS
>> to prevent make from deleting them.
>>
>> Signed-off-by: Peter Foley <pefoley2@verizon.net>
> What make are you using, and what command triggers the issue ?
>
> Those rules should only be visible on parser regeneration (ie.
> REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
> issue:
>
> % make -v
> GNU Make 3.82
>
> % make REGENERATE_PARSERS=y defconfig
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> SHIPPED scripts/kconfig/zconf.tab.c
> SHIPPED scripts/kconfig/zconf.lex.c
> SHIPPED scripts/kconfig/zconf.hash.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> *** Default configuration is based on 'x86_64_defconfig'
> [...]
>
> The shipped file are still there:
>
> % ls scripts/kconfig/*_shipped
> scripts/kconfig/zconf.hash.c_shipped
> scripts/kconfig/zconf.lex.c_shipped
> scripts/kconfig/zconf.tab.c_shipped
>
a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
I definitively needs enlightenment on this one :)
Thanks,
- Arnaud
>
>> ---
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index aeea84a..5d986d9 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
>> quiet_cmd_gperf = GPERF $@
>> cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
>>
>> +.PRECIOUS: $(src)/%.hash.c_shipped
>> $(src)/%.hash.c_shipped: $(src)/%.gperf
>> $(call cmd,gperf)
>>
>> @@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
>> quiet_cmd_flex = LEX $@
>> cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.lex.c_shipped
>> $(src)/%.lex.c_shipped: $(src)/%.l
>> $(call cmd,flex)
>>
>> @@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
>> quiet_cmd_bison = YACC $@
>> cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.tab.c_shipped
>> $(src)/%.tab.c_shipped: $(src)/%.y
>> $(call cmd,bison)
>>
>> quiet_cmd_bison_h = YACC $@
>> cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.tab.h_shipped
>> $(src)/%.tab.h_shipped: $(src)/%.y
>> $(call cmd,bison_h)
>>
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 16:58 ` Arnaud Lacombe
@ 2011-07-31 17:08 ` Peter Foley
2011-07-31 17:22 ` Arnaud Lacombe
2011-07-31 17:25 ` Arnaud Lacombe
0 siblings, 2 replies; 12+ messages in thread
From: Peter Foley @ 2011-07-31 17:08 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Peter Foley, Linux Kernel Mailing List, Linux Kbuild Mailing List,
mmarek
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2739 bytes --]
On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> > Hi,
> >
> > On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
> >> commit 7373f4f (kbuild: add implicit rules for parser generation)
> >> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
> >> because it considers them intermediate files. Mark the _shipped files PRECIOUS
> >> to prevent make from deleting them.
> >>
> >> Signed-off-by: Peter Foley <pefoley2@verizon.net>
> > What make are you using, and what command triggers the issue ?
> >
> > Those rules should only be visible on parser regeneration (ie.
> > REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
> > issue:
> >
> > % make -v
> > GNU Make 3.82
> >
> > % make REGENERATE_PARSERS=y defconfig
> > HOSTCC scripts/basic/fixdep
> > HOSTCC scripts/kconfig/conf.o
> > SHIPPED scripts/kconfig/zconf.tab.c
> > SHIPPED scripts/kconfig/zconf.lex.c
> > SHIPPED scripts/kconfig/zconf.hash.c
> > HOSTCC scripts/kconfig/zconf.tab.o
> > HOSTLD scripts/kconfig/conf
> > *** Default configuration is based on 'x86_64_defconfig'
> > [...]
> >
> > The shipped file are still there:
> >
> > % ls scripts/kconfig/*_shipped
> > scripts/kconfig/zconf.hash.c_shipped
> > scripts/kconfig/zconf.lex.c_shipped
> > scripts/kconfig/zconf.tab.c_shipped
> >
> a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
>
> I definitively needs enlightenment on this one :)
>
> Thanks,
> - Arnaud
The problem only appears when the parsers are actually rebuilt.
rm scripts/kconfig/*_shipped
make REGENERATE_PARSERS=1 defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.c_shipped
SHIPPED scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c_shipped
SHIPPED scripts/kconfig/zconf.lex.c
GPERF scripts/kconfig/zconf.hash.c_shipped
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/zconf.tab.c: In function 'header_print_comment':
scripts/kconfig/confdata.c:551:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
scripts/kconfig/zconf.tab.c: In function 'kconfig_print_comment':
scripts/kconfig/confdata.c:467:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
rm scripts/kconfig/zconf.hash.c_shipped scripts/kconfig/zconf.tab.c_shipped scripts/kconfig/zconf.lex.c_shipped
Thanks,
Peter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 17:08 ` Peter Foley
@ 2011-07-31 17:22 ` Arnaud Lacombe
2011-07-31 17:25 ` Arnaud Lacombe
1 sibling, 0 replies; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 17:22 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 1:08 PM, Peter Foley <pefoley2@verizon.net> wrote:
> On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
>
>> Hi,
>>
>> On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> > Hi,
>> >
>> > On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
>> >> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> >> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
>> >> because it considers them intermediate files. Mark the _shipped files PRECIOUS
>> >> to prevent make from deleting them.
>> >>
>> >> Signed-off-by: Peter Foley <pefoley2@verizon.net>
>> > What make are you using, and what command triggers the issue ?
>> >
>> > Those rules should only be visible on parser regeneration (ie.
>> > REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
>> > issue:
>> >
>> > % make -v
>> > GNU Make 3.82
>> >
>> > % make REGENERATE_PARSERS=y defconfig
>> > HOSTCC scripts/basic/fixdep
>> > HOSTCC scripts/kconfig/conf.o
>> > SHIPPED scripts/kconfig/zconf.tab.c
>> > SHIPPED scripts/kconfig/zconf.lex.c
>> > SHIPPED scripts/kconfig/zconf.hash.c
>> > HOSTCC scripts/kconfig/zconf.tab.o
>> > HOSTLD scripts/kconfig/conf
>> > *** Default configuration is based on 'x86_64_defconfig'
>> > [...]
>> >
>> > The shipped file are still there:
>> >
>> > % ls scripts/kconfig/*_shipped
>> > scripts/kconfig/zconf.hash.c_shipped
>> > scripts/kconfig/zconf.lex.c_shipped
>> > scripts/kconfig/zconf.tab.c_shipped
>> >
>> a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
>>
>> I definitively needs enlightenment on this one :)
>>
>> Thanks,
>> - Arnaud
>
> The problem only appears when the parsers are actually rebuilt.
> rm scripts/kconfig/*_shipped
> make REGENERATE_PARSERS=1 defconfig
>
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> YACC scripts/kconfig/zconf.tab.c_shipped
> SHIPPED scripts/kconfig/zconf.tab.c
> LEX scripts/kconfig/zconf.lex.c_shipped
> SHIPPED scripts/kconfig/zconf.lex.c
> GPERF scripts/kconfig/zconf.hash.c_shipped
> SHIPPED scripts/kconfig/zconf.hash.c
> HOSTCC scripts/kconfig/zconf.tab.o
> scripts/kconfig/zconf.tab.c: In function 'header_print_comment':
> scripts/kconfig/confdata.c:551:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
> scripts/kconfig/zconf.tab.c: In function 'kconfig_print_comment':
> scripts/kconfig/confdata.c:467:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
> HOSTLD scripts/kconfig/conf
> *** Default configuration is based on 'x86_64_defconfig'
> #
> # configuration written to .config
> #
> rm scripts/kconfig/zconf.hash.c_shipped scripts/kconfig/zconf.tab.c_shipped scripts/kconfig/zconf.lex.c_shipped
>
What version of make are you using ?
I still can not reproduce with either make-3.81 or make-3.82:
% touch scripts/kconfig/*.[ylg]*
% make-3.81 REGENERATE_PARSERS=y defconfig
YACC scripts/kconfig/zconf.tab.c_shipped
SHIPPED scripts/kconfig/zconf.tab.c
GPERF scripts/kconfig/zconf.hash.c_shipped
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
% touch scripts/kconfig/*.[ylg]*
% make REGENERATE_PARSERS=y defconfig
YACC scripts/kconfig/zconf.tab.c_shipped
SHIPPED scripts/kconfig/zconf.tab.c
GPERF scripts/kconfig/zconf.hash.c_shipped
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
Thanks,
- Arnaud
> Thanks,
>
> Peter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 17:08 ` Peter Foley
2011-07-31 17:22 ` Arnaud Lacombe
@ 2011-07-31 17:25 ` Arnaud Lacombe
2011-07-31 17:37 ` Peter Foley
1 sibling, 1 reply; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 17:25 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 1:08 PM, Peter Foley <pefoley2@verizon.net> wrote:
> On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
>
>> Hi,
>>
>> On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> > Hi,
>> >
>> > On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
>> >> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> >> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
>> >> because it considers them intermediate files. Mark the _shipped files PRECIOUS
>> >> to prevent make from deleting them.
>> >>
>> >> Signed-off-by: Peter Foley <pefoley2@verizon.net>
>> > What make are you using, and what command triggers the issue ?
>> >
>> > Those rules should only be visible on parser regeneration (ie.
>> > REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
>> > issue:
>> >
>> > % make -v
>> > GNU Make 3.82
>> >
>> > % make REGENERATE_PARSERS=y defconfig
>> > HOSTCC scripts/basic/fixdep
>> > HOSTCC scripts/kconfig/conf.o
>> > SHIPPED scripts/kconfig/zconf.tab.c
>> > SHIPPED scripts/kconfig/zconf.lex.c
>> > SHIPPED scripts/kconfig/zconf.hash.c
>> > HOSTCC scripts/kconfig/zconf.tab.o
>> > HOSTLD scripts/kconfig/conf
>> > *** Default configuration is based on 'x86_64_defconfig'
>> > [...]
>> >
>> > The shipped file are still there:
>> >
>> > % ls scripts/kconfig/*_shipped
>> > scripts/kconfig/zconf.hash.c_shipped
>> > scripts/kconfig/zconf.lex.c_shipped
>> > scripts/kconfig/zconf.tab.c_shipped
>> >
>> a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
>>
>> I definitively needs enlightenment on this one :)
>>
>> Thanks,
>> - Arnaud
>
> The problem only appears when the parsers are actually rebuilt.
> rm scripts/kconfig/*_shipped
^^^^^
This is why. You do not (or at least no longer) need to remove the
*_shipped files before regenerating them.
- Arnaud
> make REGENERATE_PARSERS=1 defconfig
>
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> YACC scripts/kconfig/zconf.tab.c_shipped
> SHIPPED scripts/kconfig/zconf.tab.c
> LEX scripts/kconfig/zconf.lex.c_shipped
> SHIPPED scripts/kconfig/zconf.lex.c
> GPERF scripts/kconfig/zconf.hash.c_shipped
> SHIPPED scripts/kconfig/zconf.hash.c
> HOSTCC scripts/kconfig/zconf.tab.o
> scripts/kconfig/zconf.tab.c: In function 'header_print_comment':
> scripts/kconfig/confdata.c:551:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
> scripts/kconfig/zconf.tab.c: In function 'kconfig_print_comment':
> scripts/kconfig/confdata.c:467:10: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result]
> HOSTLD scripts/kconfig/conf
> *** Default configuration is based on 'x86_64_defconfig'
> #
> # configuration written to .config
> #
> rm scripts/kconfig/zconf.hash.c_shipped scripts/kconfig/zconf.tab.c_shipped scripts/kconfig/zconf.lex.c_shipped
>
> Thanks,
>
> Peter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 17:25 ` Arnaud Lacombe
@ 2011-07-31 17:37 ` Peter Foley
2011-07-31 18:37 ` Arnaud Lacombe
0 siblings, 1 reply; 12+ messages in thread
From: Peter Foley @ 2011-07-31 17:37 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Peter Foley, Linux Kernel Mailing List, Linux Kbuild Mailing List,
mmarek
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2268 bytes --]
On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 1:08 PM, Peter Foley <pefoley2@verizon.net> wrote:
> > On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
> >
> >> Hi,
> >>
> >> On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
> >> >> commit 7373f4f (kbuild: add implicit rules for parser generation)
> >> >> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
> >> >> because it considers them intermediate files. Mark the _shipped files PRECIOUS
> >> >> to prevent make from deleting them.
> >> >>
> >> >> Signed-off-by: Peter Foley <pefoley2@verizon.net>
> >> > What make are you using, and what command triggers the issue ?
> >> >
> >> > Those rules should only be visible on parser regeneration (ie.
> >> > REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
> >> > issue:
> >> >
> >> > % make -v
> >> > GNU Make 3.82
> >> >
> >> > % make REGENERATE_PARSERS=y defconfig
> >> > HOSTCC scripts/basic/fixdep
> >> > HOSTCC scripts/kconfig/conf.o
> >> > SHIPPED scripts/kconfig/zconf.tab.c
> >> > SHIPPED scripts/kconfig/zconf.lex.c
> >> > SHIPPED scripts/kconfig/zconf.hash.c
> >> > HOSTCC scripts/kconfig/zconf.tab.o
> >> > HOSTLD scripts/kconfig/conf
> >> > *** Default configuration is based on 'x86_64_defconfig'
> >> > [...]
> >> >
> >> > The shipped file are still there:
> >> >
> >> > % ls scripts/kconfig/*_shipped
> >> > scripts/kconfig/zconf.hash.c_shipped
> >> > scripts/kconfig/zconf.lex.c_shipped
> >> > scripts/kconfig/zconf.tab.c_shipped
> >> >
> >> a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
> >>
> >> I definitively needs enlightenment on this one :)
> >>
> >> Thanks,
> >> - Arnaud
> >
> > The problem only appears when the parsers are actually rebuilt.
> > rm scripts/kconfig/*_shipped
> ^^^^^
>
> This is why. You do not (or at least no longer) need to remove the
> *_shipped files before regenerating them.
>
> - Arnaud
Ok, I deleted the _shipped files as a easy way to force regeneration but
touching the source files works just as well.
Please disregard this patch.
Thanks,
Peter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: kbuild: prevent make from deleting _shipped files
2011-07-31 17:37 ` Peter Foley
@ 2011-07-31 18:37 ` Arnaud Lacombe
2011-07-31 18:45 ` [PATCH v2] " Peter Foley
0 siblings, 1 reply; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 18:37 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 1:37 PM, Peter Foley <pefoley2@verizon.net> wrote:
> On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
>
>> Hi,
>>
>> On Sun, Jul 31, 2011 at 1:08 PM, Peter Foley <pefoley2@verizon.net> wrote:
>> > On Sun, 31 Jul 2011, Arnaud Lacombe wrote:
>> >
>> >> Hi,
>> >>
>> >> On Sun, Jul 31, 2011 at 12:21 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > On Sun, Jul 31, 2011 at 11:37 AM, Peter Foley <pefoley2@verizon.net> wrote:
>> >> >> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> >> >> created a implicit rule chain (%.c: %.c_shipped: %.y). This causes make to delete the _shipped files
>> >> >> because it considers them intermediate files. Mark the _shipped files PRECIOUS
>> >> >> to prevent make from deleting them.
>> >> >>
>> >> >> Signed-off-by: Peter Foley <pefoley2@verizon.net>
>> >> > What make are you using, and what command triggers the issue ?
>> >> >
>> >> > Those rules should only be visible on parser regeneration (ie.
>> >> > REGENERATE_PARSERS defined). make 3.82 does not seem to trigger the
>> >> > issue:
>> >> >
>> >> > % make -v
>> >> > GNU Make 3.82
>> >> >
>> >> > % make REGENERATE_PARSERS=y defconfig
>> >> > HOSTCC scripts/basic/fixdep
>> >> > HOSTCC scripts/kconfig/conf.o
>> >> > SHIPPED scripts/kconfig/zconf.tab.c
>> >> > SHIPPED scripts/kconfig/zconf.lex.c
>> >> > SHIPPED scripts/kconfig/zconf.hash.c
>> >> > HOSTCC scripts/kconfig/zconf.tab.o
>> >> > HOSTLD scripts/kconfig/conf
>> >> > *** Default configuration is based on 'x86_64_defconfig'
>> >> > [...]
>> >> >
>> >> > The shipped file are still there:
>> >> >
>> >> > % ls scripts/kconfig/*_shipped
>> >> > scripts/kconfig/zconf.hash.c_shipped
>> >> > scripts/kconfig/zconf.lex.c_shipped
>> >> > scripts/kconfig/zconf.tab.c_shipped
>> >> >
>> >> a bare make-3.81 from ftp.gnu.org built on a Fedora 14 behave the same.
>> >>
>> >> I definitively needs enlightenment on this one :)
>> >>
>> >> Thanks,
>> >> - Arnaud
>> >
>> > The problem only appears when the parsers are actually rebuilt.
>> > rm scripts/kconfig/*_shipped
>> ^^^^^
>>
>> This is why. You do not (or at least no longer) need to remove the
>> *_shipped files before regenerating them.
>>
>> - Arnaud
>
> Ok, I deleted the _shipped files as a easy way to force regeneration but
> touching the source files works just as well.
> Please disregard this patch.
>
I think it is still valuable, especially when _shipped files are
created, we want make to keep them. Could you update the changelog to
mention in which case this is happening and re-send ?
Thanks,
- Arnaud
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] kbuild: prevent make from deleting _shipped files
2011-07-31 18:37 ` Arnaud Lacombe
@ 2011-07-31 18:45 ` Peter Foley
2011-07-31 19:03 ` Arnaud Lacombe
0 siblings, 1 reply; 12+ messages in thread
From: Peter Foley @ 2011-07-31 18:45 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Peter Foley, Linux Kernel Mailing List, Linux Kbuild Mailing List,
mmarek
commit 7373f4f (kbuild: add implicit rules for parser generation)
created a implicit rule chain (%.c: %.c_shipped: %.y).
Make considers the _shipped files to be intermediate files which
causes them to be deleted if they didn't exist before make was run.
Mark the _shipped files PRECIOUS to prevent make from deleting them.
Signed-off-by: Peter Foley <pefoley2@verizon.net>
---
V2: update changelog to specify files are only deleted when they did not
already exist
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index aeea84a..5d986d9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
quiet_cmd_gperf = GPERF $@
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
+.PRECIOUS: $(src)/%.hash.c_shipped
$(src)/%.hash.c_shipped: $(src)/%.gperf
$(call cmd,gperf)
@@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
quiet_cmd_flex = LEX $@
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
+.PRECIOUS: $(src)/%.lex.c_shipped
$(src)/%.lex.c_shipped: $(src)/%.l
$(call cmd,flex)
@@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
+.PRECIOUS: $(src)/%.tab.c_shipped
$(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison)
quiet_cmd_bison_h = YACC $@
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
+.PRECIOUS: $(src)/%.tab.h_shipped
$(src)/%.tab.h_shipped: $(src)/%.y
$(call cmd,bison_h)
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v2] kbuild: prevent make from deleting _shipped files
2011-07-31 18:45 ` [PATCH v2] " Peter Foley
@ 2011-07-31 19:03 ` Arnaud Lacombe
2011-08-30 0:27 ` Arnaud Lacombe
2011-08-31 14:36 ` Michal Marek
0 siblings, 2 replies; 12+ messages in thread
From: Arnaud Lacombe @ 2011-07-31 19:03 UTC (permalink / raw)
To: Peter Foley; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, mmarek
Hi,
On Sun, Jul 31, 2011 at 2:45 PM, Peter Foley <pefoley2@verizon.net> wrote:
> commit 7373f4f (kbuild: add implicit rules for parser generation)
> created a implicit rule chain (%.c: %.c_shipped: %.y).
> Make considers the _shipped files to be intermediate files which
> causes them to be deleted if they didn't exist before make was run.
> Mark the _shipped files PRECIOUS to prevent make from deleting them.
>
> Signed-off-by: Peter Foley <pefoley2@verizon.net>
Acked-by: Arnaud Lacombe <lacombar@gmail.com>
- Arnaud
> ---
>
> V2: update changelog to specify files are only deleted when they did not
> already exist
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index aeea84a..5d986d9 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
> quiet_cmd_gperf = GPERF $@
> cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
>
> +.PRECIOUS: $(src)/%.hash.c_shipped
> $(src)/%.hash.c_shipped: $(src)/%.gperf
> $(call cmd,gperf)
>
> @@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
> quiet_cmd_flex = LEX $@
> cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.lex.c_shipped
> $(src)/%.lex.c_shipped: $(src)/%.l
> $(call cmd,flex)
>
> @@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
> quiet_cmd_bison = YACC $@
> cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.tab.c_shipped
> $(src)/%.tab.c_shipped: $(src)/%.y
> $(call cmd,bison)
>
> quiet_cmd_bison_h = YACC $@
> cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
>
> +.PRECIOUS: $(src)/%.tab.h_shipped
> $(src)/%.tab.h_shipped: $(src)/%.y
> $(call cmd,bison_h)
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v2] kbuild: prevent make from deleting _shipped files
2011-07-31 19:03 ` Arnaud Lacombe
@ 2011-08-30 0:27 ` Arnaud Lacombe
2011-08-31 14:36 ` Michal Marek
1 sibling, 0 replies; 12+ messages in thread
From: Arnaud Lacombe @ 2011-08-30 0:27 UTC (permalink / raw)
To: mmarek; +Cc: Linux Kernel Mailing List, Linux Kbuild Mailing List, Peter Foley
Hi,
On Sun, Jul 31, 2011 at 3:03 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 2:45 PM, Peter Foley <pefoley2@verizon.net> wrote:
>> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> created a implicit rule chain (%.c: %.c_shipped: %.y).
>> Make considers the _shipped files to be intermediate files which
>> causes them to be deleted if they didn't exist before make was run.
>> Mark the _shipped files PRECIOUS to prevent make from deleting them.
>>
>> Signed-off-by: Peter Foley <pefoley2@verizon.net>
>
> Acked-by: Arnaud Lacombe <lacombar@gmail.com>
>
ping, Michal ?
- Arnaud
> - Arnaud
>
>> ---
>>
>> V2: update changelog to specify files are only deleted when they did not
>> already exist
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index aeea84a..5d986d9 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
>> quiet_cmd_gperf = GPERF $@
>> cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
>>
>> +.PRECIOUS: $(src)/%.hash.c_shipped
>> $(src)/%.hash.c_shipped: $(src)/%.gperf
>> $(call cmd,gperf)
>>
>> @@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
>> quiet_cmd_flex = LEX $@
>> cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.lex.c_shipped
>> $(src)/%.lex.c_shipped: $(src)/%.l
>> $(call cmd,flex)
>>
>> @@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
>> quiet_cmd_bison = YACC $@
>> cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.tab.c_shipped
>> $(src)/%.tab.c_shipped: $(src)/%.y
>> $(call cmd,bison)
>>
>> quiet_cmd_bison_h = YACC $@
>> cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
>>
>> +.PRECIOUS: $(src)/%.tab.h_shipped
>> $(src)/%.tab.h_shipped: $(src)/%.y
>> $(call cmd,bison_h)
>>
>>
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v2] kbuild: prevent make from deleting _shipped files
2011-07-31 19:03 ` Arnaud Lacombe
2011-08-30 0:27 ` Arnaud Lacombe
@ 2011-08-31 14:36 ` Michal Marek
1 sibling, 0 replies; 12+ messages in thread
From: Michal Marek @ 2011-08-31 14:36 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Peter Foley, Linux Kernel Mailing List, Linux Kbuild Mailing List
On 31.7.2011 21:03, Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jul 31, 2011 at 2:45 PM, Peter Foley <pefoley2@verizon.net> wrote:
>> commit 7373f4f (kbuild: add implicit rules for parser generation)
>> created a implicit rule chain (%.c: %.c_shipped: %.y).
>> Make considers the _shipped files to be intermediate files which
>> causes them to be deleted if they didn't exist before make was run.
>> Mark the _shipped files PRECIOUS to prevent make from deleting them.
>>
>> Signed-off-by: Peter Foley <pefoley2@verizon.net>
>
> Acked-by: Arnaud Lacombe <lacombar@gmail.com>
Applied to kbuild-2.6.git#kbuild.
Thanks,
Michal
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-08-31 14:36 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-31 15:37 kbuild: prevent make from deleting _shipped files Peter Foley
2011-07-31 16:21 ` Arnaud Lacombe
2011-07-31 16:58 ` Arnaud Lacombe
2011-07-31 17:08 ` Peter Foley
2011-07-31 17:22 ` Arnaud Lacombe
2011-07-31 17:25 ` Arnaud Lacombe
2011-07-31 17:37 ` Peter Foley
2011-07-31 18:37 ` Arnaud Lacombe
2011-07-31 18:45 ` [PATCH v2] " Peter Foley
2011-07-31 19:03 ` Arnaud Lacombe
2011-08-30 0:27 ` Arnaud Lacombe
2011-08-31 14:36 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox