automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rb10: .y.h: rules


From: Richard Boulton
Subject: rb10: .y.h: rules
Date: Wed, 22 Aug 2001 02:19:14 +0100
User-agent: Mutt/1.3.20i

Whilst trying to compile evolution with automake branch-real-1.5, I
found that the rule for generating .h files from .y sources doesn't work.
The Makefile.am in question has an explicit dependency in it of the
form:

icallexer.c: icalyacc.h

where icalyacc.h is to be generated from icalyacc.y, and icallexer.c includes
icalyacc.h.

I would expect this dependency to ensure that icalyacc.h is generated
before the rule for icallexer.c is run.  However, the rule produced by
automake for generating icalyacc.h is:

.y.h:
        @:

ie, effectively no actions are specified.  This means that no attempt is made
to generate icalyacc.h, and the compilation of icallexer.c therefore fails.

The attached patch has a testcase for this problem, and a proposed interim fix.
The fix gives a rule for generating the .h by calling make to make the .c,
which will generate the .h as a sideeffect.

The fix is not optimal, since it is inefficient (more submakes than required)
and not particularly good for parallel builds (both the .c and the .h rules
could be executed at once).  However, I can't see any other easy fix, and it
would be good to fix this before the 1.5 release: anything which uses lex and
yacc together is going to be bitten by this bug.

I think the proper fix would be to ensure that for all .c files generated
from .y files, an explicit rule is added making the corresponding .h file
depend on the .c file, but I can't quite figure out the code in automake.in
that would need to be changed to do this.

-- 
Richard

Attachment: branch-real-1-5_patch2
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]