0

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?

spraff
  • 32,570
  • 22
  • 121
  • 229
  • How do you run your Makefile? Check for capitalization, perhaps you have both makefile and Makefile in your directory? – Palo Jan 01 '15 at 16:59
  • there seems to be an explanation here: http://stackoverflow.com/questions/15189704/makefile-removes-object-files-for-no-reason – Palo Jan 01 '15 at 17:03

0 Answers0