summaryrefslogtreecommitdiffstats
path: root/libopencm3/ld/Makefile.example
diff options
context:
space:
mode:
authorroot <root@lab2.panaceas.james.local>2014-11-02 10:14:39 +0000
committerroot <root@lab2.panaceas.james.local>2014-11-02 10:14:39 +0000
commit1dc7d758f96dd2b9bd7b03f01ca032d68b696cf0 (patch)
tree1a70fddfcc79c54c863912a3b8b8cecc594f21ae /libopencm3/ld/Makefile.example
downloadstm32_usb_kvm-1dc7d758f96dd2b9bd7b03f01ca032d68b696cf0.tar.gz
stm32_usb_kvm-1dc7d758f96dd2b9bd7b03f01ca032d68b696cf0.tar.bz2
stm32_usb_kvm-1dc7d758f96dd2b9bd7b03f01ca032d68b696cf0.zip
fish
Diffstat (limited to 'libopencm3/ld/Makefile.example')
-rw-r--r--libopencm3/ld/Makefile.example46
1 files changed, 46 insertions, 0 deletions
diff --git a/libopencm3/ld/Makefile.example b/libopencm3/ld/Makefile.example
new file mode 100644
index 0000000..60b01af
--- /dev/null
+++ b/libopencm3/ld/Makefile.example
@@ -0,0 +1,46 @@
+BINARY = button
+
+DEVICE = stm32f407vgt6
+
+# common Makefile.include from examples directory unpacked and stripped
+#include ../../Makefile.include
+
+CC = arm-none-eabi-gcc
+LD = arm-none-eabi-gcc
+OBJCOPY = arm-none-eabi-objcopy
+OBJDUMP = arm-none-eabi-objdump
+GDB = arm-none-eabi-gdb
+
+TOOLCHAIN_DIR ?= ../../../../../libopencm3
+
+CFLAGS += <...>
+LDSCRIPT ?= $(BINARY).ld
+LDFLAGS += <..>
+OBJS += $(BINARY).o
+
+GENFILES ?= *.o
+
+all: images
+
+## This is the place where the translation DEVICE->LDSCRIPT will be executed
+include $(TOOLCHAIN_DIR)/ld/Makefile.linker
+
+images: $(BINARY).images
+flash: $(BINARY).flash
+
+<... comon makefile continues ...>
+
+clean:
+ $(Q)rm -f *.o
+ $(Q)rm -f *.d
+ $(Q)rm -f *.elf
+ $(Q)rm -f *.bin
+ $(Q)rm -f *.hex
+ $(Q)rm -f *.srec
+ $(Q)rm -f *.list
+ $(Q)rm -f $(GENFILES)
+
+.PHONY: images clean
+
+-include $(OBJS:.o=.d)
+