-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
90 lines (73 loc) · 2.18 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SRC=\
*.pro \
*.kicad_pcb \
*.sch \
fp-lib-table \
sym-lib-table \
library/symbols/*.dcm \
library/symbols/*.lib \
library/modules/*.pretty/*.kicad_mod \
sch/*.sch \
script/*
PROJECTS=\
mangoh-red \
PLOT=\
$(addprefix build/,$(addsuffix -CuBottom.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -MaskBottom.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -PasteBottom.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -SilkBottom.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -CuTop.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -MaskTop.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -PasteTop.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -SilkTop.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -EdgeCuts.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -GND.Cu.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -PWR.Cu.gbr,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -PTH.drl,$(PROJECTS))) \
$(addprefix build/,$(addsuffix -NPTH.drl,$(PROJECTS)))
STEP=$(addprefix build/,$(addsuffix .step,$(PROJECTS)))
.PHONY: all plot step clean
all: plot step
plot: $(PLOT)
step: $(STEP)
clean:
rm -rf build
$(PLOT): $(SRC)
for pcb in *.kicad_pcb; do ./script/plot "$$pcb" "$(@D)"; done
build/%.step: %.kicad_pcb $(SRC)
mkdir -p "$(@D)"\
# sudo apt install python3-pip
# sudo -H pip3 install lxml
# sudo -H pip3 install unicode
# svg_lib = ~/Dropbox/kicad-plugins/PcbDraw-Lib/KiCAD-base
svg_lib = ./library/svg
svg_style = $(shell pwd)/svg_board_style.json
svg: svg-front svg-back
svg-front:
python3 /home/lheck/Dropbox/kicad-plugins/PcbDraw/pcbdraw.py \
--style=$(svg_style) \
--no-drillholes \
--remap library/svg/svg_map.json \
$(svg_lib) \
mangoh-red.kicad_pcb \
front.svg
xdg-open front.svg &
svg-back:
python3 /home/lheck/Dropbox/kicad-plugins/PcbDraw/pcbdraw.py \
--back \
--style=$(svg_style) \
--no-drillholes \
--remap library/svg/svg_map.json \
$(svg_lib) \
mangoh-red.kicad_pcb \
back.svg
xdg-open back.svg &
list:
python3 /home/lheck/Dropbox/kicad-plugins/PcbDraw/pcbdraw.py \
--list-components ./library/svg mangoh-red.kicad_pcb \
pcb.svg
cleanall:
rm -rf build
rm -f back.svg
rm -f front.svg
rm -r report.txt