I\'m running the following kind of pipeline:
digestA: hugefileB hugefileC
cat $^ > $@
rm $^
hugefileB:
touch $@
hugefileC:
touch $@
<
If you mark hugefileB
and hugefileC
as intermediate files, you will get the behavior you want:
digestA: hugefileB hugefileC
cat $^ > $@
hugefileB:
touch $@
hugefileC:
touch $@
.INTERMEDIATE: hugefileB hugefileC
For example:
$ gmake
touch hugefileB
touch hugefileC
cat hugefileB hugefileC > digestA
rm hugefileB hugefileC
$ gmake
gmake: `digestA' is up to date.
$ rm -f digestA
$ gmake
touch hugefileB
touch hugefileC
cat hugefileB hugefileC > digestA
rm hugefileB hugefileC
Note that you do not need the explicit rm $^
command anymore -- gmake automatically deletes intermediate files at the end of the build.