With Make, I do something like
generated.c: input.txt generator
./generator input.txt > generated.c
How would I get equivalent functionality out of autotools? (removing generated.c on cleaning would also be a bonus).
With Make, I do something like
generated.c: input.txt generator
./generator input.txt > generated.c
How would I get equivalent functionality out of autotools? (removing generated.c on cleaning would also be a bonus).
I'm assuming that
input.txt
is a source file that is distributed, that you do not want to distributegenerated.c
(i.e., it must be built by each user), and thatgenerator
is a program built by your package too.In some situations, like when generating header files, it is important to generate the file before the rest of the sources are compiled, so it can be included. In that case you should also list the generated file in the variable
BUILT_SOURCES
(The Automake manual has many example in its Built sources section. In the above case it is not necessary.EDIT: I have fixed the above
Makefile.am
example to declaregenerator
as a non-installed program.