mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-12 15:39:00 +08:00
b6d700077a
PUBLISHED_FROM=e56601f99ccf80d8420b4b54b0ef7c272ec4a656
122 lines
3.8 KiB
Makefile
122 lines
3.8 KiB
Makefile
# -*- mode: makefile -*-
|
|
# This file is executed inside Docker build container.
|
|
# It can be used without container too if SDK_PATH is configured.
|
|
|
|
PLATFORM = CC3200
|
|
SDK_PATH ?= /cc3200-sdk
|
|
REPO_PATH ?= ../../..
|
|
COMMON_PATH ?= $(REPO_PATH)/common
|
|
BUILD_DIR ?= ./build
|
|
FW_DIR ?= ./out
|
|
SLFS_PATH ?= ./slfs
|
|
|
|
BINDIR = $(FW_DIR)
|
|
OBJDIR = $(BUILD_DIR)
|
|
|
|
include $(SDK_PATH)/tools/gcc_scripts/makedefs
|
|
|
|
.PHONY: all clean flash
|
|
|
|
PROG = cc3200_example
|
|
|
|
IPATH = . ../.. $(REPO_PATH)
|
|
|
|
VPATH = ../..
|
|
|
|
MONGOOSE_FEATURES = \
|
|
-DMG_CC3200 \
|
|
-DMG_DISABLE_DIRECTORY_LISTING \
|
|
-DMG_DISABLE_JSON_RPC \
|
|
-DMG_DISABLE_COAP \
|
|
-DMG_DISABLE_SYNC_RESOLVER \
|
|
-DMG_DISABLE_SOCKETPAIR \
|
|
-DMG_DISABLE_DAV \
|
|
-DMG_DISABLE_CGI \
|
|
-DMG_DISABLE_SSI \
|
|
-DMG_ENABLE_HTTP_STREAMING_MULTIPART \
|
|
-DMG_MAX_HTTP_HEADERS=20 \
|
|
-DMG_MAX_HTTP_REQUEST_SIZE=1024 \
|
|
-DMG_MAX_PATH=40 \
|
|
-DMG_MAX_HTTP_SEND_MBUF=1024 \
|
|
-DMG_NO_BSD_SOCKETS
|
|
|
|
SDK_FLAGS = -DTARGET_IS_CC3200 -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
|
|
|
|
CFLAGS += -Os -Wall -Werror \
|
|
$(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
|
|
$(MONGOOSE_FEATURES) $(CFLAGS_EXTRA)
|
|
|
|
FW_ELF = $(FW_DIR)/$(PROG).axf
|
|
FW_BIN = $(FW_DIR)/$(PROG).bin
|
|
FW_MANIFEST = $(FW_DIR)/manifest.json
|
|
FW_ZIP = $(FW_DIR)/firmware.zip
|
|
BUILD_INFO_JSON = $(OBJDIR)/build_info.json
|
|
SLFS_FILES = $(wildcard $(SLFS_PATH)/*)
|
|
|
|
.PHONY: all clean flash
|
|
|
|
all: $(OBJDIR) $(FW_DIR) $(FW_ZIP)
|
|
|
|
clean:
|
|
@rm -rf $(OBJDIR) $(wildcard *~)
|
|
@rm -rf $(FW_DIR) $(wildcard *~)
|
|
|
|
$(OBJDIR):
|
|
@echo " MKDIR $@"
|
|
@mkdir -p $(OBJDIR) $(FS_BUILD_DIR)
|
|
|
|
$(FW_DIR):
|
|
@echo " MKDIR $@"
|
|
@mkdir -p $(FW_DIR)
|
|
|
|
$(FW_ZIP): $(FW_ELF) $(FW_BIN) $(SLFS_FILES)
|
|
@echo " Code size: $(shell ls -l $(FW_BIN) | awk '{print $$5}')"
|
|
@echo " GEN $(FW_MANIFEST)"
|
|
@$(COMMON_PATH)/tools/fw_meta.py gen_build_info \
|
|
--json_output=$(BUILD_INFO_JSON)
|
|
@cp -v $(SLFS_FILES) out/
|
|
@$(COMMON_PATH)/tools/fw_meta.py create_manifest \
|
|
--name=$(PROG) --platform=$(PLATFORM) \
|
|
--build_info=$(BUILD_INFO_JSON) \
|
|
--output=$(FW_MANIFEST) \
|
|
--src_dir=$(FW_DIR) \
|
|
sys_mcuimg.bin:src=$(notdir $(FW_BIN)) \
|
|
$(foreach f,$(SLFS_FILES), $(notdir $(f)):src=$(notdir $(f)))
|
|
@echo " ZIP $@"
|
|
@$(COMMON_PATH)/tools/fw_meta.py create_fw \
|
|
--manifest=$(FW_MANIFEST) \
|
|
--src_dir=$(FW_DIR) \
|
|
--output=$@
|
|
|
|
CC3200_PLATFORM_SRCS = cc3200_fs.c cc3200_fs_slfs.c cc3200_libc.c cc3200_socket.c
|
|
VPATH += $(COMMON_PATH)/platforms/cc3200
|
|
|
|
FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
|
|
DRIVER_SRCS = cpu.c i2c.c i2c_if.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
|
|
SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c cc_pal.c fs.c
|
|
SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
|
|
IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib \
|
|
$(SDK_PATH)/example/common $(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 tmp006.c mongoose.c $(CC3200_PLATFORM_SRCS) $(SDK_SRCS)
|
|
APP_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(APP_SRCS)))
|
|
|
|
$(FW_ELF): $(APP_OBJS)
|
|
|
|
SCATTERgcc_$(PROG) = $(PROG).ld
|
|
ENTRY_$(PROG) = ResetISR
|
|
|
|
# Disable certain warnings on SDK sources, we have no control over them anyway.
|
|
|
|
SDK_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SDK_SRCS)))
|
|
$(SDK_OBJS): CFLAGS += -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable
|