Commit c091e691 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

CC3200 build cleanup; commonized fw_meta targets

Some yak shaving along the way

PUBLISHED_FROM=09c7cfbd98dcec961970dfad3f38e67912a5b06c
parent 35f633b5
# -*- mode: makefile -*- # -*- mode: makefile -*-
# This file is executed inside Docker build container. # This file is executed inside Docker build container.
# It can be used without container too if SDK_PATH and V7_PATH are configured. # It can be used without container too if SDK_PATH is configured.
PLATFORM = CC3200 PLATFORM = CC3200
SDK_PATH ?= /cc3200-sdk SDK_PATH ?= /cc3200-sdk
...@@ -10,36 +10,18 @@ BUILD_DIR ?= ./build ...@@ -10,36 +10,18 @@ BUILD_DIR ?= ./build
FW_DIR ?= ./out FW_DIR ?= ./out
SLFS_PATH ?= ./slfs SLFS_PATH ?= ./slfs
BINDIR = ${FW_DIR} BINDIR = $(FW_DIR)
OBJDIR = ${BUILD_DIR} OBJDIR = $(BUILD_DIR)
include ${SDK_PATH}/tools/gcc_scripts/makedefs include $(SDK_PATH)/tools/gcc_scripts/makedefs
.PHONY: all clean flash .PHONY: all clean flash
PROG = cc3200_example PROG = cc3200_example
IPATH = . ../.. \ IPATH = . ../.. $(REPO_PATH)
$(REPO_PATH) \
${SDK_PATH} \ VPATH = ../..
${SDK_PATH}/inc \
${SDK_PATH}/driverlib \
${SDK_PATH}/oslib \
${SDK_PATH}/simplelink \
${SDK_PATH}/simplelink/include \
${SDK_PATH}/third_party/FreeRTOS/source \
${SDK_PATH}/third_party/FreeRTOS/source/include \
${SDK_PATH}/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
VPATH = ../.. ${SDK_PATH}/driverlib \
${SDK_PATH}/example/common \
${SDK_PATH}/oslib \
${SDK_PATH}/simplelink \
${SDK_PATH}/simplelink/source \
${SDK_PATH}/third_party/FreeRTOS/source \
${SDK_PATH}/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
${SDK_PATH}/third_party/FreeRTOS/source/portable/MemMang \
${COMMON_PATH}/platforms/cc3200 \
MONGOOSE_FEATURES = \ MONGOOSE_FEATURES = \
-DMG_CC3200 \ -DMG_CC3200 \
...@@ -60,38 +42,36 @@ MONGOOSE_FEATURES = \ ...@@ -60,38 +42,36 @@ MONGOOSE_FEATURES = \
SDK_FLAGS = -DTARGET_IS_CC3200 -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED SDK_FLAGS = -DTARGET_IS_CC3200 -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
DISABLED_SDK_WARNINGS = -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
CFLAGS += -Os -Wall -Werror \ CFLAGS += -Os -Wall -Werror \
$(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \ $(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
${MONGOOSE_FEATURES} ${CFLAGS_EXTRA} $(MONGOOSE_FEATURES) $(CFLAGS_EXTRA)
FW_ELF = ${FW_DIR}/${PROG}.axf FW_ELF = $(FW_DIR)/$(PROG).axf
FW_BIN = ${FW_DIR}/${PROG}.bin FW_BIN = $(FW_DIR)/$(PROG).bin
FW_MANIFEST = ${FW_DIR}/manifest.json FW_MANIFEST = $(FW_DIR)/manifest.json
FW_ZIP = ${FW_DIR}/firmware.zip FW_ZIP = $(FW_DIR)/firmware.zip
BUILD_INFO_JSON = ${OBJDIR}/build_info.json BUILD_INFO_JSON = $(OBJDIR)/build_info.json
SLFS_FILES = $(wildcard $(SLFS_PATH)/*) SLFS_FILES = $(wildcard $(SLFS_PATH)/*)
.PHONY: all clean flash .PHONY: all clean flash
all: ${OBJDIR} ${SYS_CONFIG_C} ${FW_DIR} ${FW_ZIP} all: $(OBJDIR) $(FW_DIR) $(FW_ZIP)
clean: clean:
@rm -rf ${OBJDIR} ${wildcard *~} @rm -rf $(OBJDIR) $(wildcard *~)
@rm -rf ${FW_DIR} ${wildcard *~} @rm -rf $(FW_DIR) $(wildcard *~)
${OBJDIR}: $(OBJDIR):
@echo " MKDIR $@" @echo " MKDIR $@"
@mkdir -p ${OBJDIR} ${FS_BUILD_DIR} @mkdir -p $(OBJDIR) $(FS_BUILD_DIR)
${FW_DIR}: $(FW_DIR):
@echo " MKDIR $@" @echo " MKDIR $@"
@mkdir -p ${FW_DIR} @mkdir -p $(FW_DIR)
${FW_ZIP}: ${FW_ELF} ${FW_BIN} ${SLFS_FILES} $(FW_ZIP): $(FW_ELF) $(FW_BIN) $(SLFS_FILES)
@echo " Code size: $(shell ls -l ${FW_BIN} | awk '{print $$5}')" @echo " Code size: $(shell ls -l $(FW_BIN) | awk '{print $$5}')"
@echo " GEN ${FW_MANIFEST}" @echo " GEN $(FW_MANIFEST)"
@$(COMMON_PATH)/tools/fw_meta.py gen_build_info \ @$(COMMON_PATH)/tools/fw_meta.py gen_build_info \
--json_output=$(BUILD_INFO_JSON) --json_output=$(BUILD_INFO_JSON)
@cp -v $(SLFS_FILES) out/ @cp -v $(SLFS_FILES) out/
...@@ -108,25 +88,33 @@ ${FW_ZIP}: ${FW_ELF} ${FW_BIN} ${SLFS_FILES} ...@@ -108,25 +88,33 @@ ${FW_ZIP}: ${FW_ELF} ${FW_BIN} ${SLFS_FILES}
--src_dir=$(FW_DIR) \ --src_dir=$(FW_DIR) \
--output=$@ --output=$@
APP_OBJS = $(OBJDIR)/main.o \ CC3200_PLATFORM_SRCS = cc3200_fs.c cc3200_fs_slfs.c cc3200_libc.c cc3200_socket.c
${OBJDIR}/cc3200_fs.o ${OBJDIR}/cc3200_fs_slfs.o ${OBJDIR}/cc3200_libc.o \ VPATH += $(COMMON_PATH)/platforms/cc3200
${OBJDIR}/cc3200_socket.o \
${OBJDIR}/mongoose.o \ FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
${OBJDIR}/startup_gcc.o \ DRIVER_SRCS = cpu.c i2c.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
${OBJDIR}/timers.o ${OBJDIR}/list.o ${OBJDIR}/queue.o ${OBJDIR}/tasks.o ${OBJDIR}/port.o ${OBJDIR}/heap_3.o ${OBJDIR}/osi_freertos.o \ SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c cc_pal.c fs.c
${OBJDIR}/socket.o ${OBJDIR}/wlan.o ${OBJDIR}/driver.o ${OBJDIR}/device.o ${OBJDIR}/netapp.o ${OBJDIR}/netcfg.o ${OBJDIR}/cc_pal.o ${OBJDIR}/fs.o \ SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
${OBJDIR}/cpu.o ${OBJDIR}/i2c.o ${OBJDIR}/interrupt.o ${OBJDIR}/pin.o ${OBJDIR}/prcm.o ${OBJDIR}/spi.o ${OBJDIR}/uart.o ${OBJDIR}/udma.o ${OBJDIR}/utils.o IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib $(SDK_PATH)/oslib \
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/include \
$(SDK_PATH)/third_party/FreeRTOS/source \
$(SDK_PATH)/third_party/FreeRTOS/source/include \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
VPATH += $(SDK_PATH)/driverlib $(SDK_PATH)/example/common $(SDK_PATH)/oslib \
$(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/source \
$(SDK_PATH)/third_party/FreeRTOS/source \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
$(SDK_PATH)/third_party/FreeRTOS/source/portable/MemMang \
APP_SRCS = main.c mongoose.c $(CC3200_PLATFORM_SRCS) $(SDK_SRCS)
APP_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(APP_SRCS)))
${FW_ELF}: ${APP_OBJS} $(FW_ELF): $(APP_OBJS)
SCATTERgcc_${PROG} = ${PROG}.ld SCATTERgcc_$(PROG) = $(PROG).ld
ENTRY_${PROG} = ResetISR ENTRY_$(PROG) = ResetISR
# Target specific warning inhibitions # Disable certain warnings on SDK sources, we have no control over them anyway.
build/wlan.o: CFLAGS += $(DISABLED_SDK_WARNINGS) SDK_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SDK_SRCS)))
build/driver.o: CFLAGS += $(DISABLED_SDK_WARNINGS) $(SDK_OBJS): CFLAGS += -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
build/fs.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/spi.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/prcm.o: CFLAGS += $(DISABLED_SDK_WARNINGS)
build/spiffs_hydrogen.o: CFLAGS += -Wno-unused-function
...@@ -144,8 +144,7 @@ int main() { ...@@ -144,8 +144,7 @@ int main() {
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0);
//cs_log_set_level(LL_INFO); cs_log_set_level(LL_INFO);
cs_log_set_level(LL_VERBOSE_DEBUG);
VStartSimpleLinkSpawnTask(8); VStartSimpleLinkSpawnTask(8);
osi_TaskCreate(mg_task, (const signed char *) "mg", 8192, NULL, 3, NULL); osi_TaskCreate(mg_task, (const signed char *) "mg", 8192, NULL, 3, NULL);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment