From: Ian Jackson Date: Tue, 26 Oct 2021 19:40:55 +0000 (+0100) Subject: break out bag pgm processing X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8a63bf95f3ee26be7e58371a1027fb7e2164b756;p=quacks.git break out bag pgm processing --- diff --git a/Makefile b/Makefile index 3ee9600..5f1102c 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ all: pumpkin-books.pdf # Don't print the ps, printers (eg ours!) don't always have the fonts +use_rsvg=rsvg-convert -f png -o $@.tmp.png $< +shell_pipe=set -o pipefail; set -e; +make_pgm = pnmdepth 255 | pnmnoraw >$@.tmp.new; mv -f $@.tmp.new $@ + pumpkin-books.ps: pumpkin-books.ps.pl bag.pgm ./$< >$@.new && mv -f $@.new $@ @@ -15,13 +19,11 @@ pumpkin-books.pdf: pumpkin-books.ps -sDEVICE=pdfwrite -sOutputFile=$@ $< bag.pgm: Sack_-_Sac_-_Zak_brown.svg Makefile - rsvg-convert -f png -o $@.tmp.png $< - set -o pipefail; set -e; \ + $(use_rsvg) + $(shell_pipe) \ pngtopnm <$@.tmp.png -mix -background 'white' \ | ppmtopgm \ - | pnmdepth 255 \ - | pnmnoraw >$@.tmp.new - mv -f $@.tmp.new $@ + | $(make_pgm) pubssh=c