-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
57 lines (41 loc) · 1.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
all: DUMMY
project:=thinkpad-usbkb
gerbers:= \
$(project)-Edge_Cuts.gbr \
$(project)-F_Cu.gtl \
$(project)-F_SilkS.gto \
$(project)-F_Mask.gts \
$(project)-F_Paste.gtp \
$(project)-B_Cu.gbl \
$(project)-B_SilkS.gbo \
$(project)-B_Mask.gbs \
$(project).drl \
version:=$(shell git describe --dirty)
zip: $(project)-$(version).zip
$(project)-$(version).zip: $(gerbers)
git archive --format=zip -o $@ --prefix=$(project)-$(version)/ HEAD
zip.gerbers: $(project)-$(version).gerbers.zip
$(project)-$(version).gerbers.zip: $(gerbers)
zip $@ $^
pdf: $(project)-$(version).pcb.pdf
pdf.clean:
rm -f $(addsuffix .svg,$(gerbers)) $(addsuffix .pdf,$(gerbers))
rm -f keyboard.gvp.svg keyboard.gvp.pdf
$(project)-$(version).pcb.pdf: $(gerbers)
for i in $^; do \
gerbv $$i -xsvg -o $$i.svg; \
cairosvg $$i.svg -fpdf -o $$i.pdf; \
done
gerbv -p keyboard.gvp -xsvg -o keyboard.gvp.svg
cairosvg keyboard.gvp.svg -fpdf -o keyboard.gvp.pdf
pdfunite $(addsuffix .pdf,$^) keyboard.gvp.pdf $@
$(project)-$(version).pcb2.pdf: $(gerbers)
for i in $^; do \
gerbv $$i -xpdf -o $$i.pdf; \
done
gerbv -p keyboard.gvp -xpdf -o keyboard.gvp.pdf
pdfunite $(addsuffix .pdf,$^) keyboard.gvp.pdf $@
# deps:
# gerbv
# python-cairosvg
# poppler-utils