bug or feature

Joerg Sonnenberger joerg at britannica.bec.de
Thu Jan 6 06:49:12 PST 2005


On Wed, Jan 05, 2005 at 09:23:20PM -0800, Matthew Dillon wrote:
>     There's nothing wrong with make.  The make clean target is not removing
>     the temporary expr.c file generated by previous runs of make before you
>     changed expr.y to expr.c, and it is that expr.c that it is finding.
> 
>     If you do that you will see that the standard conversion rules will
>     cause yacc to be run to generate the .c file from the .y file.  That's
>     documented conversion rule behavior for make.
> 
>     So the bug is simply that the Makefile is missing a CLEANFILES= expr.c
>     line (or one of the .mk files is).

It's not that simple. Just create a new directory, copy the expr.y into it
and add a Makefile containing only "expr: expr.c". Run make and it will
create the expr.c from expr.y.

Second try: create expr.c and touch expr.y afterwards. It will still run
yacc to generate expr.c.

This is what created the problem with GCC 3.4 back than, we had both
the bison generated C sources (which I originally had in the
Makefile's SRCS) and the .y source. CVS checkout creates X.c before X.y,
so the yacc source is always newer than the C source. It wasn't a problem
in the GCC case, because yacc handles the sources fine. It can be a problem
for newer CVS version, because the included getdate.y isn't compilable by
yacc anymore. I'm thinking about adding the reentrant parser support, but
I have to read the sources more.

Joerg





More information about the Kernel mailing list