5 LAYOUTOPTS_ALL= -ep=*Cm
6 LAYOUTOPTS= -E=*$(E_TRACK) $(LAYOUTOPTS_ALL)
7 LAYOUTOPTS_PHYS= -S1.0 $(LAYOUTOPTS) '-e*A'
8 XLAYOUTOPTS_LAYER= -e'=5AN' -E'*~=5rsm' -e'p~=5r' -e'*~=9C' -e'*=*l'
11 LAYERS_PS= $(addsuffix .ps, $(LAYERS_LS))
12 LAYERS_L= $(addprefix ours-l, $(LAYERS_PS))
13 LAYERS_E= $(addprefix ours-e, $(LAYERS_PS))
14 LAYERS= $(LAYERS_L) $(LAYERS_E)
16 LPAGES= $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
18 default: netlists picprogs
22 all: default layers bulkres.bom divider-tables \
25 o=>$@.new && mv -f $@.new $@
27 CIRCUITPARTS= control.partlist circuit.partlist
28 BULKRESPARTS= bulkres-select.partlist bulkres-items.partlist
30 picprogs: flasher.hex flash-all.hex
32 netlists: reversers.net detectors.net \
33 reversers.hole-rep detectors.hole-rep \
36 # print from pcb(1) as follows:
37 # File / Print Layout / ...
38 # select media and offsets: A4
41 # (If `... exists, use anyway?', Sequence OK)
44 # make {reversers,detectors}.oprints{-l,-lpr}
45 # for f in *.oprint-*.ps; do gv -scale -1 -media A4 $f; done
48 OPRINTS= %.oprint-copper.ps \
50 %.pcb.output_frontsilk.ps \
53 %.hole-rep: %.pcb hole-report.pl
54 ./hole-report.pl <$< $o
56 include reversers.layers.dep
57 include detectors.layers.dep
59 %.zip: layers.txt.tmpl Makefile
60 rm -rf $@.d; mkdir -p $@.d
61 set -e; exec <$<; cd $@.d; perl -pe ' \
62 m/^(\S+)\s+(\w+)\s+(\w+)\s+(\S.*)$$/ or die; \
63 system "cp ../$*.pcb.output_$$1.$$3 $$2.$$3"; \
65 $$_= sprintf "%-20s %s\n", $$2.$$3, $$4; \
71 $*.zip: $*.pcb.output_$$1.$$2/ or die' \
73 %.layers.dep: layers.txt.tmpl Makefile
75 's/^(\S+)\s+\w+\s+(\w+)\s.*/$*.zip: $*.pcb.output_$$1.$$2/ or die' \
78 both.hole-rep: hole-report.pl reversers.pcb detectors.pcb
84 %.oprints-l: $(OPRINTS) %.oprints Makefile
87 pcboprints: reversers.oprints-l detectors.oprints-l
89 %.oprints-lpr: %.oprints-l
90 set -ex; for f in `cat $^`; do lpr $$f; done
95 %.oprint-copper.ps: %.pcb.output_back.distilled.ps \
96 %.pcb.output_front.distilled.ps
99 pstops '2:0(-50mm,0mm)+1(50mm,0mm)' <$@-2.tmp $o
101 %.oprint-copper.ps: Makefile
103 %.oprint-assembly.ps: %.pcb.output_assembly.ps Makefile
104 pstops -pa4 '0@2(-109mm,-290mm)' <$< $o
107 sed -e '/^\#/d' <$< $o
109 %.net-info: %.net-spec netlist-expand
110 ./netlist-expand $< $o
112 %.net-spec: generate-netspec.pl
118 circuit.bom: farnell-find $(CIRCUITPARTS)
119 ./farnell-find bom $(CIRCUITPARTS) $o
121 bulkres.bom: farnell-find $(BULKRESPARTS)
122 ./farnell-find bom $(BULKRESPARTS) $o
124 bulkres-select.partlist: bulkres-select-gen.pl
127 bulkres-items.suggest:
128 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
130 bulkres-items.descs: bulkres-items.suggest
131 xargs ./farnell-find describe <$< $o
133 bulkres-items.partlist:
134 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
136 divider-table.txt: divider-table.pl
139 divider-tables: divider-table.ps divider-table.txt
141 divider-table.ps: divider-table.txt Makefile
142 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
143 --center-title='E24 resistor ratios and logarithms' <$< $o
145 %.d4: %.m4 $(M4INCS) Makefile
149 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
152 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
155 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
157 ours-l%.ps: ours.d4 layout
158 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
160 ours-e%.ps: ours.d4 layout
161 ./layout <$< -l$* -E'=*aRsclMno' \
162 -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
164 ours-p%.ps: ours.d4 layout
165 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
166 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
168 parts.ps: showlib.d4 layout
169 ./layout <$< $(LAYOUTOPTS_ALL) $o
172 -rm -f -- *.d4 farn.* *~ *.new
173 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom
174 -rm -f t,*.gnuplot-data t,*.gnuplot-cmd t,gnuplot-fifo
175 -rm -f t,gnuplots.sh reversers.net reversers.net-info
176 -rm -f flasher.hex flasher.cod flasher.lst
177 -rm -f ours-*.ps parts.ps
180 .PRECIOUS: %.net-info %.net-spec
181 .PRECIOUS: $(OPRINTS)