This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: [PATCH] automake rules fail to make y.tab.h if y.tab.c exists
- From: Bernd Jendrissek <berndj at prism dot co dot za>
- To: Alexandre Duret-Lutz <duret_g at lrde dot epita dot fr>
- Cc: automake at gnu dot org
- Date: Wed, 5 Jun 2002 20:21:21 +0200
- Subject: Re: [PATCH] automake rules fail to make y.tab.h if y.tab.c exists
- References: <20020415160117.A15316@prism.co.za> <2002-06-05-18-41-55+27509+duret_g@epita.fr>
On Wed, Jun 05, 2002 at 06:41:50PM +0200, Alexandre Duret-Lutz wrote:
> [Reviving an unanswered email from mid April]
> >>> "Bernd" == Bernd Jendrissek <berndj@prism.co.za> writes:
>
[...]
>
> Bernd> Stock automake spots the use of "AM_YFLAGS = -d" in
> Bernd> Makefile.am, and emits a rule that y.tab.h (placeholder
> Bernd> name) depends on y.tab.c; this is not formally correct.
> Bernd> When y.tab.h is missing but y.tab.c is present (or
> Bernd> y.tab.c is touched for some reason), make thinks it can
> Bernd> rebuild y.tab.h from y.tab.c - a false assumption since
> Bernd> there is no rule.
>
> I have a pending patch for this at
> http://mail.gnu.org/pipermail/automake-patches/2002-May/000823.html
>
> Basically, it just replaces the `y.tab.h: y.tab.c' dependency by
>
> y.tab.h: y.tab.c
> if test ! -f $@; then \
> rm -f y.tab.c; \
> $(MAKE) y.tab.c; \
> fi
>
> (Automake does something similar in the handling of config.h
> already.)
>
> What do you think? Would this be enough for you?
I seem to be happy with this. It's a much simpler patch, for one. While
the rule does "accidentally" rebuild y.tab.c also, I think that's just fine.
The abovementioned patch (msg 000823) does FAIL against my patches to the
yacc tests, but only because I'm paranoid and flunk automake if y.tab.c is
made by "make y.tab.h"
I'll play around with this patch against my (real) flex/bison parser and
shout loudly in the list if I have problems. But consider me happy.
bernd