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).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming that
input.txtis a source file that is distributed, that you do not want to distributegenerated.c(i.e., it must be built by each user), and thatgeneratoris 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.amexample to declaregeneratoras a non-installed program.