This question builds upon How to generate a source file when building using autotools
I want to do something like
<generated-c-files>: input.txt generator
./generator input.txt # produces <generated-c-files>
The earlier question answers this scenario when the generated c file(s) have fixed name(s) known a priori. However, I have a variable number of files with variable names being generated, depending on the contents of input.txt. What is a good way to do it with autotools?
I am using wildcards to pick up all generated files, which are being placed in a single build folder. However, this requires me to make
twice, where the first make
fails to link. This seems to be because the wildcard is evaluated before generator
is executed. I would like to do it with one successful make
and, preferably, not use wildcards.