Flush out partslist.
[hw/telelco] / Makefile
1 PROJECT=telelco
2
3 # intentionally want to rebuild drc and bom on every invocation
4 all:    drc partslist partslist.csv pcb
5
6 drc:    $(PROJECT).sch Makefile
7         -gnetlist -g drc2 $(PROJECT).sch -o $(PROJECT).drc
8
9 partslist:      $(PROJECT).sch Makefile
10         gnetlist -g bom -o $(PROJECT)-bom.unsorted $(PROJECT).sch
11         head -n1 $(PROJECT)-bom.unsorted > partslist
12         tail -n+2 $(PROJECT)-bom.unsorted | sort >> partslist
13 #       rm -f $(PROJECT)-bom.unsorted
14
15 partslist.csv:  $(PROJECT).sch Makefile
16         gnetlist -g partslist3 -o $(PROJECT)-list.unsorted $(PROJECT).sch
17         head -n1 $(PROJECT)-list.unsorted > partslist.csv
18         tail -n+2 $(PROJECT)-list.unsorted | sort -t \, -k 8 >> partslist.csv
19 #       rm -f $(PROJECT)-list.unsorted
20
21 pcb:    $(PROJECT).sch project Makefile
22         gsch2pcb project
23
24 # note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
25 # might be a really good idea for publishing designs to the web that others
26 # might review?  Like this example from DJ:
27 #
28 #web :
29 #        for i in channel.sch ethernet.sch power.sch mcu.sch; do \
30 #          cp $$i tmp.sch ; \
31 #          gschlas -e tmp.sch ; \
32 #          mv tmp.sch ${WEB}/$$i; \
33 #        done
34
35 # this shoves local work out to the git.gag.com repository
36 push:   
37         git push --mirror
38
39 $(PROJECT).xy:  $(PROJECT).pcb
40         pcb -x bom $(PROJECT).pcb
41
42 $(PROJECT).back.gbr:    $(PROJECT).pcb
43         pcb -x gerber $(PROJECT).pcb
44
45 zip:    $(PROJECT).bottom.gbr $(PROJECT).bottommask.gbr $(PROJECT).fab.gbr $(PROJECT).top.gbr $(PROJECT).topmask.gbr $(PROJECT).toppaste.gbr $(PROJECT).topsilk.gbr $(PROJECT).plated-drill.cnc $(PROJECT).xy  Makefile # $(PROJECT).xls
46         zip $(PROJECT).zip $(PROJECT).*.gbr $(PROJECT).*.cnc $(PROJECT).xy # $(PROJECT).xls
47
48 clean:
49         rm -f *.bom *.drc *.log *~ $(PROJECT).ps *.gbr *.cnc *bak* *- *.zip 
50         rm -f *.net *.xy *.cmd *.png partslist partslist.csv
51         rm -f *.partslist *.new.pcb *.unsorted $(PROJECT).xls
52