chiark / gitweb /
hostside: more length for bavarian
[trains.git] / layout / Makefile
1 CPROGS=         subseg2display compose-segenco
2 default:        $(CPROGS) for-pic for-test-ui layers extras
3
4 include ../cprogs.make
5 include ../common.make
6
7 M4INCS=         parts.i4
8
9 ROTATE=         270
10 LAYOUT=         ./layout -R$(ROTATE)
11
12 E_TRACK=        ArsCLMNo
13 LAYOUTOPTS_ALL= -ep=*Cm
14 LAYOUTOPTS_ALLFINAL= -Eg=*aRqesclDmnog
15 LAYOUTOPTS=     -E=*$(E_TRACK) $(LAYOUTOPTS_ALL) $(LAYOUTOPTS_ALLFINAL)
16 LAYOUTOPTS_PHYS= -S1.0 $(LAYOUTOPTS) '-e*A' -CS=\#888
17 LAYOUTOPTS_PS=  -e'[sp]=*rm' -e'p=5C' \
18                 $(LAYOUTOPTS_ALLFINAL) $(LAYOUTOPTS_COLOUR)
19 XLAYOUTOPTS_LAYER= -e'=5AND' -E'*~=5rsml' -e'p~=5r' -e'*~=9C' \
20                 $(LAYOUTOPTS_PS)
21 LAYOUTOPTS_COLOUR= -CA=\#f00 -CC=\#dd0 -CrpLD=\#00f -Ci=\#c0c
22 LAYOUTOPTS_MB=  -E'=*aRsclDmno' -E'=5RNLDA' -E'*~=5rCdsml' \
23                 $(LAYOUTOPTS_PS)
24 LAYOUTOPTS_M=   -l$* $(LAYOUTOPTS_MB)
25 LAYOUTOPTS_BS=  -S2.828
26 LAYOUTOPTS_B=   $(LAYOUTOPTS_BS) $(LAYOUTOPTS_MB) -Cl=-
27 LAYOUTOPTS_E=    -E'=*aRsclMno' \
28                 -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' \
29                 -e'[sp]=*rm' $(LAYOUTOPTS_ALLFINAL)
30
31 PLANUI_PSDPI= 72
32 PLANUI_WIDTH= 595
33 PLANUI_HEIGHT= 842
34
35 LAYOUTOPTS_SEGS= '-e*=*rm' -Lsubseglwm=80 -Lsubseglwe=150 -Lsubseglwq=50
36
37 LAYERS_LS=      0 4 10 26 30
38 LAYERS_PS=      $(addsuffix .ps, $(LAYERS_LS))
39 LAYERS_L=       $(addprefix ours-l, $(LAYERS_PS))
40 LAYERS_E=       $(addprefix ours-e, $(LAYERS_PS)) ours-e20.ps
41 LAYERS_EB=      $(addprefix ours-E, $(LAYERS_PS))
42 LAYERS_S=       $(addprefix ours-s, $(LAYERS_PS))
43 LAYERS_M=       $(addprefix ours-m, $(LAYERS_PS))
44 LAYERS=         $(LAYERS_L) $(LAYERS_E) $(LAYERS_EB) $(LAYERS_S) $(LAYERS_M) \
45                 testphys-a.ps testphys-m4.ps
46
47 LPAGES=  $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p4-$xx$y.ps))
48 BPAGES=  $(foreach x, 0 1, $(foreach y, 0 1, ours-b4-$xx$y.ps))
49
50 all:            default lpages bpages tpages
51 for-pic:        ours+pindata.asm
52 recurse:        $(CPROGS) for-pic for-test-ui
53 client:         ours.layout-data.o ours.dgram-bot.overlay-info          \
54                 ours.dgram-bot.plandata.c ours.dgram-bot.plandata.o     \
55                 ours.dgram-bot.segcmap
56 for-test-ui:    client                                                  \
57                 ours.graph.c ours.redactgraph ours.raw.neato.ps         \
58                 ours.redacted.neato.ps ours.redacted.shellvars          \
59                 ours.summary.neato.ps
60 for-segments:   ours.summary.neato.ps ours.raw.neato.large.ps \
61                 ours.redacted.neato.ps ours-s4.ps
62
63 layers:         $(LAYERS)
64 lpages:         $(LPAGES)
65 bpages:         $(BPAGES)
66 tpages:         $(foreach x, 0 1 2 3 4 5 6, testphys-p4-$xx1.ps)
67 extras:         ours-a.ps ours-al.ps dualjn-a.ps parts.ps
68
69 include ours.dgram.m
70 include segencolayers.m
71
72 #NETPBM =       -lnetpbm
73 ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
74 NETPBM +=       -lppm
75 else
76 ifeq (,$(shell test -f /usr/lib/libnetpbm.so || echo no))
77 NETPBM +=       -lnetpbm
78 endif
79 endif
80
81 REDACT=         consistency movfeatsplitedges           \
82                 consistency movfeatrmstubs              \
83                 consistency movfeatsplitnodesall        \
84                 consistency trivpairnodes               \
85                 consistency trivnullnodes
86
87 subseg2display: subseg2display.o
88                 $(LINK) $(NETPBM) -lpub -lm
89
90 compose-segenco: compose-segenco.o
91                 $(LINK) $(NETPBM)
92
93 %.neato.ps:     %.neato
94                 neato -Gsize=7.5,7.5 -Gcenter=1 -Tps <$< $o
95
96 LARGE_PS_FACTOR=3
97
98 %.large.ps:     %.ps
99                 ./psenlarge ${LARGE_PS_FACTOR} $< $o
100
101 %.raw.neato:    %.redactgraph
102                 ./$< -t$@ consistency printforneato $o
103
104 %.redacted.neato: %.redactgraph
105                 ./$< -t$@ $(REDACT) consistency printforneato $o
106
107 %.summary.neato: %.redactgraph
108                 ./$< -t$@ $(REDACT) consistency printforneatosumm $o
109
110 %.redacted.forsafety: %.redactgraph
111                 ./$< $(REDACT) consistency printforforsafety $o
112
113 %.redacted.shellvars: %.redactgraph
114                 ./$< $(REDACT) consistency printforshellscript $o
115
116 %.redacted.segjoins: %.redactgraph
117                 ./$< $(REDACT) consistency printforlayoutsegjoins $o
118
119 %.redacted.for-ui: %.redactgraph
120                 ./$< consistency trivpairnodes trivnullnodes printforui $o
121
122 %.layout-data.c: data2safety %.wiring %.redacted.forsafety \
123                         reversers.pin-info detectors.pin-info
124                 ./$(filter-out %.pin-info, $^) $o
125
126 ours.layout-data.c:
127
128 %+pindata.asm:  %.layout-data.c
129                 @:
130
131 %.pin-info:     pin-info-gen ../pcb/%.net
132                 ./$< $* $o
133
134 %.redactgraph:  %.graph.o redactgraph.o
135                 $(LINK)
136                 : redactgraph-created $@
137
138 %.d4:           %.m4 $(M4INCS) Makefile
139                 m4 -s $< $o
140
141 %-a.ps:         %.d4 layout
142                 $(LAYOUT) <$< $(LAYOUTOPTS) '-E*lD' $o
143
144 %-al.ps:        %.d4 layout
145                 $(LAYOUT) <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
146
147 %-ap.ps:        %.d4 layout
148                 $(LAYOUT) -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
149
150 %.segcmapreq:   %.run-layout
151                 ./$< $(LAYOUTOPTS_SEGS) -GR $o
152
153 %.segcmap:      %.segcmapreq segcmapassign segcmap.h
154                 ./segcmapassign <$< $o
155
156 %.dgram.m:      %.dgram-list make-dgram-make
157                 ./make-dgram-make <$< $* $o
158
159 %.m:            %.gen-make
160                 ./$< $o
161
162 %.segenco.ppm:  %.segenco.ps Makefile
163                 gs -dNOPAUSE -dBATCH -dSAFER -q \
164                         -sDEVICE=ppmraw -r$(PLANUI_PSDPI) \
165                         -g$(PLANUI_WIDTH)x$(PLANUI_HEIGHT) \
166                         -sOutputFile=$@.new $< && mv -f $@.new $@
167
168 ours.graph.c:   extractgraph ours.dgram-bot.p0.segenco.ps
169                 ./$^ $o
170 # Strictly, this is wrong as it only uses layer 0.  When we have more
171 # layers, should put them all in same segenco specially for extractgraph
172
173 ours-l%.ps:     ours.d4 layout
174                 $(LAYOUT) <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
175
176 testphys-l%.ps: testphys.d4 layout
177                 $(LAYOUT) <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
178
179 ours-s%.ps:     layout ours.redacted.segjoins ours.d4
180                 $(LAYOUT) -l$* -e'*=*rldm' -E'=5QE' -e'segjoin=5M' \
181                         -e'l=*C' $(LAYOUTOPTS_ALLFINAL) \
182                         $(filter-out layout, $^) $o
183
184 ours-m%.ps:     ours.d4 layout
185                 $(LAYOUT) <$< $(LAYOUTOPTS_M) $o
186
187 testphys-m%.ps: testphys.d4 layout
188                 $(LAYOUT) <$< $(LAYOUTOPTS_M) $o
189
190 ours-e%.ps:     ours.d4 layout
191                 $(LAYOUT) <$< -l$* $(LAYOUTOPTS_E) $(LAYOUTOPTS_COLOUR) $o
192
193 ours-E%.ps:     ours.d4 layout
194                 $(LAYOUT) <$< -l$* $(LAYOUTOPTS_E) -Cl=- \
195                         -CR=#88f -CM=#ccf -E*d -El*c $o
196
197 ours-p%.ps:     ours.d4 layout
198                 $(LAYOUT) <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
199                         $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
200
201 ours-b%.ps:     ours.d4 layout
202                 $(LAYOUT) <$< -l$$(printf %s "$*" | \
203                         sed -e 's/-/ -P/; s/x/.25x/; s/$$/.3/') \
204                         $(LAYOUTOPTS_B) $o
205
206 testphys-p%.ps: testphys.d4 layout
207                 $(LAYOUT) <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
208                         $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
209
210 parts.ps:       showlib.d4 layout
211                 $(LAYOUT) <$< $(LAYOUTOPTS_ALL) $o
212
213 # test case
214 t.ppm:          ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display
215                 gdb -x x.gdb
216
217 subseg2display.o compose-segenco.o: segcmap.h
218
219 tidy:
220
221 clean:          tidy
222                 -rm -f -- *.d4 *~ .*~ t.* *.m *.tmp *.new core *.d
223                 -rm -f ours.*.ps ours-*.ps parts.ps *.neato.ps ours.*.neato
224                 -rm -f test-*.ps testphys-*.ps
225                 -rm -f dualjn-*.ps
226                 -rm -f *.pin-info *.matrix-info *.overlay-info *+pindata.asm
227                 -rm -f *.redacted.forsafety *.redacted.forneato
228                 -rm -f *.redacted.shellvars *.redacted.segjoins
229                 -rm -f *.redacted.for-ui *.segmap-info
230                 -rm -f *.summary.forneato
231                 -rm -f *.oprint-*.ps *.run-layout
232                 -rm -f *.segcmap *.segcmapreq
233                 -rm -f *.dgram-*.p*.segenco.ps *.dgram-*.p*.segenco.ppm
234                 -rm -f *.dgram-*.plandata.c ours.graph.c ours.layout-data.c
235                 -rm -f $(CPROGS) *.o *.d ours.redactgraph *.segjoins
236                 -rm -f tmp.*
237
238 .PRECIOUS:      $(OPRINTS)
239 .PRECIOUS:      %.segcmap %.segcmapreq %.segenco.ppm %.d4 %.neato %.raw.neato
240 .PRECIOUS:      %.redactgraph %.redacted.forsafety %.redacted.neato
241 .PRECIOUS:      %.summary.neato
242 .PRECIOUS:      %.layout-data.c %.pin-info %.redacted.segjoins
243
244 include $(wildcard *.d)