3 # intentionally want to rebuild drc and bom on every invocation
4 all: drc pcb partslist partslist.csv partslist.dk zip
6 drc: $(PROJECT).sch Makefile
7 -gnetlist -g drc2 $(PROJECT).sch -o $(PROJECT).drc
9 partslist: $(PROJECT).sch Makefile
10 gnetlist -g bom -o $(PROJECT)-bom.unsorted $(PROJECT).sch
11 (head -n1 $(PROJECT)-bom.unsorted && tail -n+2 $(PROJECT)-bom.unsorted | sort) | nickle ./retab > partslist
12 rm -f $(PROJECT)-bom.unsorted
14 partslist.csv: $(PROJECT).sch Makefile gnet-partslist-csv.scm
15 gnetlist -l gnet-partslist-csv.scm -g partslist-csv -o $@ $(PROJECT).sch
17 partslist.dk: $(PROJECT).sch Makefile gnet-partslist-bom.scm
18 gnetlist -m ./gnet-partslist-bom.scm -g partslist-bom -Ovendor=digikey -o $@ $(PROJECT).sch
20 partslist.pdf: partslist.csv smt-labels.glabels
21 glabels-3-batch smt-labels.glabels -i partslist.csv -o partslist.ps && ps2pdf partslist.ps
23 pcb: $(PROJECT).sch project Makefile
26 # note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
27 # might be a really good idea for publishing designs to the web that others
28 # might review? Like this example from DJ:
31 # for i in channel.sch ethernet.sch power.sch mcu.sch; do \
33 # gschlas -e tmp.sch ; \
34 # mv tmp.sch ${WEB}/$$i; \
37 # this shoves local work out to the git.gag.com repository
41 $(PROJECT).xy: $(PROJECT).pcb
42 pcb -x bom $(PROJECT).pcb
44 GERB_FILES=*.gbr *.ger *.cnc
46 $(PROJECT).gerb: $(PROJECT).pcb
48 pcb -x gerber $(PROJECT).pcb
49 mv $(PROJECT).group1.gbr "$(PROJECT).Internal Plane 1".ger
50 mv $(PROJECT).group2.gbr "$(PROJECT).Internal Plane 2".ger
55 $(PROJECT).zip: $(PROJECT).gerb $(PROJECT).xy
57 zip $(PROJECT).zip $(GERB_FILES)
60 rm -f *.bom *.drc *.log *~ $(PROJECT).ps $(GERB_FILES) $(PROJECT).gerb *bak* *- *.zip
61 rm -f *.net *.cmd *.png partslist partslist.csv *.xy
62 rm -f *.partslist *.new.pcb *.unsorted $(PROJECT).xls