summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-01-06 20:14:25 +0100
committerxengineering <me@xengineering.eu>2025-01-06 20:40:50 +0100
commit32dd70a7e01ff258f65043dc23d2d9a86731f69e (patch)
tree4d3b6c77dad8c59daf92101c5a57d1e0a2340e54
parentc1c99b896d2aa1b2a5827b5a49f824472e0fc907 (diff)
downloadsoundbox-32dd70a7e01ff258f65043dc23d2d9a86731f69e.tar
soundbox-32dd70a7e01ff258f65043dc23d2d9a86731f69e.tar.zst
soundbox-32dd70a7e01ff258f65043dc23d2d9a86731f69e.zip
pcb: Add BOM generation with GNU Make
This allows to export the BOM as CSV file via the Make build system.
-rw-r--r--Makefile3
-rw-r--r--pcb/pcb.mk13
2 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 21beeb6..c2599ad 100644
--- a/Makefile
+++ b/Makefile
@@ -33,10 +33,11 @@ $(TARGET_DIR): debug
mkdir -p $@
install -Dm 644 $(BUILD_DIR)/doc/documentation.pdf $@
-debug: doc
+debug: doc pcb
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
include doc/doc.mk
+include pcb/pcb.mk
diff --git a/pcb/pcb.mk b/pcb/pcb.mk
new file mode 100644
index 0000000..cde5d47
--- /dev/null
+++ b/pcb/pcb.mk
@@ -0,0 +1,13 @@
+PCB_BUILD_DIR := $(BUILD_DIR)/pcb
+BOM := $(PCB_BUILD_DIR)/bom.csv
+SCH := pcb/soundbox.kicad_sch
+
+.PHONY: pcb
+pcb: $(BOM)
+
+$(BOM): $(SCH)
+ mkdir -p $(dir $@)
+ kicad-cli sch export bom \
+ -o $@ \
+ --fields 'Reference,Description,Value,Manufacturer,MPN,Datasheet' \
+ $<