chiark / gitweb /
print front back and assembly
[trains.git] / pic.make
1
2 M4INCS=         parts.i4
3
4 E_TRACK=        ArsCLMNo
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'
9
10 LAYERS_LS=      0 10 20
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)
15
16 LPAGES=  $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
17
18 default:        ours-a.ps ours-al.ps parts.ps
19 layers:         $(LAYERS)
20 lpages:         $(LPAGES)
21
22 all:            default layers circuit.bom bulkres.bom divider-tables \
23                 picprogs netlists
24
25 o=>$@.new && mv -f $@.new $@
26
27 CIRCUITPARTS=   control.partlist circuit.partlist
28 BULKRESPARTS=   bulkres-select.partlist bulkres-items.partlist
29
30 picprogs:       flasher.hex flash-all.hex
31
32 netlists:       reversers.net
33
34 long2splita4=pstops -pa3 -d '0(0,-1cm)+0(-9cm,-10cm)' <$< $o
35
36 %.print-back.ps:        %.pcb.output_back.ps
37                 $(long2splita4)
38
39 %.print-front.ps:       %.pcb.output_front.ps
40                 $(long2splita4)
41
42 %.print-assembly.ps:    %.pcb.output_assembly.ps
43                 pstops -pa3 '0@1.5(-12cm,-29cm)' <$< $o
44
45 %.net:          %.net-info
46                 sed -e '/^\#/d' <$< $o
47
48 %.net-info:     %.net-spec netlist-expand
49                 ./netlist-expand $< $o
50
51 %.net-spec:     generate-netspec.pl
52                 ./$< $@ $o
53
54 %.hex:          %.asm
55                 gpasm -p 18f458 $<
56
57 circuit.bom:    farnell-find $(CIRCUITPARTS)
58                 ./farnell-find bom $(CIRCUITPARTS) $o
59
60 bulkres.bom:    farnell-find $(BULKRESPARTS)
61                 ./farnell-find bom $(BULKRESPARTS) $o
62
63 bulkres-select.partlist:        bulkres-select-gen.pl
64                 ./$^ $o
65
66 bulkres-items.suggest:
67                 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
68
69 bulkres-items.descs:    bulkres-items.suggest
70                 xargs ./farnell-find describe <$< $o
71
72 bulkres-items.partlist:
73                 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
74
75 divider-table.txt:      divider-table.pl
76                 ./$< $o
77
78 divider-tables:         divider-table.ps divider-table.txt
79
80 divider-table.ps:       divider-table.txt Makefile
81                 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
82                  --center-title='E24 resistor ratios and logarithms' <$< $o
83
84 %.d4:           %.m4 $(M4INCS) Makefile
85                 m4 -s <$< $o
86
87 %-a.ps:         %.d4 layout
88                 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
89
90 %-al.ps:        %.d4 layout
91                 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
92
93 %-ap.ps:        %.d4 layout
94                 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
95
96 ours-l%.ps:     ours.d4 layout
97                 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
98
99 ours-e%.ps:     ours.d4 layout
100                 ./layout <$< -l$* -E'=*aRsclMno' \
101                         -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
102
103 ours-p%.ps:     ours.d4 layout
104                 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
105                         $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
106
107 parts.ps:       showlib.d4 layout
108                 ./layout <$< $(LAYOUTOPTS_ALL) $o
109
110 clean:
111                 -rm -f -- *.d4 *.ps farn.* *~ *.new
112                 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom
113                 -rm -f t,*.gnuplot-data t,*.gnuplot-cmd t,gnuplot-fifo
114                 -rm -f t,gnuplots.sh reversers.net reversers.net-info
115                 -rm -f flasher.hex flasher.cod flasher.lst
116
117 .PRECIOUS:      reversers.net-info