2015-02-28 11:20:04 +00:00
|
|
|
BUILD = bootmgr/build/$(BOARD)/$(BTYPE)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
BOOT_INC = -Ibootmgr
|
|
|
|
BOOT_INC += -Ibootmgr/sl
|
|
|
|
BOOT_INC += -Ihal
|
|
|
|
BOOT_INC += -Ihal/inc
|
2017-08-11 03:22:19 +01:00
|
|
|
BOOT_INC += -I$(TOP)/drivers/cc3100/inc
|
2015-02-25 21:38:33 +00:00
|
|
|
BOOT_INC += -Imisc
|
2015-02-25 10:08:51 +00:00
|
|
|
BOOT_INC += -Imods
|
2015-02-06 14:35:48 +00:00
|
|
|
BOOT_INC += -Isimplelink
|
|
|
|
BOOT_INC += -Isimplelink/oslib
|
|
|
|
BOOT_INC += -Iutil
|
2017-08-11 03:22:19 +01:00
|
|
|
BOOT_INC += -I$(TOP)
|
2015-02-06 14:35:48 +00:00
|
|
|
BOOT_INC += -I.
|
|
|
|
BOOT_INC += -I$(BUILD)
|
|
|
|
|
|
|
|
BOOT_CPPDEFINES = -Dgcc -DBOOTLOADER -DTARGET_IS_CC3200 -DSL_TINY
|
|
|
|
|
|
|
|
BOOT_HAL_SRC_C = $(addprefix hal/,\
|
|
|
|
cpu.c \
|
|
|
|
interrupt.c \
|
2015-07-14 20:39:07 +01:00
|
|
|
gpio.c \
|
2015-03-15 09:05:15 +00:00
|
|
|
pin.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
prcm.c \
|
|
|
|
shamd5.c \
|
|
|
|
spi.c \
|
|
|
|
startup_gcc.c \
|
|
|
|
systick.c \
|
|
|
|
utils.c \
|
|
|
|
)
|
|
|
|
|
2015-02-21 19:55:57 +00:00
|
|
|
BOOT_CC3100_SRC_C = $(addprefix drivers/cc3100/,\
|
|
|
|
src/device.c \
|
|
|
|
src/driver.c \
|
|
|
|
src/flowcont.c \
|
|
|
|
src/fs.c \
|
|
|
|
src/netapp.c \
|
|
|
|
src/netcfg.c \
|
|
|
|
src/nonos.c \
|
|
|
|
src/socket.c \
|
|
|
|
src/spawn.c \
|
|
|
|
src/wlan.c \
|
|
|
|
)
|
|
|
|
|
2015-02-25 21:38:33 +00:00
|
|
|
BOOT_MISC_SRC_C = $(addprefix misc/,\
|
2015-06-06 17:42:51 +01:00
|
|
|
antenna.c \
|
2015-02-25 21:38:33 +00:00
|
|
|
mperror.c \
|
|
|
|
)
|
|
|
|
|
2015-02-06 14:35:48 +00:00
|
|
|
BOOT_SL_SRC_C = $(addprefix simplelink/,\
|
|
|
|
cc_pal.c \
|
|
|
|
)
|
|
|
|
|
|
|
|
BOOT_UTIL_SRC_C = $(addprefix util/,\
|
2015-05-19 23:23:13 +01:00
|
|
|
cryptohash.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
BOOT_MAIN_SRC_C = \
|
|
|
|
bootmgr/main.c
|
|
|
|
|
|
|
|
BOOT_MAIN_SRC_S = \
|
|
|
|
bootmgr/runapp.s
|
|
|
|
|
|
|
|
BOOT_PY_SRC_C = $(addprefix py/,\
|
2015-04-16 15:27:56 +01:00
|
|
|
mpprint.c \
|
2015-02-06 14:35:48 +00:00
|
|
|
)
|
|
|
|
|
2021-07-09 05:19:15 +01:00
|
|
|
BOOT_SHARED_SRC_C = $(addprefix shared/,\
|
|
|
|
libc/printf.c \
|
2015-04-19 19:54:43 +01:00
|
|
|
libc/string0.c \
|
|
|
|
)
|
|
|
|
|
2015-02-26 14:29:47 +00:00
|
|
|
OBJ = $(addprefix $(BUILD)/, $(BOOT_HAL_SRC_C:.c=.o) $(BOOT_SL_SRC_C:.c=.o) $(BOOT_CC3100_SRC_C:.c=.o) $(BOOT_UTIL_SRC_C:.c=.o) $(BOOT_MISC_SRC_C:.c=.o))
|
2015-11-10 16:57:45 +00:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(BOOT_MAIN_SRC_C:.c=.o) $(BOOT_MAIN_SRC_S:.s=.o) $(BOOT_PY_SRC_C:.c=.o))
|
2021-07-09 05:19:15 +01:00
|
|
|
OBJ += $(addprefix $(BUILD)/, $(BOOT_SHARED_SRC_C:.c=.o))
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
# Add the linker script
|
|
|
|
LINKER_SCRIPT = bootmgr/bootmgr.lds
|
|
|
|
LDFLAGS += -T $(LINKER_SCRIPT)
|
|
|
|
|
|
|
|
# Add the bootloader specific CFLAGS
|
|
|
|
CFLAGS += $(BOOT_CPPDEFINES) $(BOOT_INC)
|
|
|
|
|
|
|
|
# Disable strict aliasing for the simplelink driver
|
2015-02-21 19:55:57 +00:00
|
|
|
$(BUILD)/drivers/cc3100/src/driver.o: CFLAGS += -fno-strict-aliasing
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
# Check if we would like to debug the port code
|
|
|
|
ifeq ($(BTYPE), release)
|
|
|
|
# Optimize everything and define the NDEBUG flag
|
|
|
|
CFLAGS += -Os -DNDEBUG
|
|
|
|
else
|
|
|
|
ifeq ($(BTYPE), debug)
|
|
|
|
# Define the DEBUG flag
|
|
|
|
CFLAGS += -DDEBUG=DEBUG
|
|
|
|
# Optimize the stable sources only
|
|
|
|
$(BUILD)/hal/%.o: CFLAGS += -Os
|
2015-02-25 21:38:33 +00:00
|
|
|
$(BUILD)/misc/%.o: CFLAGS += -Os
|
2015-02-06 14:35:48 +00:00
|
|
|
$(BUILD)/simplelink/%.o: CFLAGS += -Os
|
2015-02-22 16:48:13 +00:00
|
|
|
$(BUILD)/drivers/cc3100/%.o: CFLAGS += -Os
|
2015-02-06 14:35:48 +00:00
|
|
|
$(BUILD)/py/%.o: CFLAGS += -Os
|
2017-09-06 05:09:13 +01:00
|
|
|
$(BUILD)/ports/stm32/%.o: CFLAGS += -Os
|
2015-02-06 14:35:48 +00:00
|
|
|
else
|
|
|
|
$(error Invalid BTYPE specified)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
SHELL = bash
|
|
|
|
BOOT_GEN = bootmgr/bootgen.sh
|
|
|
|
HEADER_BUILD = $(BUILD)/genhdr
|
|
|
|
|
|
|
|
all: $(BUILD)/bootloader.bin
|
|
|
|
|
|
|
|
$(BUILD)/bootmgr.axf: $(OBJ) $(LINKER_SCRIPT)
|
|
|
|
$(ECHO) "LINK $@"
|
|
|
|
$(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
|
|
|
|
$(Q)$(SIZE) $@
|
|
|
|
|
|
|
|
$(BUILD)/bootmgr.bin: $(BUILD)/bootmgr.axf
|
|
|
|
$(ECHO) "Create $@"
|
|
|
|
$(Q)$(OBJCOPY) -O binary $< $@
|
|
|
|
|
|
|
|
$(BUILD)/bootloader.bin: $(BUILD)/bootmgr.bin
|
|
|
|
$(ECHO) "Create $@"
|
2015-10-28 10:09:45 +00:00
|
|
|
$(Q)$(SHELL) $(BOOT_GEN) $(BUILD)
|
2015-02-06 14:35:48 +00:00
|
|
|
|
|
|
|
# Create an empty "qstrdefs.generated.h" needed by py/mkrules.mk
|
|
|
|
$(HEADER_BUILD)/qstrdefs.generated.h: | $(HEADER_BUILD)
|
|
|
|
touch $@
|
|
|
|
|
2015-04-22 17:38:05 +01:00
|
|
|
# Create an empty "mpversion.h" needed by py/mkrules.mk
|
|
|
|
$(HEADER_BUILD)/mpversion.h: | $(HEADER_BUILD)
|
2015-02-06 14:35:48 +00:00
|
|
|
touch $@
|