chiark / gitweb /
wip pot processing
[quacks.git] / Makefile
1
2 PUBLISH= pumpkin-books.pdf house-rules.md
3
4 SHELL=bash
5
6 all:    pumpkin-books.pdf
7
8 # Don't print the ps, printers (eg ours!) don't always have the fonts
9
10 use_rsvg=rsvg-convert -f png -o $@.tmp.png $<
11 shell_pipe=set -o pipefail; set -e;
12 make_pgm = pnmdepth 255 | pnmnoraw >$@.tmp.new; mv -f $@.tmp.new $@
13
14 pumpkin-books.ps: pumpkin-books.ps.pl bag.pgm pot.pgm
15         ./$< >$@.new && mv -f $@.new $@
16
17 pumpkin-books.pdf: pumpkin-books.ps
18         gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress \
19                 -sDEVICE=pdfwrite -sOutputFile=$@ $<
20
21 bag.pgm: Sack_-_Sac_-_Zak_brown.svg Makefile
22         $(use_rsvg)
23         $(shell_pipe)                                   \
24         pngtopnm <$@.tmp.png -mix -background 'white'   \
25         | ppmtopgm                                      \
26         | $(make_pgm)
27
28 pot.pgm: 146_Kaldrono.svg Makefile
29         $(use_rsvg)
30         $(shell_pipe)                                   \
31         pngtopnm <$@.tmp.png                            \
32         | ppmtopgm                                      \
33         | pnminvert                                     \
34         | $(make_pgm)
35
36 pubssh=c
37 pubpath=games-rules/quacks
38 puburl=https://www.chiark.greenend.org.uk/~ijackson/
39
40 publish: $(PUBLISH)
41         git push origin
42         rsync $^ $(pubssh):public-html/$(pubpath)/.
43         @echo $(puburl)$(pubpath)/