From 6aa4d7f2bdb3ff594fc5fc26ec089ad7ff6d821b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 18 Apr 2003 08:54:34 +0000 Subject: [PATCH] * lib/am/yacc.am (?!GENERIC?%OBJ% aka .y.c): Don't redirect directly to $@. Instead, redirect to $@t and rename upon success. Also, move the commands that update $@ so they are last. Otherwise, this rule could leave the user with an up to date target (.c file) but with a missing or corrupted corresponding .h file. --- ChangeLog | 8 ++++++++ lib/am/yacc.am | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 897008ca..31016858 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-04-18 Jim Meyering + + * lib/am/yacc.am (?!GENERIC?%OBJ% aka .y.c): Don't redirect + directly to $@. Instead, redirect to $@t and rename upon success. + Also, move the commands that update $@ so they are last. Otherwise, + this rule could leave the user with an up to date target (.c file) + but with a missing or corrupted corresponding .h file. + 2003-04-17 Richard Dawe * tests/defs.in: Handle required=runtest, to detect runtest diff --git a/lib/am/yacc.am b/lib/am/yacc.am index eb0083dd..cc799c49 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -26,9 +26,6 @@ else !%?MORE-THAN-ONE% ?GENERIC? %COMPILE% %SOURCE% ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. ?!GENERIC? %COMPILE% `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -## Edit out `#line' or `#' directives. - sed '/^#/ s|y\.tab\.c|%OBJ%|' y.tab.c >%OBJ% - rm -f y.tab.c ## Edit out Bison multiple inclusion guards. It may be BISON_Y_TAB_H, ## or Y_TAB_H depending upon the version, that's why the regexp is ## so loose. @@ -47,4 +44,7 @@ else !%?MORE-THAN-ONE% if test -f y.output; then \ mv y.output %BASE%.output; \ fi +## Edit out `#line' or `#' directives. + sed '/^#/ s|y\.tab\.c|%OBJ%|' y.tab.c >%OBJ%t && mv %OBJ%t %OBJ% + rm -f y.tab.c endif !%?MORE-THAN-ONE% -- 2.43.5