chiark / gitweb /
prep for ppm
[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 o=>$@.new && mv -f $@.new $@
11 use_rsvg=rsvg-convert -f png -o $@.tmp.png $<
12 shell_pipe=set -o pipefail; set -e;
13 make_pnm = pnmdepth 255 | pnmnoraw $o
14
15 pumpkin-books.ps: pumpkin-books.ps.pl bag.pgm pot.pgm
16         ./$< $o
17
18 pumpkin-books.pdf: pumpkin-books.ps
19         gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress \
20                 -sDEVICE=pdfwrite -sOutputFile=$@ $<
21
22 bag.pgm: Sack_-_Sac_-_Zak_brown.svg Makefile
23         $(use_rsvg)
24         $(shell_pipe)                                   \
25         pngtopnm <$@.tmp.png -mix -background 'white'   \
26         | ppmtopgm                                      \
27         | $(make_pnm)
28
29 pot.pgm: 146_Kaldrono.svg Makefile
30         $(use_rsvg)
31         $(shell_pipe)                                   \
32         pngtopnm <$@.tmp.png                            \
33         | ppmtopgm                                      \
34         | pnminvert                                     \
35         | $(make_pnm)
36
37 pubssh=c
38 pubpath=games-rules/quacks
39 puburl=https://www.chiark.greenend.org.uk/~ijackson/
40
41 publish: $(PUBLISH)
42         git push origin
43         rsync $^ $(pubssh):public-html/$(pubpath)/.
44         @echo $(puburl)$(pubpath)/