43 lines
883 B
Makefile
43 lines
883 B
Makefile
|
|
# PROJ = …
|
|
# VERSION = v01
|
|
|
|
HERE = ..
|
|
PCBDIR = $(HERE)/..
|
|
GERBERS = $(PROJ).plated-drill.cnc
|
|
GVP2MAKE = $(HERE)/gvp2make.py
|
|
GV_OPT = -D600
|
|
|
|
default: zip bom png
|
|
|
|
png: $(patsubst %.gvp, %.png, $(wildcard $(PROJ)*.gvp))
|
|
|
|
%.png: %.gvp $(GERBERS)
|
|
$(GVP2MAKE) -o $@ $< -w -B0 -w --background=#ffffff -A group=1.0 -X $(GV_OPT)
|
|
|
|
zip: $(PROJ)_$(VERSION).zip
|
|
|
|
GERBER_AWK = '/- +[-a-z_]+\.[-a-z]+\.[-a-z]+ +[a-z]/{print $$2}'
|
|
|
|
%_$(VERSION).zip: README.md %.plated-drill.cnc
|
|
rm -fv $@
|
|
zip $@ $< $$(awk $(GERBER_AWK) $<)
|
|
|
|
%.plated-drill.cnc: $(PCBDIR)/%.pcb
|
|
pcb -x gerber --gerberfile $* --name-style single $<
|
|
|
|
bom: $(PROJ)_bom.pdf
|
|
|
|
%.bom: $(PCBDIR)/%.pcb
|
|
pcb -x bom --bomfile $@ $<
|
|
|
|
%_bom.txt: %.bom
|
|
bom.py -h $< > $@
|
|
|
|
%_bom.pdf: %.bom $(HERE)/bom.py
|
|
$(word 2,$^) -h $< | utf82pdf > $@
|
|
|
|
.PRECIOUS: %.plated-drill.cnc %.png
|
|
|
|
clean:
|
|
rm -f *.png *.pdf *.bom *.gbr *.cnc
|