I have a project which includes a code generator which generates several .c and .h files from one input file with just one invocation of the code generator. I have a rule w
Here is the solution that seemed to work for me (credit to @Ivan Zaentsev for the main solution and to @alexei for pointing out the problem with it). It is similar to the original approach with one major change. Instead of generating temporary files (*.gen
as suggested), it just touch
es the files that depend on the INTERMEDIATE
file. :
default: f
.INTERMEDIATE: temp
a b c: temp
touch $@
temp: i1 i2
echo "BUILD: a b c"
cat i1 i2 > a
cat i1 i2 > b
cat i1 i2 > c
e: a b c
echo "BUILD: e"
touch $@
f: e
echo "BUILD: f"
touch $@