Here is a Makefile which creates several pdfs from DOT sources. It creates PostScript files as an intermediate step.
all: maps.pdf
D=source_directory
S := $(shell find $D -name '*.dot')
P = $(patsubst $D/%.dot, $D/%.ps, $S)
F = $(patsubst $D/%.dot, $D/%.pdf, $S)
$D/%.ps: $D/%.dot Makefile
dot -Tps:cairo $< > $@
$D/%.pdf: $D/%.ps
ps2pdf $< $@
maps.pdf: $F
pdfjam -q $D/*.pdf -o maps.pdf
It runs fine except that it deletes all the PostScript files after with it runs pdfjam. In fact, it even prints rm source_dir/foo.ps source_dir/bar.ps
to standard output!
Where is the rm command coming from?