[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10852: VPATH builds cannot recover from missing parser header
From: |
Akim Demaille |
Subject: |
bug#10852: VPATH builds cannot recover from missing parser header |
Date: |
Mon, 20 Feb 2012 14:24:15 +0100 |
I am having problems in Bison (current master) to recover
from a lost parse-gram.h, generated from parse-gram.y
with regular Automake (1.11.3) handling:
> AM_YFLAGS = -d -v --warnings=all,error --report=all
>
> src_bison_SOURCES = \
> ...
> src/output.h \
> src/parse-gram.y \
> src/print-xml.c \
> ...
Makefile.in:
> src/parse-gram.h: src/parse-gram.c
> @if test ! -f $@; then rm -f src/parse-gram.c; else :; fi
> @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/parse-gram.c; else
> :; fi
The problem is that src/parse-gram.c is in $(srcdir), so
its occurrences in the commands should be prefixed by
$(srcdir)/. Actually, I don't understand why we don't
simply use $< (lemme guess: it's not portable for non
generic recipes, ISTR some horrors in this area that my
brains decided to quickly forget :). Also, why two "if"?
In case some concurrent execution of Make would already have
provided $@ in the meanwhile?
The following patch extends a test which is aimed at checking
this, but does it in a non-vpath build :)
I have a question though. I don't understand how come
Make realizes it must provide $@ in srcdir too.
The Makefile.in features:
> .y.c:
> $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h
> $*.h y.output $*.output -- $(YACCCOMPILE)
and at runtime I have:
> /bin/sh ../../build-aux/ylwrap ../../src/parse-gram.y y.tab.c
> ../../src/parse-gram.c y.tab.h ../../src/parse-gram.h y.output
> ../../src/parse-gram.output -- ./tests/bison -y -d -v --warnings=all,error
> --report=all
> updating ../../src/parse-gram.h
> ../../src/parse-gram.output is unchanged
which is what is expected, but I don't understand why
it works: that $< is prefixed with $(srcdir), this I
understand, but why does it appear on address@hidden I
have to specify $(srcdir)/ by hand on similar patterns,
why does it work here?
Thanks!
0001-tests-check-yacc-parser-header-recovery-in-vpath-bui.patch
Description: Binary data