PATCH: Remove generated YACC stuff
Alexandre Oliva
aoliva@redhat.com
Sat Jul 29 14:25:00 GMT 2000
On Jul 29, 2000, Mark Mitchell <mark@codesourcery.com> wrote:
> $(srcdir)/c-parse.y $(srcdir)/objc-parse.y: c-parse.in
> If make decides to build both c-parse.y and objc-parse.y at once,
> craziness ensues. I'll fix this up as best I can.
The only sane way to deal with such multi-target rules in the context
of parallel makes is to use a timestamp file. Something like:
$(srcdir)/c-parse.y $(srcdir)/objc-parse.y: stamp-cparse
# Ensure that, if one of the built files is removed, ensure that
# they'll be built next time. This build will fail, though.
@test -f $@ || rm -f stamp-cparse
stamp-cparse: $(srcdir)/c-parse.in
... # Build the *-parse.y files
@echo timestamp > $@
Unfortunately, this means we'd have to include the stamp file in the
distribution or perform a poor man's dependency test in order to
decide whether to re-generate the files even if it is only the stamp
file that's missing. Something like (untested):
# If both generated files exist and are newer than the input...
if x`ls -1t $(srcdir)/c-parse.in \
$(srcdir)/c-parse.y $(srcdir)/objc-parse.y | \
sed -n 3p` = x$(srcdir)/c-parse.in; then
... # Build both of them
fi
@echo timestamp > $@
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Gcc-patches
mailing list