From ea5bbdc08cbf382b404aa2688ee92d117cdc59f7 Mon Sep 17 00:00:00 2001 From: BuFran Date: Fri, 5 Jul 2013 20:45:00 +0200 Subject: [PATCH] Add Example makefile to linker script generator dir --- ld/Makefile.example | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 ld/Makefile.example diff --git a/ld/Makefile.example b/ld/Makefile.example new file mode 100644 index 00000000..60b01af4 --- /dev/null +++ b/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) +