summaryrefslogtreecommitdiff
path: root/pcb/pcb.mk
diff options
context:
space:
mode:
Diffstat (limited to 'pcb/pcb.mk')
-rw-r--r--pcb/pcb.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/pcb/pcb.mk b/pcb/pcb.mk
new file mode 100644
index 0000000..8f6a3c3
--- /dev/null
+++ b/pcb/pcb.mk
@@ -0,0 +1,23 @@
+SOUNDBOX_KICAD_SCH := pcb/soundbox.kicad_sch
+PCB_BUILD_DIR := $(BUILD_DIR)/pcb
+BOM := $(PCB_BUILD_DIR)/bom.csv
+SCHEMATIC_PDF := $(PCB_BUILD_DIR)/schematic.pdf
+ERC_REPORT := $(PCB_BUILD_DIR)/erc.rpt
+
+.PHONY: pcb
+pcb: $(BOM) $(SCHEMATIC_PDF)
+
+$(BOM): $(SOUNDBOX_KICAD_SCH)
+ mkdir -p $(dir $@)
+ kicad-cli sch export bom \
+ --output $@ \
+ --fields 'Reference,Description,Value,Manufacturer,MPN,Datasheet' \
+ $<
+
+$(SCHEMATIC_PDF): $(SOUNDBOX_KICAD_SCH)
+ mkdir -p $(dir $@)
+ kicad-cli sch export pdf --output $@ $<
+
+$(ERC_REPORT): $(SOUNDBOX_KICAD_SCH)
+ mkdir -p $(dir $@)
+ kicad-cli sch erc --exit-code-violations --output $@ $<