Use common makefile
authorKeith Packard <keithp@keithp.com>
Sun, 12 Mar 2017 00:16:17 +0000 (16:16 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 12 Mar 2017 06:02:44 +0000 (22:02 -0800)
Signed-off-by: Keith Packard <keithp@keithp.com>
Makefile

index 091265aed1618fe8b34d6b902e508e9dea77e5d8..73156aa0417418d4949e004b1ed1a1d705c70c2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,71 +1,13 @@
+# name of project, also used for PCB file
 PROJECT=mpserial
-AM=../altusmetrum
-SCHEME=$(AM)/scheme
-NICKLE=$(AM)/nickle
-RETAB=nickle $(NICKLE)/retab
 
-# intentionally want to rebuild drc and bom on every invocation
-all:   drc pcb partslist partslist.csv partslist.dk muffin-5267.pdf zip
+# list of schematic files that make up this design
+SCHEMATICS=mpserial.sch
 
-drc: $(PROJECT).sch
-       gnetlist -L $(SCHEME) -g drc2 $(PROJECT).sch -o $(PROJECT).drc
+# number of PCB layers
+LAYERS=2
 
-partslist: $(PROJECT).sch
-       gnetlist -L $(SCHEME) -g bom -o $(PROJECT).tabtmp $(PROJECT).sch
-       (head -n1 $(PROJECT).tabtmp; tail -n+2 $(PROJECT).tabtmp | sort) | $(RETAB) > $@ && rm -f $(PROJECT).tabtmp
+# sides with silkscreen, can be none|top|bottom|both
+SILK=both
 
-partslist.csv: $(PROJECT).sch Makefile
-       gnetlist -L $(SCHEME) -g partslistgag -o $(PROJECT).csvtmp $(PROJECT).sch
-       (head -n1 $(PROJECT).csvtmp; tail -n+2 $(PROJECT).csvtmp | sort -t \, -k 8) > $@ && rm -f $(PROJECT).csvtmp
-
-partslist.dk: $(PROJECT).sch Makefile $(SCHEME)/gnet-partslist-bom.scm
-       gnetlist -L $(SCHEME) -g partslist-bom -Ovendor=digikey -o $@ $(PROJECT).sch
-
-partslist.mouser: $(PROJECT).sch Makefile $(SCHEME)/gnet-partslist-bom.scm
-       gnetlist -L $(SCHEME) -g partslist-bom -Ovendor=mouser -o $@ $(PROJECT).sch
-
-muffin-5267.pdf: partslist.csv $(AM)/glabels/muffin-5267.glabels
-       glabels-3-batch $(AM)/glabels/muffin-5267.glabels -i partslist.csv -o muffin-5267.ps && ps2pdf muffin-5267.ps && rm muffin-5267.ps
-
-$(PROJECT).pcb: pcb
-
-pcb:   $(PROJECT).sch project Makefile
-       gsch2pcb project
-
-# note that 'gschlas -e foo.sch' will embed all symbols in the schematic, this
-# might be a really good idea for publishing designs to the web that others
-# might review?  Like this example from DJ:
-#
-#web :
-#        for i in channel.sch ethernet.sch power.sch mcu.sch; do \
-#          cp $$i tmp.sch ; \
-#          gschlas -e tmp.sch ; \
-#          mv tmp.sch ${WEB}/$$i; \
-#        done
-
-# this shoves local work out to the git.gag.com repository
-push:  
-       git push --mirror
-
-$(PROJECT).xy: $(PROJECT).pcb
-       pcb -x bom $(PROJECT).pcb
-
-$(PROJECT).gerb: $(PROJECT).pcb
-       rm -f *.gbr *.cnc
-       pcb -x gerber $(PROJECT).pcb
-       touch $@
-
-zip: $(PROJECT).zip $(PROJECT)-stencil.zip
-
-$(PROJECT).zip: $(PROJECT).gerb $(PROJECT).xy
-       rm -f $(PROJECT).zip
-       zip $(PROJECT).zip *.gbr *.cnc *.xy
-
-$(PROJECT)-stencil.zip:        $(PROJECT).gerb
-       zip $(PROJECT)-stencil.zip $(PROJECT).toppaste.gbr $(PROJECT).outline.gbr
-
-clean:
-       rm -f *.bom *.drc *.log *~ $(PROJECT).ps *.gbr $(PROJECT).gerb *.cnc *bak* *- *.zip 
-       rm -f *.net *.xy *.cmd *.png partslist partslist.csv partslist.dk partslist.mouser muffin-5267.pdf
-       rm -f *.partslist *.new.pcb *.unsorted $(PROJECT).xls
-       rm -f $(PROJECT)-stencil.zip
+include ../altusmetrum/pcb.mk