Commit 58238c81 authored by Peter Foley's avatar Peter Foley Committed by Michal Marek

kbuild: prevent make from deleting _shipped files

commit 7373f4f8 (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: default avatarPeter Foley <pefoley2@verizon.net>
Acked-by: default avatarArnaud Lacombe <lacombar@gmail.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent f4b129f5
...@@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS ...@@ -167,6 +167,7 @@ ifdef REGENERATE_PARSERS
quiet_cmd_gperf = GPERF $@ quiet_cmd_gperf = GPERF $@
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< 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 $(src)/%.hash.c_shipped: $(src)/%.gperf
$(call cmd,gperf) $(call cmd,gperf)
...@@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy) ...@@ -177,6 +178,7 @@ LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
quiet_cmd_flex = LEX $@ quiet_cmd_flex = LEX $@
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $< cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
.PRECIOUS: $(src)/%.lex.c_shipped
$(src)/%.lex.c_shipped: $(src)/%.l $(src)/%.lex.c_shipped: $(src)/%.l
$(call cmd,flex) $(call cmd,flex)
...@@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) ...@@ -187,12 +189,14 @@ YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
quiet_cmd_bison = YACC $@ quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $< cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
.PRECIOUS: $(src)/%.tab.c_shipped
$(src)/%.tab.c_shipped: $(src)/%.y $(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison) $(call cmd,bison)
quiet_cmd_bison_h = YACC $@ quiet_cmd_bison_h = YACC $@
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $< cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
.PRECIOUS: $(src)/%.tab.h_shipped
$(src)/%.tab.h_shipped: $(src)/%.y $(src)/%.tab.h_shipped: $(src)/%.y
$(call cmd,bison_h) $(call cmd,bison_h)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment