From: Jim Meyering Date: Fri, 18 Apr 2003 08:54:34 +0000 (+0000) Subject: * lib/am/yacc.am (?!GENERIC?%OBJ% aka .y.c): Don't redirect X-Git-Tag: Release-1-7-3b~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50ca3cb88daa5cfa1d05adc7fa062df6659973c0;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 897008caf..310168580 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 eb0083dd1..cc799c49a 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%