forked from soundmonster/samoklava
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (41 loc) · 2.19 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
# .DELETE_ON_ERROR:
.SECONDARY:
.PHONY: clean all setup
.DEFAULT: all
container_cmd ?= docker
container_args ?= -w /board -v $(shell pwd):/board --rm
setup:
npm install
# outputs from
output/pcbs/board.kicad_pcb &: config.yaml
npm run gen
output/pcbs/%.dsn: output/pcbs/%.kicad_pcb
# file can not be present or the script will refuse to run
if [ -f "$@" ] ; then rm $@ ; fi
${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/export_dsn.py $< $@
output/routed_pcbs/%.ses: output/pcbs/%.dsn
mkdir -p $(shell dirname $@)
${container_cmd} run ${container_args} soundmonster/freerouting_cli:v0.1.0 java -jar /opt/freerouting_cli.jar -de $< -do $@
output/routed_pcbs/%.kicad_pcb: output/routed_pcbs/%.ses output/pcbs/%.kicad_pcb
mkdir -p $(shell dirname $@)
# file can not be present or the script will refuse to run
if [ -f "$@" ] ; then rm $@ ; fi
${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/import_ses.py output/pcbs/$*.kicad_pcb $< --output-file $@
output/routed_pcbs/%-drc/: output/routed_pcbs/%.kicad_pcb
mkdir -p $@
${container_cmd} run ${container_args} soundmonster/kicad-automation-scripts:latest /usr/lib/python2.7/dist-packages/kicad-automation/pcbnew_automation/run_drc.py $< $@
output/routed_pcbs/%-front.png: output/routed_pcbs/%.kicad_pcb
mkdir -p $(shell dirname $@)
${container_cmd} run ${container_args} --entrypoint /usr/local/bin/pcbdraw yaqwsx/kikit:v1.3.0 plot --side front --style oshpark-afterdark $< $@
output/routed_pcbs/%-back.png: output/routed_pcbs/%.kicad_pcb
mkdir -p $(shell dirname $@)
${container_cmd} run ${container_args} --entrypoint /usr/local/bin/pcbdraw yaqwsx/kikit:v1.3.0 plot --side back --style oshpark-afterdark $< $@
output/gerbers/%/gerbers.zip: output/routed_pcbs/%.kicad_pcb
mkdir -p $(shell dirname $@)
${container_cmd} run ${container_args} yaqwsx/kikit:v1.3.0 fab jlcpcb --no-drc --no-assembly $< $(shell dirname $@)
clean:
rm -rf output
all: \
output/routed_pcbs/board-front.png \
output/routed_pcbs/board-back.png \
output/gerbers/board/gerbers.zip