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