I have a bit of file processing to do in Automake and can’t figure out how to do it correctly (using either automake rules of gnu make extensions). For example, I have a file called refName.in and wish to produce the output refName.out. I have two relevant command-lines:
produce-out refName.in refName.out
produce-deps refName.in
The first simply takes the input file and produces the output. The second provides a list of dependencies for the file.
What am I supposed to do in Automake to get this setup working? I wish to have full dependency tracking, such that if any file in the list produced by produce-deps will trigger produce-out to be called.
(NOTE: I have no problem changing how these commands work. One command can produce the output and dependencies if needed. Different command-line switches, etc. can also be modified.)
(PS: If need be a GNU make extension is totally okay. I already use patterned rules in the Makefile.am and other extensions.)
The only automake specific thing you need for this is to add the built file to
BUILT_SOURCES:If you want a more sophisticated way of doing the dependencies you can use these rules with GNU make’s
include, which will only cause produce-deps to be run when refName.deps is missing or refName.in changes:You can make these rules generic with the usual GNU make
%rules.