From: Peter Foley <pefoley2@verizon.net>
To: Arnaud Lacombe <lacombar@gmail.com>
Cc: Peter Foley <pefoley2@verizon.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Kbuild Mailing List <linux-kbuild@vger.kernel.org>,
mmarek@suse.cz
Subject: [PATCH v2] kbuild: prevent make from deleting _shipped files
Date: Sun, 31 Jul 2011 14:45:40 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.00.1107311437460.28279@linux> (raw)
In-Reply-To: <CACqU3MWHRJXRu5sOvyGhyiqV94=UmDfCxixf-okkGuphxUFRTQ@mail.gmail.com>
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)
next prev parent reply other threads:[~2011-07-31 19:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Peter Foley [this message]
2011-07-31 19:03 ` [PATCH v2] " Arnaud Lacombe
2011-08-30 0:27 ` Arnaud Lacombe
2011-08-31 14:36 ` Michal Marek
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=alpine.LNX.2.00.1107311437460.28279@linux \
--to=pefoley2@verizon.net \
--cc=lacombar@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
/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