the removal of $header.
* lib/am/yacc.am (%BASE%.h): Remove (duplicate with the one
output by lang_yacc_target_hook).
* tests/yacc7.test: Try to recreate foo.h after its removal.
* tests/yacc8.test: Add `AM_YFLAGS = -d' and try to recreate
parse.h too.
Reported by Bernd Jendrissek.
+2002-06-08 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * automake.in (lang_yacc_target_hook): Add rule to recover from
+ the removal of $header.
+ * lib/am/yacc.am (%BASE%.h): Remove (duplicate with the one
+ output by lang_yacc_target_hook).
+ * tests/yacc7.test: Try to recreate foo.h after its removal.
+ * tests/yacc8.test: Add `AM_YFLAGS = -d' and try to recreate
+ parse.h too.
+ Reported by Bernd Jendrissek.
+
2002-06-08 Alexandre Duret-Lutz <duret_g@epita.fr>
For PR automake/317:
Assar Westerlund assar@sics.se
Axel Belinfante Axel.Belinfante@cs.utwente.nl
Bernard Urban Bernard.Urban@meteo.fr
+Bernd Jendrissek berndj@prism.co.za
Bill Currie bcurrie@tssc.co.nz
Bill Davidson bill@kayhay.com
Bill Fenner fenner@parc.xerox.com
# Add a dependency for the generated header file, and arrange
# for that file to be included in the distribution.
# FIXME: this fails for `nodist_*_SOURCES'.
- $output_rules .= "${header}: $output\n";
+ $output_rules .= ("${header}: $output\n"
+ # Recover from removal of $header
+ . "\t\@if test ! -f \$@; then \\\n"
+ . "\t rm -f $output; \\\n"
+ . "\t \$(MAKE) $output; \\\n"
+ . "\telse :; fi\n");
&push_dist_common ($header);
# If the files are built in the build directory, then we want
# to remove them with `make clean'. If they are in srcdir
mv y.output %BASE%.output; \
fi
endif !%?MORE-THAN-ONE%
-
-## Also generate a dependency for the .h file.
-if !%?GENERIC%
-%BASE%.h: %OBJ%
-endif !%?GENERIC%
rm -f foo.h foo.c
$MAKE check-dist || exit 1
+# We should be able to recover if foo.h is deleted.
+
+rm foo.h || exit 1
+$MAKE foo.h || exit 1
+test -f foo.h || exit 1
+
exit 0
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = foo/foo
foo_foo_SOURCES = foo/parse.y
+AM_YFLAGS = -d
END
mkdir foo
test -f foo/parse.c
test -f foo/parse.o
+# Aside of the rest of this test, let's see if we can recover from
+# parse.h removal
+test -f foo/parse.h
+rm -f foo/parse.h
+$MAKE foo/parse.h
+test -f foo/parse.h
+
# Now, adds another parser to test ylwrap.
cd ..