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= $(LAYERS_L) $(LAYERS_E)
20 LPAGES= $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
22 CPROGS= subseg2display compose-segenco
24 default: $(CPROGS) for-test-ui layers extras
26 for-pic: ours+pindata.asm
27 recurse: $(CPROGS) for-pic for-test-ui
28 for-test-ui: ours.graph.c ours.redactgraph ours.raw.neato.ps \
29 ours.redacted.neato.ps ours.layout-data.o \
30 ours.dgram-bot.segcmap ours.dgram-bot.plandata.c \
31 ours.dgram-bot.plandata.o
35 extras: ours-a.ps ours-al.ps dualjn-a.ps parts.ps
38 include segencolayers.m
41 ifeq (,$(shell test -f /usr/lib/libppm.so || echo no))
45 REDACT= consistency movfeatsplitedges \
46 consistency movfeatrmstubs \
47 consistency movfeatsplitnodes \
48 consistency trivpairnodes \
49 consistency trivnullnodes
51 subseg2display: subseg2display.o
52 $(LINK) $(NETPBM) -lpub -lm
54 compose-segenco: compose-segenco.o
60 %.raw.neato: %.redactgraph
61 ./$< consistency printforneato $o
63 %.redacted.neato: %.redactgraph
64 ./$< $(REDACT) consistency printforneato $o
66 %.redacted.forsafety: %.redactgraph
67 ./$< $(REDACT) consistency printforforsafety $o
69 %.layout-data.c: data2safety %.wiring %.redacted.forsafety \
70 reversers.pin-info detectors.pin-info
71 ./$(filter-out %.pin-info, $^) $o
73 %+pindata.asm: %.layout-data.c
76 %.pin-info: pin-info-gen ../pcb/%.net
79 %.redactgraph: %.graph.o redactgraph.o
82 %.d4: %.m4 $(M4INCS) Makefile
86 ./layout <$< $(LAYOUTOPTS) '-E*lD' $o
89 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
92 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
94 %.segcmapreq: %.run-layout
95 ./$< $(LAYOUTOPTS_SEGS) -GR $o
97 %.segcmap: %.segcmapreq segcmapassign segcmap.h
98 ./segcmapassign <$< $o
100 %.dgram.m: %.dgram-list make-dgram-make
101 ./make-dgram-make <$< $* $o
106 %.segenco.ppm: %.segenco.ps Makefile
107 gs -dNOPAUSE -dBATCH -dSAFER -q \
108 -sDEVICE=ppmraw -r72 -g595x842 \
109 -sOutputFile=$@.new $< && mv -f $@.new $@
111 ours.graph.c: extractgraph ours.dgram-bot.p0.segenco.ps
113 # Strictly, this is wrong as it only uses layer 0. When we have more
114 # layers, should put them all in same segenco specially for extractgraph
116 ours-l%.ps: ours.d4 layout
117 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
119 ours-e%.ps: ours.d4 layout
120 ./layout <$< -l$* -E'=*aRsclMno' \
121 -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
123 ours-p%.ps: ours.d4 layout
124 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
125 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
127 parts.ps: showlib.d4 layout
128 ./layout <$< $(LAYOUTOPTS_ALL) $o
131 t.ppm: ours.dgram-bot.pa.segenco.ppm x.gdb subseg2display
134 ui-plan-%.ppm: ours.dgram-%.pa.segenco.ppm Makefile
135 pnmcrop <$< >$@.1.new
136 pnmflip <$@.1.new -ccw >$@.2.new
137 pnmpad <$@.2.new -white -l5 -r5 -t5 -b5 $o
139 subseg2display.o compose-segenco.o: segcmap.h
142 -rm -f -- *.d4 *~ t.* *.m *.new core
143 -rm -f ours.*.ps ours-*.ps parts.ps *.neato.ps ours.*.neato
145 -rm -f *.pin-info *+pindata.asm
146 -rm -f *.redacted.forsafety *.redacted.forneato
147 -rm -f *.oprint-*.ps *.run-layout
148 -rm -f *.segcmap *.segcmapreq
149 -rm -f *.dgram-*.p*.segenco.ps *.dgram-*.p*.segenco.ppm
150 -rm -f *.dgram-*.plandata.c ours.graph.c ours.layout-data.c
151 -rm -f $(CPROGS) *.o *.d ours.redactgraph
152 -rm -f tmp.* ui-plan-*.ppm
154 .PRECIOUS: $(OPRINTS)
155 .PRECIOUS: %.segcmap %.segcmapreq %.segenco.ppm %.d4 %.neato %.raw.neato
156 .PRECIOUS: %.redactgraph %.redacted.forsafety %.redacted.neato
157 .PRECIOUS: %.layout-data.c %.pin-info
159 include $(wildcard *.d)