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