aboutsummaryrefslogtreecommitdiff
path: root/00-hello/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '00-hello/Makefile')
-rw-r--r--00-hello/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/00-hello/Makefile b/00-hello/Makefile
new file mode 100644
index 0000000..9c62c90
--- /dev/null
+++ b/00-hello/Makefile
@@ -0,0 +1,17 @@
+OPT?=-O3
+all: main.bin
+
+main.s: main.c
+ arm-unknown-eabi-gcc $(OPT) -S main.c -mcpu=cortex-m4 -mthumb -g
+
+main.elf: main.c
+ arm-unknown-eabi-gcc $(OPT) main.c -mcpu=cortex-m4 -mthumb -g -lgcc -T linker_script.ld -Xlinker --cref -Xlinker -Map -Xlinker main.map -nostartfiles -o main.elf
+
+main.bin: main.elf
+ arm-unknown-eabi-objcopy -O binary main.elf main.bin
+
+flash: main.bin
+ st-flash write main.bin 0x8000000
+
+clean:
+ rm -f *.elf *.bin