summaryrefslogtreecommitdiffstats
path: root/libopencm3/ld/Makefile.example
blob: 60b01af41f9f999cec010b840a2ffa122c762bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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)