forked from wirepas/wm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile_bootloader_test.mk
36 lines (24 loc) · 873 Bytes
/
makefile_bootloader_test.mk
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
include makefile_common.mk
.DEFAULT_GOAL := all
# Linker for the bootloader
LDSCRIPT := bootloader_test/linker/$(MCU)/gcc_bl_test_$(MCU)$(MCU_SUB)$(MCU_MEM_VAR).ld
BOOTLOADER_TEST_ELF := $(BUILDPREFIX_TEST_BOOTLOADER)bootloader_test.elf
# Include bootloader test makefile
-include bootloader_test/makefile
OBJS_ = $(SRCS:.c=.o)
OBJS = $(addprefix $(BUILDPREFIX_TEST_BOOTLOADER), $(OBJS_))
$(BUILDPREFIX_TEST_BOOTLOADER)%.o : %.c
$(MKDIR) $(@D)
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
$(BOOTLOADER_TEST_ELF): $(OBJS)
$(MKDIR) $(@D)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ \
-Wl,-Map=$(BUILDPREFIX_TEST_BOOTLOADER)bootloader_test.map \
-Wl,-T,$(LDSCRIPT) $(LIBS)
$(BOOTLOADER_TEST_HEX): $(BOOTLOADER_TEST_ELF)
$(MKDIR) $(@D)
$(OBJCOPY) $(BOOTLOADER_TEST_ELF) -O ihex $@
.PHONY: all
all: $(BOOTLOADER_TEST_HEX)
clean:
$(RM) $(BOOTLOADER_TEST_HEX)