chiark / gitweb /
make picprogs target
[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
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
31
32 %.hex:          %.asm
33                 gpasm -p 18f458 $<
34
35 circuit.bom:    farnell-find $(CIRCUITPARTS)
36                 ./farnell-find bom $(CIRCUITPARTS) $o
37
38 bulkres.bom:    farnell-find $(BULKRESPARTS)
39                 ./farnell-find bom $(BULKRESPARTS) $o
40
41 bulkres-select.partlist:        bulkres-select-gen.pl
42                 ./$^ $o
43
44 bulkres-items.suggest:
45                 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
46
47 bulkres-items.descs:    bulkres-items.suggest
48                 xargs ./farnell-find describe <$< $o
49
50 bulkres-items.partlist:
51                 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
52
53 divider-table.txt:      divider-table.pl
54                 ./$< $o
55
56 divider-tables:         divider-table.ps divider-table.txt
57
58 divider-table.ps:       divider-table.txt Makefile
59                 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
60                  --center-title='E24 resistor ratios and logarithms' <$< $o
61
62 %.d4:           %.m4 $(M4INCS) Makefile
63                 m4 -s <$< $o
64
65 %-a.ps:         %.d4 layout
66                 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
67
68 %-al.ps:        %.d4 layout
69                 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
70
71 %-ap.ps:        %.d4 layout
72                 ./layout -S1.0 <$< $(LAYOUTOPTS) '-e*A' '-ep=rm' $o
73
74 ours-l%.ps:     ours.d4 layout
75                 ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
76
77 ours-e%.ps:     ours.d4 layout
78                 ./layout <$< -l$* -E'=*aRsclMno' \
79                         -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
80
81 ours-p%.ps:     ours.d4 layout
82                 ./layout <$< -l$$(printf %s "$*" | sed -e 's/-/ -P/') \
83                         $(LAYOUTOPTS_PHYS) $(XLAYOUTOPTS_LAYER) $o
84
85 parts.ps:       showlib.d4 layout
86                 ./layout <$< $(LAYOUTOPTS_ALL) $o
87
88 clean:
89                 -rm -f -- *.d4 *.ps farn.* *~ *.new
90                 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom
91                 -rm -f t,*.gnuplot-data t,*.gnuplot-cmd t,gnuplot-fifo
92                 -rm -f t,gnuplots.sh