chiark / gitweb /
more versions of dependencies
[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-mangle
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
26
27 PS2PDF ?= ps2pdf
28 PS2PDF_FLAGS ?=
29
30 export PERL_HASH_SEED=1
31 export PERL_PERTURB_KEYS=0
32
33 default: all
34
35 # board-pMAXPAPER-bPAGE.pdf
36 #   where MAXPAPER is a3 for one a4 and one a3 page, PAGEs are B, MT
37 #                     a4 for three a4 pages, PAGEs are B, M, T
38 #                     a1 for one a1 page (with much whitespace), page is P
39 #                     a1m like a1 but assumes pasting onto 4 x a4 boards
40 #
41 # boundings-* (one per MAXPAPER) shows various regions
42 #   assuming 5.5mm unprintable border, see $max_printeredge
43
44 BOARDFILES=                                             \
45         $(addprefix maxprintable-,      a3)             \
46         $(addprefix minprintable-,      a3)             \
47         $(addprefix boundings-, pa3 pa4 pa1-bPageP pa1m pa1m-bPageP     ) \
48         $(addprefix board-,     pa3-bPageB pa3-bPageMT                  \
49                                 pa4-bPageB pa4-bPageM pa4-bPageT        \
50                                 pa1-bPageP pa1m-bPageP                  ) \
51         $(addprefix a4-test-,           b m t a1m)      \
52         layout-test-preview                             \
53         $(addprefix layout-test-,       b m t a1m)
54
55
56 all:    $(addsuffix .ps,  $(BOARDFILES)) \
57         $(addsuffix .pdf, $(BOARDFILES))
58
59 %.pdf: %.ps Makefile
60         $(PS2PDF) $(PS2PDF_FLAGS) $< $@.tmp && $i
61
62 cmyk.pdf: PS2PDF_FLAGS += -dAutoRotatePages=/None
63
64 map.plag: generate-plag input-graph Parse.pm 
65         ./$< input-graph $o
66
67 # create opt.plag.reuse to shortcut this
68 opt.plag: maybe-rerun-optim map.plag $(USE_PLAG_RELEASE) Makefile
69         ./$(filter-out Makefile, $^) $@ .opt.plag.sums \
70                 R                                       \
71                 DUAL                                    \
72                 OUTER-F2V OUTER-SPLIT                   \
73                 B T OUTER-F2V OUTER-F12VA               \
74                 PCO CP RAE                              \
75                 D 0 NLOPT                               \
76                 W $@.tmp
77
78 faces.plag: opt.plag $(USE_PLAG_DEBUG) Makefile
79         $(USE_PLAG_DEBUG) RF $< W-FACES $@.tmp && $i
80
81 maxprintable-%.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
82         ./generate-board -Xp$* faces.plag input-graph $o
83
84 minprintable-%.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
85         ./generate-board -Xp$*,bPrintableAll faces.plag input-graph $o
86
87 boundings-%.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
88         ./generate-board -XB$* faces.plag input-graph $o
89
90 board-%.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
91         ./generate-board -X$* faces.plag input-graph $o
92
93 layout-test-a1m.ps: generate-board Makefile Parse.pm
94         ./generate-board -XWB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
95         cat layout-test-prefix-a1.ps $@.tmp.1 $o
96
97 a4-test-a1m.ps: generate-board Makefile Parse.pm
98         ./generate-board -XB,pa1m-bPageP faces.plag input-graph >$@.tmp.1
99         cat layout-test-prefix-a1.ps $@.tmp.1 $o
100
101 layout-test-preview.ps: maxprintable-a3.ps Makefile Parse.pm
102         ./generate-board -XW faces.plag input-graph $o
103
104 layout-test-%.ps: layout-test-prefix-%.ps layout-test-preview.ps
105         cat $^ $o
106
107 a4-test-%.ps: layout-test-prefix-%.ps maxprintable-a3.ps
108         cat $^ $o
109
110 #map.ps: map.dot
111 #       neato -Tps $^ $o