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