This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: RFC: doc for `Handling Tools that Produce Many Outputs'
- From: Alexandre Duret-Lutz <adl at src dot lip6 dot fr>
- To: "Tim Van Holder" <tim dot van dot holder at pandora dot be>
- Cc: 'Eric Siegerman' <erics at telepres dot com>, automake at gnu dot org
- Date: Fri, 06 Feb 2004 09:27:59 +0100
- Subject: Re: RFC: doc for `Handling Tools that Produce Many Outputs'
- References: <20040205072640.BA8FD907A1@iceage.anubex.com>
Tim:
| Wouldn't this help somewhat for a case like this:
|
| data.h: data.c
| @if test -f $@; then \
| touch $@; \
| else \
| rm -f data.c; \
| $(MAKE) $(AM_MAKEFLAGS) data.c; \
| fi
Good point! I'll update the doc with this.
FWIW, the reason we do
if test -f $@; then :; else \
rm -f data.c; \
$(MAKE) $(AM_MAKEFLAGS) data.c; \
fi
in automake is that the code was first used in the rebuild rule
for config.h.
config.h: stamp-h
## Recover from removal of config.h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(top_builddir)/config.status
@rm -f stamp-h
cd $(top_builddir) && $(SHELL) ./config.status config.h
config.status tries not to update config.h when it has not
changed so that files that depend upon config.h are not
recompiled needlessly. So if stamp-h is older than config.h it
does not means that config.h is out-dated.
This snippet was then copied to the bison rules without thinking
much about it. It happens that this is OK, because the bison
rules also try not to update the parser.h header file to speed
up recompilation. So we do not want the `touch' there either...
--
Alexandre Duret-Lutz