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