7 LAYOUTOPTS_ALL= -ep=*Cm
8 LAYOUTOPTS= -E=*$(E_TRACK) $(LAYOUTOPTS_ALL)
9 LAYOUTOPTS_PHYS= -S1.0 $(LAYOUTOPTS) '-e*A'
10 XLAYOUTOPTS_LAYER= -e'=5AN' -E'*~=5rsm' -e'p~=5r' -e'*~=9C' -e'*=*l'
12 LAYOUTOPTS_SEGS= '-e*=*rm'
15 LAYERS_PS= $(addsuffix .ps, $(LAYERS_LS))
16 LAYERS_L= $(addprefix ours-l, $(LAYERS_PS))
17 LAYERS_E= $(addprefix ours-e, $(LAYERS_PS))
18 LAYERS_M= $(addprefix ours-m, $(LAYERS_PS))
19 LAYERS= $(LAYERS_L) $(LAYERS_E) $(LAYERS_M)
21 LPAGES= $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
23 CPROGS= subseg2display compose-segenco
25 default: $(CPROGS) for-test-ui layers extras
27 for-pic: ours+pindata.asm
28 recurse: $(CPROGS) for-pic for-test-ui
29 for-test-ui: ours.graph.c ours.redactgraph ours.raw.neato.ps \
30 ours.redacted.neato.ps ours.layout-data.o \
31 ours.dgram-bot.segcmap ours.dgram-bot.plandata.c \
32 ours.dgram-bot.plandata.o
36 extras: ours-a.ps ours-al.ps dualjn-a.ps parts.ps
39 include segencolayers.m
42 ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
46 REDACT= consistency movfeatsplitedges \
47 consistency movfeatrmstubs \
48 consistency movfeatsplitnodes \
49 consistency trivpairnodes \
50 consistency trivnullnodes
52 subseg2display: subseg2display.o
53 $(LINK) $(NETPBM) -lpub -lm
55 compose-segenco: compose-segenco.o
61 %.raw.neato: %.redactgraph
62 ./$< consistency printforneato $o
64 %.redacted.neato: %.redactgraph
65 ./$< $(REDACT) consistency printforneato $o
67 %.redacted.forsafety: %.redactgraph
68 ./$< $(REDACT) consistency printforforsafety $o
70 %.layout-data.c: data2safety %.wiring %.redacted.forsafety \
71 reversers.pin-info detectors.pin-info
72 ./$(filter-out %.pin-info, $^) $o
74 %+pindata.asm: %.layout-data.c
77 %.pin-info: pin-info-gen ../pcb/%.net
80 %.redactgraph: %.graph.o redactgraph.o
83 %.d4: %.m4 $(M4INCS) Makefile
87 ./layout <$< $(LAYOUTOPTS) '-E*lD' $o
90 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
93 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
95 %.segcmapreq: %.run-layout
96 ./$< $(LAYOUTOPTS_SEGS) -GR $o
98 %.segcmap: %.segcmapreq segcmapassign segcmap.h
99 ./segcmapassign <$< $o
101 %.dgram.m: %.dgram-list make-dgram-make
102 ./make-dgram-make <$< $* $o
107 %.segenco.ppm: %.segenco.ps Makefile
108 gs -dNOPAUSE -dBATCH -dSAFER -q \
109 -sDEVICE=ppmraw -r72 -g595x842 \
110 -sOutputFile=$@.new $< && mv -f $@.new $@
112 ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps
114 # Strictly, this is wrong as it only uses layer 0. When we have more
115 # layers, should put them all in same segenco specially for extractgraph
117 ours-l%.ps: ours.d4 layout
118 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
120 ours-m%.ps: ours.d4 layout
121 ./layout <$< -l$* -E'=*aRsclDmno' \
122 -e'p=*rm' -E'=5RNLDA' -E'*~=5rCdsml' $o
124 ours-e%.ps: ours.d4 layout
125 ./layout <$< -l$* -E'=*aRsclMno' \
126 -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
128 ours-p%.ps: ours.d4 layout
129 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
130 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
132 test-p%.ps: test.d4 layout
133 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
134 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
136 parts.ps: showlib.d4 layout
137 ./layout <$< $(LAYOUTOPTS_ALL) $o
140 t.ppm: ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display
143 ui-plan-%.ppm: ours.dgram-%.pa.segenco.ppm Makefile
144 pnmcrop <$< >$@.1.new
145 pnmflip <$@.1.new -ccw >$@.2.new
146 pnmpad <$@.2.new -white -l5 -r5 -t5 -b5 $o
148 subseg2display.o compose-segenco.o: segcmap.h
151 -rm -f -- *.d4 *~ t.* *.m *.new core
152 -rm -f ours.*.ps ours-*.ps parts.ps *.neato.ps ours.*.neato
154 -rm -f *.pin-info *+pindata.asm
155 -rm -f *.redacted.forsafety *.redacted.forneato
156 -rm -f *.oprint-*.ps *.run-layout
157 -rm -f *.segcmap *.segcmapreq
158 -rm -f *.dgram-*.p*.segenco.ps *.dgram-*.p*.segenco.ppm
159 -rm -f *.dgram-*.plandata.c ours.graph.c ours.layout-data.c
160 -rm -f $(CPROGS) *.o *.d ours.redactgraph
161 -rm -f tmp.* ui-plan-*.ppm
163 .PRECIOUS: $(OPRINTS)
164 .PRECIOUS: %.segcmap %.segcmapreq %.segenco.ppm %.d4 %.neato %.raw.neato
165 .PRECIOUS: %.redactgraph %.redacted.forsafety %.redacted.neato
166 .PRECIOUS: %.layout-data.c %.pin-info
168 include $(wildcard *.d)