chiark / gitweb /
overflow-tube: cut adjustments
[quacks.git] / Makefile
index 66494c02f2c601017c65379ca47b77e27158f87b..0df6e5d64ef6c3d3c55f62fd2a8b3502da510a60 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 # Copyright 2020-2021 Ian Jackson
 
 PUBLISH_MD += pumpkin-books house-rules
-PUBLISH += pumpkin-books.pdf index.html
+PUBLISH += pumpkin-books.pdf overflow-tube.pdf index.html
 PUBLISH += LICENCE.txt GPL-3.txt CC-BY-SA-4.0.txt
 PUBLISH += $(addsuffix .md.txt,  $(PUBLISH_MD))
 PUBLISH += $(addsuffix .md.html, $(PUBLISH_MD))
@@ -27,15 +27,16 @@ all:        $(PUBLISH)
 
 # Don't print the ps, printers (eg ours!) don't always have the fonts
 
-o=>$@.new && mv -f $@.new $@
+i=mv -f $@.new $@
+o=>$@.new && $i
 use_rsvg=rsvg-convert -f png -o $@.tmp.png $<
 shell_pipe=set -o pipefail; set -e;
 make_pnm = pnmdepth 255 | pnmnoraw $o
 
-pumpkin-books.ps: pumpkin-books.ps.pl bag.pgm pot.pgm droplet.ppm
+%.ps: %.ps.pl bag.pgm pot.pgm droplet.ppm
        ./$< $(BOOKS) $o
 
-pumpkin-books.pdf: pumpkin-books.ps
+%.pdf: %.ps
        gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress \
                -sDEVICE=pdfwrite -sOutputFile=$@ $<
 
@@ -62,12 +63,13 @@ droplet.ppm: droplet.svg Makefile
        | $(make_pnm)
 
 $(addsuffix .ps, $(BOOK_STEMS)): pumpkin-books.ps
+       @:
 
 book-%.pdf: book-%.eps
-       rm -f $@; ps2pdf $<
+       rm -f $@.new; ps2pdf $< $@.new && $i
 
 book-%.eps: book-%.ps
-       rm -f $@; ps2eps $<
+       ps2eps <$< $o
 
 book-%.png: book-%.eps Makefile
        gm convert -density 100x100 $< $@