1 CPROGS= subseg2display compose-segenco
2 default: $(CPROGS) for-pic for-test-ui layers extras
10 LAYOUT= ./layout -R$(ROTATE)
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' \
21 LAYOUTOPTS_COLOUR= -CA=\#f00 -CC=\#dd0 -CrpLD=\#00f -Ci=\#c0c
22 LAYOUTOPTS_MB= -E'=*aRsclDmno' -E'=5RNLDA' -E'*~=5rCdsml' \
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)
35 LAYOUTOPTS_SEGS= '-e*=*rm' -Lsubseglwm=80 -Lsubseglwe=150 -Lsubseglwq=50
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
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))
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
57 ours.graph.c ours.redactgraph ours.raw.neato.ps \
58 ours.redacted.neato.ps ours.redacted.shellvars \
60 for-segments: ours.summary.neato.ps ours.raw.neato.large.ps \
61 ours.redacted.neato.ps ours-s4.ps
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
70 include segencolayers.m
73 ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
76 ifeq (,$(shell test -f /usr/lib/libnetpbm.so || echo no))
81 REDACT= consistency movfeatsplitedges \
82 consistency movfeatrmstubs \
83 consistency movfeatsplitnodesall \
84 consistency trivpairnodes \
85 consistency trivnullnodes
87 subseg2display: subseg2display.o
88 $(LINK) $(NETPBM) -lpub -lm
90 compose-segenco: compose-segenco.o
94 neato -Gsize=7.5,7.5 -Gcenter=1 -Tps <$< $o
99 ./psenlarge ${LARGE_PS_FACTOR} $< $o
101 %.raw.neato: %.redactgraph
102 ./$< -t$@ consistency printforneato $o
104 %.redacted.neato: %.redactgraph
105 ./$< -t$@ $(REDACT) consistency printforneato $o
107 %.summary.neato: %.redactgraph
108 ./$< -t$@ $(REDACT) consistency printforneatosumm $o
110 %.redacted.forsafety: %.redactgraph
111 ./$< $(REDACT) consistency printforforsafety $o
113 %.redacted.shellvars: %.redactgraph
114 ./$< $(REDACT) consistency printforshellscript $o
116 %.redacted.segjoins: %.redactgraph
117 ./$< $(REDACT) consistency printforlayoutsegjoins $o
119 %.redacted.for-ui: %.redactgraph
120 ./$< consistency trivpairnodes trivnullnodes printforui $o
122 %.layout-data.c: data2safety %.wiring %.redacted.forsafety \
123 reversers.pin-info detectors.pin-info
124 ./$(filter-out %.pin-info, $^) $o
128 %+pindata.asm: %.layout-data.c
131 %.pin-info: pin-info-gen ../pcb/%.net
134 %.redactgraph: %.graph.o redactgraph.o
136 : redactgraph-created $@
138 %.d4: %.m4 $(M4INCS) Makefile
142 $(LAYOUT) <$< $(LAYOUTOPTS) '-E*lD' $o
145 $(LAYOUT) <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
148 $(LAYOUT) -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
150 %.segcmapreq: %.run-layout
151 ./$< $(LAYOUTOPTS_SEGS) -GR $o
153 %.segcmap: %.segcmapreq segcmapassign segcmap.h
154 ./segcmapassign <$< $o
156 %.dgram.m: %.dgram-list make-dgram-make
157 ./make-dgram-make <$< $* $o
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 $@
168 ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps
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
173 ours-l%.ps: ours.d4 layout
174 $(LAYOUT) <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
176 testphys-l%.ps: testphys.d4 layout
177 $(LAYOUT) <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
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
184 ours-m%.ps: ours.d4 layout
185 $(LAYOUT) <$< $(LAYOUTOPTS_M) $o
187 testphys-m%.ps: testphys.d4 layout
188 $(LAYOUT) <$< $(LAYOUTOPTS_M) $o
190 ours-e%.ps: ours.d4 layout
191 $(LAYOUT) <$< -l$* $(LAYOUTOPTS_E) $(LAYOUTOPTS_COLOUR) $o
193 ours-E%.ps: ours.d4 layout
194 $(LAYOUT) <$< -l$* $(LAYOUTOPTS_E) -Cl=- \
195 -CR=#88f -CM=#ccf -E*d -El*c $o
197 ours-p%.ps: ours.d4 layout
198 $(LAYOUT) <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
199 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
201 ours-b%.ps: ours.d4 layout
202 $(LAYOUT) <$< -l$$(printf %s "$*" | \
203 sed -e 's/-/ -P/; s/x/.25x/; s/$$/.3/') \
206 testphys-p%.ps: testphys.d4 layout
207 $(LAYOUT) <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
208 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
210 parts.ps: showlib.d4 layout
211 $(LAYOUT) <$< $(LAYOUTOPTS_ALL) $o
214 t.ppm: ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display
217 subseg2display.o compose-segenco.o: segcmap.h
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
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
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
244 include $(wildcard *.d)