Add Example makefile to linker script generator dir
This commit is contained in:
parent
d38f3bbde5
commit
ea5bbdc08c
46
ld/Makefile.example
Normal file
46
ld/Makefile.example
Normal file
@ -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)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user