aboutsummaryrefslogtreecommitdiff
path: root/system-clock/Makefile.preamble
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2018-01-15 13:51:38 -0700
committerJosh Rahm <joshuarahm@gmail.com>2018-01-15 13:51:38 -0700
commitc861c7cd70959f9d6154d1b5541cc5cd57f030ba (patch)
treee26281e90e136e62e48b1206ef858f2db3430538 /system-clock/Makefile.preamble
downloadstm32l4-c861c7cd70959f9d6154d1b5541cc5cd57f030ba.tar.gz
stm32l4-c861c7cd70959f9d6154d1b5541cc5cd57f030ba.tar.bz2
stm32l4-c861c7cd70959f9d6154d1b5541cc5cd57f030ba.zip
Added system-clock files including the genmake script.
Diffstat (limited to 'system-clock/Makefile.preamble')
-rw-r--r--system-clock/Makefile.preamble21
1 files changed, 21 insertions, 0 deletions
diff --git a/system-clock/Makefile.preamble b/system-clock/Makefile.preamble
new file mode 100644
index 0000000..2a66399
--- /dev/null
+++ b/system-clock/Makefile.preamble
@@ -0,0 +1,21 @@
+OPT?=-O
+PREFIX?=arm-unknown-eabi-
+CC=$(PREFIX)gcc
+LD=$(PREFIX)ld
+CFLAGS?=$(OPT) -mcpu=cortex-m4 -mthumb -g -lgcc -static -nostartfiles
+LD_FLAGS?=-T linker_script.ld -nostdlib --cref -Map main.map -static
+
+
+all: main.elf
+
+main.bin: main.elf
+ $(PREFIX)objcopy -O binary main.elf main.bin
+
+flash: main.bin
+ st-flash write main.bin 0x8000000
+
+clean:
+ rm -f *.o *.elf *.bin
+
+genmake:
+ ./genmake.pl > Makefile