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