chiark / gitweb /
retile to fit on A4
[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.ps:      %.ps
35                 pstops -pa3 -d '0(0,-1cm)+0(-9cm,-10cm)' <$< $o
36
37 %.net:          %.net-info
38                 sed -e '/^\#/d' <$< $o
39
40 %.net-info:     %.net-spec netlist-expand
41                 ./netlist-expand $< $o
42
43 %.net-spec:     generate-netspec.pl
44                 ./$< $@ $o
45
46 %.hex:          %.asm
47                 gpasm -p 18f458 $<
48
49 circuit.bom:    farnell-find $(CIRCUITPARTS)
50                 ./farnell-find bom $(CIRCUITPARTS) $o
51
52 bulkres.bom:    farnell-find $(BULKRESPARTS)
53                 ./farnell-find bom $(BULKRESPARTS) $o
54
55 bulkres-select.partlist:        bulkres-select-gen.pl
56                 ./$^ $o
57
58 bulkres-items.suggest:
59                 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
60
61 bulkres-items.descs:    bulkres-items.suggest
62                 xargs ./farnell-find describe <$< $o
63
64 bulkres-items.partlist:
65                 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
66
67 divider-table.txt:      divider-table.pl
68                 ./$< $o
69
70 divider-tables:         divider-table.ps divider-table.txt
71
72 divider-table.ps:       divider-table.txt Makefile
73                 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
74                  --center-title='E24 resistor ratios and logarithms' <$< $o
75
76 %.d4:           %.m4 $(M4INCS) Makefile
77                 m4 -s <$< $o
78
79 %-a.ps:         %.d4 layout
80                 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
81
82 %-al.ps:        %.d4 layout
83                 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
84
85 %-ap.ps:        %.d4 layout
86                 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
87
88 ours-l%.ps:     ours.d4 layout
89                 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
90
91 ours-e%.ps:     ours.d4 layout
92                 ./layout <$< -l$* -E'=*aRsclMno' \
93                         -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
94
95 ours-p%.ps:     ours.d4 layout
96                 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
97                         $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
98
99 parts.ps:       showlib.d4 layout
100                 ./layout <$< $(LAYOUTOPTS_ALL) $o
101
102 clean:
103                 -rm -f -- *.d4 *.ps farn.* *~ *.new
104                 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom
105                 -rm -f t,*.gnuplot-data t,*.gnuplot-cmd t,gnuplot-fifo
106                 -rm -f t,gnuplots.sh reversers.net reversers.net-info
107                 -rm -f flasher.hex flasher.cod flasher.lst
108
109 .PRECIOUS:      reversers.net-info