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: ours-a.ps ours-al.ps parts.ps
22 all: default layers circuit.bom 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
34 long2splita4=pstops -pa3 -d '0(-9cm,-10cm)+0(-0.5cm,-1cm)' <$< $o
35 long2splita4comb=pstops -pa3 -d \
36 '2:0(-9cm,-6cm)+1(-0.5cm,-6cm)'
37 #,0(-9cm,-1cm)+1(-0.5cm,-1cm)'
39 # print from pcb(1) as follows:
40 # File / Print Layout / ...
41 # select media and offsets: A3
44 # (If `... exists, use anyway?', Sequence OK)
46 OPRINTS= %.oprint-back.ps \
49 %.oprint-frontsilk.ps \
55 pcboprints: reversers.oprints detectors.oprints
57 pcbcombprints: detectors.oprint-combine.ps reversers.oprint-combine.ps
59 %.oprints-lpr: %.oprints
60 set -e; for f in `cat $^`; do echo lpr $$f; done
62 %.distilled-a3.ps: %.ps
63 ps2ps -sPAPERSIZE=a3 $< $@
65 %.oprint-combine.ps: %.pcb.output_back.distilled-a3.ps \
66 %.pcb.output_front.distilled-a3.ps
69 $(long2splita4comb) <$@-2.tmp $o
71 %.oprint-back.ps: %.pcb.output_back.ps Makefile
74 %.oprint-front.ps: %.pcb.output_front.ps Makefile
77 %.oprint-fab.ps: %.pcb.output_fab.ps Makefile
80 %.oprint-frontsilk.ps: %.pcb.output_frontsilk.ps Makefile
83 %.oprint-assembly.ps: %.pcb.output_assembly.ps Makefile
84 pstops -pa3 '0@1.5(-12cm,-29cm)' <$< $o
86 # these outputs from pstops are really A4 and can be viewed nicely with
87 # for f in *.oprint-*.ps; do gv -scale -1 -media A4 $f; done
90 sed -e '/^\#/d' <$< $o
92 %.net-info: %.net-spec netlist-expand
93 ./netlist-expand $< $o
95 %.net-spec: generate-netspec.pl
101 circuit.bom: farnell-find $(CIRCUITPARTS)
102 ./farnell-find bom $(CIRCUITPARTS) $o
104 bulkres.bom: farnell-find $(BULKRESPARTS)
105 ./farnell-find bom $(BULKRESPARTS) $o
107 bulkres-select.partlist: bulkres-select-gen.pl
110 bulkres-items.suggest:
111 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
113 bulkres-items.descs: bulkres-items.suggest
114 xargs ./farnell-find describe <$< $o
116 bulkres-items.partlist:
117 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
119 divider-table.txt: divider-table.pl
122 divider-tables: divider-table.ps divider-table.txt
124 divider-table.ps: divider-table.txt Makefile
125 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
126 --center-title='E24 resistor ratios and logarithms' <$< $o
128 %.d4: %.m4 $(M4INCS) Makefile
132 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
135 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
138 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
140 ours-l%.ps: ours.d4 layout
141 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
143 ours-e%.ps: ours.d4 layout
144 ./layout <$< -l$* -E'=*aRsclMno' \
145 -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
147 ours-p%.ps: ours.d4 layout
148 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
149 $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
151 parts.ps: showlib.d4 layout
152 ./layout <$< $(LAYOUTOPTS_ALL) $o
155 -rm -f -- *.d4 *.ps farn.* *~ *.new
156 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom
157 -rm -f t,*.gnuplot-data t,*.gnuplot-cmd t,gnuplot-fifo
158 -rm -f t,gnuplots.sh reversers.net reversers.net-info
159 -rm -f flasher.hex flasher.cod flasher.lst
161 .PRECIOUS: %.net-info %.net-spec
162 .PRECIOUS: $(OPRINTS)