PUBLISH_MD += pumpkin-books house-rules PUBLISH += pumpkin-books.pdf README.html PUBLISH += $(addsuffix .md.txt, $(PUBLISH_MD)) PUBLISH += $(addsuffix .md.html, $(PUBLISH_MD)) PUBLISH += $(addsuffix .md.pdf, $(PUBLISH_MD)) SHELL=bash all: $(PUBLISH) # Don't print the ps, printers (eg ours!) don't always have the fonts o=>$@.new && mv -f $@.new $@ 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 ./$< $o pumpkin-books.pdf: pumpkin-books.ps gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress \ -sDEVICE=pdfwrite -sOutputFile=$@ $< bag.pgm: Sack_-_Sac_-_Zak_brown.svg Makefile $(use_rsvg) $(shell_pipe) \ pngtopnm <$@.tmp.png -mix -background 'white' \ | ppmtopgm \ | $(make_pnm) pot.pgm: 146_Kaldrono.svg Makefile $(use_rsvg) $(shell_pipe) \ pngtopnm <$@.tmp.png \ | ppmtopgm \ | pnminvert \ | $(make_pnm) droplet.ppm: droplet.svg Makefile $(use_rsvg) $(shell_pipe) \ pngtopnm <$@.tmp.png -mix -background 'white' \ | pnmdepth 255 \ | $(make_pnm) PUBLISH_FILES= \ $(patsubst %.md,%.md.txt, $(PUBLISH)) \ $(patsubst %.md,%.md.html, $(filter $(PUBLISH)) \ %.md.txt: %.md cat $< $o %.md.html: %.md Makefile pandoc -s $< $o %.md.pdf: %.md Makefile pandoc --pdf-engine=wkhtmltopdf -o $@ $< pubssh=c pubpath=games-rules/quacks puburl=https://www.chiark.greenend.org.uk/~ijackson/README.html publish: $(PUBLISH) git push origin rsync $^ $(pubssh):public-html/$(pubpath)/. @echo $(puburl)$(pubpath)/