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



Reply via email to