Add scripts for formatting csv file
[hw/telefirefour] / Makefile
1 PROJECT=telefire
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 -l gnet-partslist-keithp.scm -g partslist-keithp -o $(PROJECT)-list.unsorted $(PROJECT).sch
17         nickle ./retab < $(PROJECT)-list.unsorted > $@
18
19 pcb:    $(PROJECT).sch project Makefile
20         gsch2pcb project
21
22 # note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
23 # might be a really good idea for publishing designs to the web that others
24 # might review?  Like this example from DJ:
25 #
26 #web :
27 #        for i in channel.sch ethernet.sch power.sch mcu.sch; do \
28 #          cp $$i tmp.sch ; \
29 #          gschlas -e tmp.sch ; \
30 #          mv tmp.sch ${WEB}/$$i; \
31 #        done
32
33 # this shoves local work out to the git.gag.com repository
34 push:   
35         git push --mirror
36
37 $(PROJECT).xy:  $(PROJECT).pcb
38         pcb -x bom $(PROJECT).pcb
39
40 $(PROJECT).back.gbr:    $(PROJECT).pcb
41         pcb -x gerber $(PROJECT).pcb
42
43 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
44         zip $(PROJECT).zip $(PROJECT).*.gbr $(PROJECT).*.cnc $(PROJECT).xy # $(PROJECT).xls
45
46 clean:
47         rm -f *.bom *.drc *.log *~ $(PROJECT).ps *.gbr *.cnc *bak* *- *.zip 
48         rm -f *.net *.xy *.cmd *.png partslist partslist.csv
49         rm -f *.partslist *.new.pcb *.unsorted $(PROJECT).xls
50