Akim Demaille <akim(a)epita.fr> writes:
$(srcdir)/ast-fwd-gen.stamp: $(gen_dir)/ast-fwd-gen $(ast_gen_deps)
@rm -rf $@.tmp
@touch $@.tmp
$(gen_dir)/ast-fwd-gen $(srcdir) < $(srcdir)/ast.xml
@mv -f $@.tmp $@
fwd.hh: ast-fwd-gen.stamp
##
## Why use such a mechanism to update stamp?
Read Automake.texi.
[...]
Oh la :)
You explained me,
Then I used,
The stamp trick
When I was
Working on TC's AST generation
I meant: "why touch $@ is not enough?"
Because:
`data.tmp' is created before `foo' is run, so it has a timestamp
older than output files output by `foo'. It is then renamed to
`data.stamp' after `foo' has run, because we do not want to update
`data.stamp' if `foo' fails.
Thanks!
--
Noe