* lib/am/yacc.am (?!GENERIC?%OBJ% aka .y.c): Don't redirect
authorJim Meyering <jim@meyering.net>
Fri, 18 Apr 2003 08:54:34 +0000 (08:54 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 18 Apr 2003 08:54:34 +0000 (08:54 +0000)
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
lib/am/yacc.am

index 897008c..3101685 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-18  Jim Meyering  <jim@meyering.net>
+
+       * 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  <rich@phekda.freeserve.co.uk>
 
        * tests/defs.in: Handle required=runtest, to detect runtest
index eb0083d..cc799c4 100644 (file)
@@ -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%