Statistics
| Branch: | Tag: | Revision:

mongoose / examples / CC3200 / Makefile.build @ eaef5bd1

History | View | Annotate | Download (3.7 KB)

1
# -*- mode: makefile -*-
2
# This file is executed inside Docker build container.
3
# It can be used without container too if SDK_PATH is configured.
4

    
5
PLATFORM = CC3200
6
SDK_PATH ?= /cc3200-sdk
7
REPO_PATH ?= ../../..
8
BUILD_DIR ?= ./.build
9
FW_DIR ?= ./out
10
SLFS_PATH ?= ./slfs
11

    
12
BINDIR = $(FW_DIR)
13
OBJDIR = $(BUILD_DIR)
14

    
15
include $(SDK_PATH)/tools/gcc_scripts/makedefs
16

    
17
.PHONY: all clean flash
18

    
19
PROG = cc3200_example
20

    
21
IPATH = . ../.. $(REPO_PATH)
22

    
23
VPATH = ../..
24

    
25
MONGOOSE_FEATURES = -DMG_ENABLE_SSL -DMG_ENABLE_HTTP_STREAMING_MULTIPART
26

    
27
SDK_FLAGS = -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
28
# -DTARGET_IS_CC3200 would reduce code size by using functions in ROM
29
# but then the code won't work on pre-release chips (XCC3200HZ).
30

    
31
CFLAGS += -Os -Wall -Werror \
32
          $(SDK_FLAGS) -DCS_PLATFORM=4 -DCC3200_FS_SLFS \
33
          $(MONGOOSE_FEATURES) $(CFLAGS_EXTRA)
34

    
35
FW_ELF = $(FW_DIR)/$(PROG).axf
36
FW_BIN = $(FW_DIR)/$(PROG).bin
37
FW_MANIFEST = $(FW_DIR)/manifest.json
38
FW_ZIP = $(FW_DIR)/firmware.zip
39
BUILD_INFO_JSON = $(OBJDIR)/build_info.json
40
SLFS_FILES = $(wildcard $(SLFS_PATH)/*)
41

    
42
.PHONY: all clean flash
43

    
44
all: $(OBJDIR) $(FW_DIR) $(FW_ZIP)
45

    
46
clean:
47
	@rm -rf $(OBJDIR) $(wildcard *~)
48
	@rm -rf $(FW_DIR) $(wildcard *~)
49

    
50
$(OBJDIR):
51
	@echo "  MKDIR $@"
52
	@mkdir -p $(OBJDIR) $(FS_BUILD_DIR)
53

    
54
$(FW_DIR):
55
	@echo "  MKDIR $@"
56
	@mkdir -p $(FW_DIR)
57

    
58
$(FW_ZIP): $(FW_ELF) $(FW_BIN) $(SLFS_FILES)
59
	@echo "    Code size: $(shell ls -l $(FW_BIN) | awk '{print $$5}')"
60
	@echo "  GEN   $(FW_MANIFEST)"
61
	@fw_meta gen_build_info \
62
	  --json_output=$(BUILD_INFO_JSON)
63
	@cp -v $(SLFS_FILES) out/
64
	@cp $(CC3200_SP_FILE)* $(FW_DIR)
65
	@fw_meta create_manifest \
66
	  --name=$(PROG) --platform=$(PLATFORM) \
67
	  --build_info=$(BUILD_INFO_JSON) \
68
	  --output=$(FW_MANIFEST) \
69
	  --src_dir=$(FW_DIR) \
70
	  /sys/servicepack.ucf:type=slfile,src=$(CC3200_SP_FILE),falloc=60416,sign=$(notdir $(CC3200_SP_FILE)).sign \
71
	  $(notdir $(CC3200_SP_FILE)).sign:type=signature,src=$(CC3200_SP_FILE).sign \
72
	  /sys/mcuimg.bin:type=app,src=$(notdir $(FW_BIN)) \
73
	  $(foreach f,$(SLFS_FILES), $(notdir $(f)):type=slfile,src=$(notdir $(f)))
74
	@echo "  ZIP   $@"
75
	@fw_meta create_fw \
76
	  --manifest=$(FW_MANIFEST) \
77
	  --src_dir=$(FW_DIR) \
78
	  --output=$@
79

    
80
FREERTOS_SRCS = timers.c list.c queue.c tasks.c port.c heap_3.c osi_freertos.c
81
DRIVER_SRCS = cpu.c gpio.c gpio_if.c i2c.c i2c_if.c interrupt.c pin.c prcm.c spi.c uart.c udma.c utils.c
82
SL_SRCS = socket.c wlan.c driver.c device.c netapp.c netcfg.c network_common.c cc_pal.c fs.c
83
SDK_SRCS = startup_gcc.c $(FREERTOS_SRCS) $(DRIVER_SRCS) $(SL_SRCS)
84
IPATH += $(SDK_PATH) $(SDK_PATH)/inc $(SDK_PATH)/driverlib \
85
         $(SDK_PATH)/example/common $(SDK_PATH)/oslib \
86
         $(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/include \
87
         $(SDK_PATH)/simplelink_extlib/provisioninglib \
88
         $(SDK_PATH)/third_party/FreeRTOS/source \
89
         $(SDK_PATH)/third_party/FreeRTOS/source/include \
90
         $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4
91
VPATH += $(SDK_PATH)/driverlib $(SDK_PATH)/example/common $(SDK_PATH)/oslib \
92
         $(SDK_PATH)/simplelink $(SDK_PATH)/simplelink/source \
93
         $(SDK_PATH)/third_party/FreeRTOS/source \
94
         $(SDK_PATH)/third_party/FreeRTOS/source/portable/GCC/ARM_CM4 \
95
         $(SDK_PATH)/third_party/FreeRTOS/source/portable/MemMang \
96

    
97
APP_SRCS = main.c bm222.c data.c mongoose.c tmp006.c wifi.c $(SDK_SRCS)
98
APP_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(APP_SRCS)))
99

    
100
$(FW_ELF): $(APP_OBJS)
101

    
102
SCATTERgcc_$(PROG) = $(PROG).ld
103
ENTRY_$(PROG) = ResetISR
104

    
105
# Disable certain warnings on SDK sources, we have no control over them anyway.
106

    
107
SDK_OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SDK_SRCS)))
108
$(SDK_OBJS): CFLAGS += -include mongoose.h -Wno-missing-braces -Wno-strict-aliasing -Wno-parentheses -Wno-unused-variable