measure battery voltage at battery, not LDO input
[hw/telemini] / Makefile
1 PROJECT=telemini
2 AM=../altusmetrum
3 SCHEME=$(AM)/scheme
4 NICKLE=$(AM)/nickle
5 RETAB=nickle $(NICKLE)/retab
6
7 # intentionally want to rebuild drc and bom on every invocation
8 all:    drc partslist partslist.csv pcb
9
10 drc:    telemini.sch Makefile
11         -gnetlist -g drc2 telemini.sch -o telemini.drc
12
13 partslist:      telemini.sch Makefile
14         gnetlist -g bom -o telemini.unsorted telemini.sch
15         head -n1 telemini.unsorted > partslist
16         tail -n+2 telemini.unsorted | sort >> partslist
17         rm -f telemini.unsorted
18
19 partslist.csv:  telemini.sch Makefile
20         gnetlist -L $(SCHEME) -g partslistgag \
21                 -o telemini.unsorted telemini.sch
22         head -n1 telemini.unsorted > partslist.csv
23         tail -n+2 telemini.unsorted | sort -t \, -k 8 >> partslist.csv
24         rm -f telemini.unsorted
25
26 partslist.dk: $(PROJECT).sch Makefile $(SCHEME)/gnet-partslist-bom.scm
27         gnetlist -L $(SCHEME) -g partslist-bom -Ovendor=digikey -o $@ $(PROJECT).sch
28
29 partslist.mouser: $(PROJECT).sch Makefile $(SCHEME)/gnet-partslist-bom.scm
30         gnetlist -L $(SCHEME) -g partslist-bom -Ovendor=mouser -o $@ $(PROJECT).sch
31
32 pcb:    telemini.sch project Makefile
33         gsch2pcb project
34
35 # note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
36 # might be a really good idea for publishing designs to the web that others
37 # might review?  Like this example from DJ:
38 #
39 #web :
40 #        for i in channel.sch ethernet.sch power.sch mcu.sch; do \
41 #          cp $$i tmp.sch ; \
42 #          gschlas -e tmp.sch ; \
43 #          mv tmp.sch ${WEB}/$$i; \
44 #        done
45
46 # this shoves local work out to the git.gag.com repository
47 push:   
48         git push --mirror
49
50 telemini.xy:    telemini.pcb
51         pcb -x bom telemini.pcb
52
53 telemini.bottom.gbr:    telemini.pcb
54         pcb -x gerber telemini.pcb
55
56 PDF=$(PROJECT)-sch.pdf $(PROJECT)-pcb.pdf
57
58 PS=$(PROJECT)-sch.ps $(PROJECT)-pcb.ps
59
60 pdf: $(PDF)
61
62 $(PROJECT)-sch.pdf: $(PROJECT)-sch.ps
63         ps2pdf $(PROJECT)-sch.ps
64
65 $(PROJECT)-pcb.pdf: $(PROJECT)-pcb.ps
66         ps2pdf $(PROJECT)-pcb.ps
67
68 $(PROJECT)-sch.ps: $(PROJECT).sch
69         gschem -p -o $@ -s /usr/share/gEDA/scheme/print.scm  $(PROJECT).sch
70
71 $(PROJECT)-pcb.ps: $(PROJECT).pcb
72         pcb -x ps --ps-color --psfile $(PROJECT)-pcb.ps --media Letter $(PROJECT).pcb
73
74 zip:    telemini.bottom.gbr telemini.bottommask.gbr telemini.fab.gbr telemini.top.gbr telemini.topmask.gbr telemini.toppaste.gbr telemini.topsilk.gbr telemini.plated-drill.cnc telemini.xy  Makefile # telemini.xls
75         zip telemini.zip telemini.*.gbr telemini.*.cnc telemini.xy # telemini.xls
76
77 oshpark: telemini.bottom.gbr telemini.bottommask.gbr telemini.top.gbr telemini.topmask.gbr telemini.topsilk.gbr telemini.plated-drill.cnc
78         mv telemini.bottom.gbr bottom\ layer.ger
79         mv telemini.bottommask.gbr bottom\ solder\ mask.ger
80         mv telemini.bottomsilk.gbr bottom\ silk\ screen.ger
81         mv telemini.outline.gbr board\ outline.ger
82         mv telemini.top.gbr top\ layer.ger
83         mv telemini.topmask.gbr top\ solder\ mask.ger
84         mv telemini.topsilk.gbr top\ silk\ screen.ger
85         mv telemini.plated-drill.cnc drills.xln
86         zip telemini-oshpark.zip *.ger *.xln
87
88 stencil:        telemini.bottom.gbr telemini.toppaste.gbr telemini.outline.gbr
89         zip telemini-stencil.zip telemini.toppaste.gbr telemini.outline.gbr
90
91 clean:
92         rm -f *.bom *.drc *.log *~ telemini.ps *.gbr *.cnc *bak* *- *.zip 
93         rm -f *.net *.xy *.cmd *.png partslist partslist.csv *.ger *.xln
94         rm -f *.partslist *.new.pcb *.unsorted telemini.xls muffin-5267.pdf
95
96 muffins: partslist.csv $(AM)/glabels/muffin-short-5267.glabels
97         glabels-3-batch $(AM)/glabels/muffin-short-5267.glabels \
98                 -i partslist.csv -o muffin-5267.ps >/dev/null && \
99                 ps2pdf muffin-5267.ps && rm muffin-5267.ps
100         glabels-3-batch $(AM)/glabels/muffin-5267.glabels \
101                 -i partslist.csv -o muffin-parts.ps >/dev/null && \
102                 ps2pdf muffin-parts.ps && rm muffin-parts.ps
103