summaryrefslogtreecommitdiff
path: root/firmware/Makefile
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-01-23 12:13:24 +0100
committerxengineering <me@xengineering.eu>2022-01-23 12:17:33 +0100
commit5cc962d5fd6ab6b5d4f080a8afe920befe0a44c8 (patch)
tree64e13cde9a65127314c2e815600b507d191517e1 /firmware/Makefile
parent5bdae1ce519bc67ab094c10da7bedbbf5b8a535a (diff)
downloadledcontrol-5cc962d5fd6ab6b5d4f080a8afe920befe0a44c8.tar
ledcontrol-5cc962d5fd6ab6b5d4f080a8afe920befe0a44c8.tar.zst
ledcontrol-5cc962d5fd6ab6b5d4f080a8afe920befe0a44c8.zip
Introduce firmware directory
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
new file mode 100644
index 0000000..4698df5
--- /dev/null
+++ b/firmware/Makefile
@@ -0,0 +1,20 @@
+
+# tools
+PREFIX ?= arm-none-eabi
+CC = $(PREFIX)-gcc
+LD = $(PREFIX)-gcc
+OBJCOPY = $(PREFIX)-objcopy
+
+all: libopencm3/lib/libopencm3_stm32f1.a
+ mkdir -p build
+ $(CC) -O0 -c -g -DSTM32F1 -Ilibopencm3/include -mcpu=cortex-m3 -mthumb -o build/main.o src/main.c
+ $(LD) --static -nostartfiles -mcpu=cortex-m3 -mthumb -msoft-float -Tld/stm32f103c8t6.ld -Llibopencm3/lib build/main.o -lopencm3_stm32f1 -o build/ledcontrol.elf
+ $(OBJCOPY) -O binary build/ledcontrol.elf build/ledcontrol.bin
+
+libopencm3/lib/libopencm3_stm32f1.a:
+ make -C libopencm3
+
+clean:
+ rm -rf build
+
+.PHONY: all clean