Fix makefile to build partslist with -j flag
authorKeith Packard <keithp@keithp.com>
Sat, 4 Aug 2012 04:01:15 +0000 (21:01 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 4 Aug 2012 04:01:15 +0000 (21:01 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
Makefile

index 88bf839b2000671d326da89b98a49c2870a18b8f..cbf16041284c04ee09c044d7512c25a01d14ed20 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,25 @@
+PROJECT=telelco
+
 # intentionally want to rebuild drc and bom on every invocation
+
 all:   drc partslist partslist.csv pcb
 
-drc:   telelco.sch Makefile
-       -gnetlist -g drc2 telelco.sch -o telelco.drc
+drc:   $(PROJECT).sch Makefile
+       -gnetlist -g drc2 $(PROJECT).sch -o $(PROJECT).drc
 
-partslist:     telelco.sch Makefile
-       gnetlist -g bom -o telelco.unsorted telelco.sch
-       head -n1 telelco.unsorted > partslist
-       tail -n+2 telelco.unsorted | sort >> partslist
-       rm -f telelco.unsorted
+partslist:     $(PROJECT).sch Makefile
+       gnetlist -g bom -o $(PROJECT).unsorted $(PROJECT).sch
+       head -n1 $(PROJECT).unsorted > partslist
+       tail -n+2 $(PROJECT).unsorted | sort >> partslist
+       rm -f $(PROJECT).unsorted
 
-partslist.csv: telelco.sch Makefile
-       gnetlist -g partslist3 -o telelco.unsorted telelco.sch
-       head -n1 telelco.unsorted > partslist.csv
-       tail -n+2 telelco.unsorted | sort -t \, -k 8 >> partslist.csv
-       rm -f telelco.unsorted
+partslist.csv: $(PROJECT).sch Makefile
+       gnetlist -g partslist3 -o $(PROJECT).unsorted $(PROJECT).sch
+       head -n1 $(PROJECT).unsorted > partslist.csv
+       tail -n+2 $(PROJECT).unsorted | sort -t \, -k 8 >> partslist.csv
+       rm -f $(PROJECT).unsorted
 
-pcb:   telelco.sch project Makefile
+pcb:   $(PROJECT).sch project Makefile
        gsch2pcb project
 
 # note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
@@ -34,17 +37,17 @@ pcb:        telelco.sch project Makefile
 push:  
        git push --mirror
 
-telelco.xy:    telelco.pcb
-       pcb -x bom telelco.pcb
+$(PROJECT).xy: $(PROJECT).pcb
+       pcb -x bom $(PROJECT).pcb
 
-telelco.back.gbr:      telelco.pcb
-       pcb -x gerber telelco.pcb
+$(PROJECT).back.gbr:   $(PROJECT).pcb
+       pcb -x gerber $(PROJECT).pcb
 
-zip:   telelco.bottom.gbr telelco.bottommask.gbr telelco.fab.gbr telelco.top.gbr telelco.topmask.gbr telelco.toppaste.gbr telelco.topsilk.gbr telelco.plated-drill.cnc telelco.xy  Makefile # telelco.xls
-       zip telelco.zip telelco.*.gbr telelco.*.cnc telelco.xy # telelco.xls
+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
+       zip $(PROJECT).zip $(PROJECT).*.gbr $(PROJECT).*.cnc $(PROJECT).xy # $(PROJECT).xls
 
 clean:
-       rm -f *.bom *.drc *.log *~ telelco.ps *.gbr *.cnc *bak* *- *.zip 
+       rm -f *.bom *.drc *.log *~ $(PROJECT).ps *.gbr *.cnc *bak* *- *.zip 
        rm -f *.net *.xy *.cmd *.png partslist partslist.csv
-       rm -f *.partslist *.new.pcb *.unsorted telelco.xls
+       rm -f *.partslist *.new.pcb *.unsorted $(PROJECT).xls