On 11/02/2016 08:06 PM, Raphaël Halimi wrote:
Hi Peter,
Thanks for your answer.
Just to make sure I understand:
CLEANFILES += data/.dirstamp
data/.dirstamp:
@$(MKDIR_P) data
@: > $@
This creates a directory "data", and then a file ".dirstamp" in this
directory by redirecting the (empty) result of the "true" command to
this file.
Yes, I stole this rule from the rule generated by Automake when it
creates files in subdirs.
data/foo.txt: data/.dirstamp
<some rule>
This creates a file "foo.txt" (in my case it would be a shell script) in
the "data" directory according to a some rule.
Correct
Unlike the other solution, this doesn't involve configure.ac, and so
it's usable with a "pure" automake setup (without autoconf). This is not
the case of my current setup but still, I see this as an advantage, to
clearly separate the "configure" phase and the "make" phase (I'm still
new to autotools).
Yes, I prefer to have the code for this in Makefile.am (rather than
configure.ac); it's the natural place to look when 'make' doesn't work
and easier for new developers to understand, imho.
Cheers,
Peter