chiark / gitweb /
fancier
[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 LAYERS_LS=      0 10 20
8 LAYERS_PS=      $(addsuffix .ps, $(LAYERS_LS))
9 LAYERS_L=       $(addprefix ours-l, $(LAYERS_PS))
10 LAYERS_E=       $(addprefix ours-e, $(LAYERS_PS))
11 LAYERS=         $(LAYERS_L) $(LAYERS_E)
12
13 default:        ours-a.ps ours-al.ps parts.ps
14 layers:         $(LAYERS)
15
16 all:            default layers circuit.bom bulkres.bom divider-tables
17
18 o=>$@.new && mv -f $@.new $@
19
20 CIRCUITPARTS=   control.partlist circuit.partlist
21 BULKRESPARTS=   bulkres-select.partlist bulkres-items.partlist
22
23 circuit.bom:    farnell-find $(CIRCUITPARTS)
24                 ./farnell-find bom $(CIRCUITPARTS) $o
25
26 bulkres.bom:    farnell-find $(BULKRESPARTS)
27                 ./farnell-find bom $(BULKRESPARTS) $o
28
29 bulkres-select.partlist:        bulkres-select-gen.pl
30                 ./$^ $o
31
32 bulkres-items.suggest:
33                 cat bulkres-searchout*[0-9] | ./farnell-resistor-convert.pl $o
34
35 bulkres-items.descs:    bulkres-items.suggest
36                 xargs ./farnell-find describe <$< $o
37
38 bulkres-items.partlist:
39                 ./farnell-resistor-convert.pl <bulkres-items.descs MRS25 std $o
40
41 divider-table.txt:      divider-table.pl
42                 ./$< $o
43
44 divider-tables:         divider-table.ps divider-table.txt
45
46 divider-table.ps:       divider-table.txt Makefile
47                 a2ps -o- -R -1 --borders no -B -L"$$(wc -l <$<)" -l158 \
48                  --center-title='E24 resistor ratios and logarithms' <$< $o
49
50 %.d4:           %.m4 $(M4INCS) Makefile
51                 m4 -s <$< $o
52
53 %-a.ps:         %.d4 layout
54                 ./layout <$< $(LAYOUTOPTS) '-E*l' $o
55
56 %-al.ps:        %.d4 layout
57                 ./layout <$< $(LAYOUTOPTS) '-e*C' '-ep=rm' $o
58
59 ours-l%.ps:     ours.d4 layout
60                 ./layout <$< -l$* $(LAYOUTOPTS) \
61                         -e'=5AN' -E'*~=5rsm' -e'p~=5r' -e'*~=9C' -e'*=*l' $o
62
63 ours-e%.ps:     ours.d4 layout
64                 ./layout <$< -l$* -E'=*aRsclMno' \
65                         -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
66
67 parts.ps:       showlib.d4 layout
68                 ./layout <$< $(LAYOUTOPTS_ALL) $o
69
70 clean:
71                 -rm -f -- *.d4 *.ps
72                 -rm -f bulkres-*.partlist bulkres-items.suggest *.bom