I'm running the following kind of pipeline:
digestA: hugefileB hugefileC
cat $^ > $@
rm $^
hugefileB:
touch $@
hugefileC:
touch $@
The targets hugefileB and hugefileC are very big and take a long time to compute (and need the power of Make). But once digestA has been created, there is no need to keep its dependencies: it deletes those dependencies to free up disk space.
Now, if I invoke 'make' again, hugefileB and hugefileC will be rebuilt, whereas digestA is already ok.
Is there any way to tell 'make' to avoid to re-comile the dependencies ?
NOTE: I don't want to build the two dependencies inside the rules for 'digestA'.
Best Answer
Use "intermediate files" feature of GNU Make:
So, adding the following line to the Makefile should be enough:
Invoking make for the first time:
And the next time: