1 # Makefile - build system for new board layouts for
2 # for games very like Pandemic Rising Tide
4 # Copyright (C) 2019 Ian Jackson
6 # This program is dual licensed, GPv3+ or CC-BY-SA 4.0+.
7 # Only to the Pandemic Rising Tide folks, it is permissively licensed.
9 # This program is free software.
11 # You can redistribute it and/or modify it under the terms of the
12 # GNU General Public License as published by the Free Software
13 # Foundation, either version 3 of the License, or (at your option)
14 # any later version; or (at your option), under the terms of the
15 # Creative Commons Attribution-ShareAlike International License,
16 # version 4.0 of that License, or (at your option), any later
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License Creative Commons Attribution-ShareAlike
23 # License or the for more details.
25 # You should have received a copy of these licenses along with this
26 # program. If not, see <https://www.gnu.org/licenses/> and
27 # <https://creativecommons.org/licenses/>.
29 # Pandemic and Pandemic Rising Tide are (I think) trademarks of Z-Man
30 # games and I use them without permission.
32 # For the avoidance of doubt, I do not consider this program to be a
33 # derivative work of the game Pandemic Rising Tide. However, it is
34 # not very useful without a pair of game description files and the
35 # only nontrivial game description files I know of are indeed such
43 export PERL_HASH_SEED=1
45 # PLAG_DEBUG ?= $(PLAG) # effectively
46 # PLAG_RELEASE ?= $(PLAG) # ie caller may set these
47 PLAG_DIR ?= ../plag-mangler
49 USE_PLAG_DEBUG := $(shell ./find-plag \
50 debug:release "$(PLAG_DIR)" "$(PLAG_DEBUG)" "$(PLAG_RELEASE)" "$(PLAG)")
51 USE_PLAG_RELEASE := $(shell ./find-plag \
52 release:debug "$(PLAG_DIR)" "$(PLAG_RELEASE)" "$(PLAG_DEBUG)" "$(PLAG)")
55 # plag-mangler 3a1eae4d6395f7d862cf66d0e4a1008d1bedc6e7
56 # rc-dlist-deque 3e19e16dde436fc1ac03534bf502588d17b3faeb
57 # c_vec 3394762a6221c44f8e22b222ce5547f6534129ea
58 # rust-nlopt d6781621e72bb7a78da56689ab5bb27befafec6a
59 # nlopt (hack) 3068d8b694a6047c4f374b7267a54fdb3fae1f69 2.3+252-g8b3cb5a-1
60 # crates from Debian buster:
64 # libboost-dev:amd64 1.67.0.1
65 # libboost1.67-dev:amd64 1.67.0-11
70 export PERL_HASH_SEED=1
71 export PERL_PERTURB_KEYS=0
75 # board-pMAXPAPER-bPAGE.pdf
76 # where MAXPAPER is a3 for one a4 and one a3 page, PAGEs are B, MT
77 # a4 for three a4 pages, PAGEs are B, M, T
78 # a1 for one a1 page (with much whitespace), page is P
79 # a1m like a1 but assumes pasting onto 4 x a4 boards
81 # boundings-* (one per MAXPAPER) shows various regions
82 # assuming 5.5mm unprintable border, see $max_printeredge
85 $(addprefix maxprintable-, a3) \
86 $(addprefix minprintable-, a3) \
87 $(addprefix boundings-, pa3 pa4 pa1-bPageP pa1m pa1m-bPageP ) \
88 $(addprefix board-, pa3-bPageB pa3-bPageMT \
89 pa4-bPageB pa4-bPageM pa4-bPageT \
90 pa1-bPageP pa1m-bPageP ) \
91 $(addprefix a4-test-, b m t a1m) \
93 $(addprefix layout-test-, b m t a1m)
96 all: all-ps all-pdf all-preview
98 PSS=$(addsuffix .ps, $(BOARDFILES))
99 PDFS=$(addsuffix .pdf, $(BOARDFILES))
100 PREVIEWS=maxprintable-a3-preview.png
101 TEXTFILES=README map.plag
105 all-preview: $(PREVIEWS)
108 $(PS2PDF) $(PS2PDF_FLAGS) $< $@.tmp && $i
110 cmyk.pdf: PS2PDF_FLAGS += -dAutoRotatePages=/None
112 map.plag: generate-plag input-graph Parse.pm
115 www=ianmdlvl@chiark:public-html/pandemic-rising-tide
117 html: $(PDFS) $(PREVIEWS) $(TEXTFILES)
118 rm -rf $@ $@.tmp; mkdir $@.tmp
120 set -e; for f in $(TEXTFILES); do mv $@.tmp/$$f{,.txt}; done
125 rsync -aH --delete html/. $(www)/.
127 # create opt.plag.reuse to shortcut this
128 opt.plag: maybe-rerun-optim map.plag $(USE_PLAG_RELEASE) Makefile
129 ./$(filter-out Makefile, $^) $@ .opt.plag.sums \
132 OUTER-F2V OUTER-SPLIT \
133 B T OUTER-F2V OUTER-F12VA \
138 faces.plag: opt.plag $(USE_PLAG_DEBUG) Makefile
139 $(USE_PLAG_DEBUG) RF $< W-FACES $@.tmp && $i
141 BOARDDEPS= generate-board faces.plag input-graph misc-data.pl Parse.pm
143 maxprintable-%.ps: $(BOARDDEPS)
144 ./generate-board -Xp$* faces.plag input-graph $o
146 minprintable-%.ps: $(BOARDDEPS)
147 ./generate-board -Xp$*,bPrintableAll faces.plag input-graph $o
149 %-preview.png: %.pdf Makefile
150 gm convert -geometry 20% $< png:$@.tmp && $i
152 boundings-%.ps: $(BOARDDEPS)
153 ./generate-board -XB$* faces.plag input-graph $o
155 board-%.ps: $(BOARDDEPS)
156 ./generate-board -X$* faces.plag input-graph $o
158 layout-test-a1m.ps: $(BOARDDEPS) layout-test-prefix-a1.ps
159 ./generate-board -XWB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
160 cat layout-test-prefix-a1.ps $@.tmp.1 $o
162 a4-test-a1m.ps: $(BOARDDEPS) layout-test-prefix-a1.ps
163 ./generate-board -XB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
164 cat layout-test-prefix-a1.ps $@.tmp.1 $o
166 layout-test-preview.ps: $(BOARDDEPS)
167 ./generate-board -XW faces.plag input-graph $o
169 layout-test-%.ps: layout-test-prefix-%.ps layout-test-preview.ps
172 a4-test-%.ps: layout-test-prefix-%.ps maxprintable-a3.ps