chiark / gitweb /
use plag-mangler not plag-mangle
[pandemic-rising-tide.git] / Makefile
1
2 i=mv -f $@.tmp $@
3 o= >$@.tmp && $i
4
5 export PERL_HASH_SEED=1
6
7 # PLAG_DEBUG   ?= $(PLAG)     # effectively
8 # PLAG_RELEASE ?= $(PLAG)     # ie caller may set these
9 PLAG_DIR     ?= ../plag-mangler
10
11 USE_PLAG_DEBUG   := $(shell ./find-plag \
12  debug:release "$(PLAG_DIR)" "$(PLAG_DEBUG)" "$(PLAG_RELEASE)" "$(PLAG)")
13 USE_PLAG_RELEASE := $(shell ./find-plag \
14  release:debug "$(PLAG_DIR)" "$(PLAG_RELEASE)" "$(PLAG_DEBUG)" "$(PLAG)")
15
16 # with
17 #  plag-mangle    a213b9ab92ec0f020f999f53c25c4996855e0349
18 #  rc-dlist-deque 5147fecc626d2b00e3e9cef96baaf5e41a8d8220
19 #  c_vec          3394762a6221c44f8e22b222ce5547f6534129ea
20 #  rust-nlopt     d6781621e72bb7a78da56689ab5bb27befafec6a
21 #  nlopt (hack)   3068d8b694a6047c4f374b7267a54fdb3fae1f69 2.3+252-g8b3cb5a-1
22 #  crates from Debian buster:
23 #    libc   0.2.43-1
24 #    arrayvec 0.4.8-1
25 #  also relevant
26 #    libboost-dev:amd64       1.67.0.1
27 #    libboost1.67-dev:amd64   1.67.0-11
28
29 PS2PDF ?= ps2pdf
30 PS2PDF_FLAGS ?=
31
32 export PERL_HASH_SEED=1
33 export PERL_PERTURB_KEYS=0
34
35 default: all
36
37 # board-pMAXPAPER-bPAGE.pdf
38 #   where MAXPAPER is a3 for one a4 and one a3 page, PAGEs are B, MT
39 #                     a4 for three a4 pages, PAGEs are B, M, T
40 #                     a1 for one a1 page (with much whitespace), page is P
41 #                     a1m like a1 but assumes pasting onto 4 x a4 boards
42 #
43 # boundings-* (one per MAXPAPER) shows various regions
44 #   assuming 5.5mm unprintable border, see $max_printeredge
45
46 BOARDFILES=                                             \
47         $(addprefix maxprintable-,      a3)             \
48         $(addprefix minprintable-,      a3)             \
49         $(addprefix boundings-, pa3 pa4 pa1-bPageP pa1m pa1m-bPageP     ) \
50         $(addprefix board-,     pa3-bPageB pa3-bPageMT                  \
51                                 pa4-bPageB pa4-bPageM pa4-bPageT        \
52                                 pa1-bPageP pa1m-bPageP                  ) \
53         $(addprefix a4-test-,           b m t a1m)      \
54         layout-test-preview                             \
55         $(addprefix layout-test-,       b m t a1m)
56
57
58 all:    $(addsuffix .ps,  $(BOARDFILES)) \
59         $(addsuffix .pdf, $(BOARDFILES))
60
61 %.pdf: %.ps Makefile
62         $(PS2PDF) $(PS2PDF_FLAGS) $< $@.tmp && $i
63
64 cmyk.pdf: PS2PDF_FLAGS += -dAutoRotatePages=/None
65
66 map.plag: generate-plag input-graph Parse.pm 
67         ./$< input-graph $o
68
69 # create opt.plag.reuse to shortcut this
70 opt.plag: maybe-rerun-optim map.plag $(USE_PLAG_RELEASE) Makefile
71         ./$(filter-out Makefile, $^) $@ .opt.plag.sums \
72                 R                                       \
73                 DUAL                                    \
74                 OUTER-F2V OUTER-SPLIT                   \
75                 B T OUTER-F2V OUTER-F12VA               \
76                 PCO CP RAE                              \
77                 D 0 NLOPT                               \
78                 W $@.tmp
79
80 faces.plag: opt.plag $(USE_PLAG_DEBUG) Makefile
81         $(USE_PLAG_DEBUG) RF $< W-FACES $@.tmp && $i
82
83 BOARDDEPS= generate-board faces.plag input-graph misc-data.pl Parse.pm
84
85 maxprintable-%.ps: $(BOARDDEPS)
86         ./generate-board -Xp$* faces.plag input-graph $o
87
88 minprintable-%.ps: $(BOARDDEPS)
89         ./generate-board -Xp$*,bPrintableAll faces.plag input-graph $o
90
91 boundings-%.ps: $(BOARDDEPS)
92         ./generate-board -XB$* faces.plag input-graph $o
93
94 board-%.ps: $(BOARDDEPS)
95         ./generate-board -X$* faces.plag input-graph $o
96
97 layout-test-a1m.ps: $(BOARDDEPS) layout-test-prefix-a1.ps
98         ./generate-board -XWB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
99         cat layout-test-prefix-a1.ps $@.tmp.1 $o
100
101 a4-test-a1m.ps: $(BOARDDEPS) layout-test-prefix-a1.ps
102         ./generate-board -XB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
103         cat layout-test-prefix-a1.ps $@.tmp.1 $o
104
105 layout-test-preview.ps: $(BOARDDEPS) 
106         ./generate-board -XW faces.plag input-graph $o
107
108 layout-test-%.ps: layout-test-prefix-%.ps layout-test-preview.ps
109         cat $^ $o
110
111 a4-test-%.ps: layout-test-prefix-%.ps maxprintable-a3.ps
112         cat $^ $o
113
114 #map.ps: map.dot
115 #       neato -Tps $^ $o