1STATIC_LIB ?= y 2DEBUG ?= y 3BUILD_SUPPL ?= y 4WPA_ENTERPRISE ?= y 5XCC ?= n 6#enable/disable wireless simple config (WPS) support 7CONFIG_EAP_WSC ?= n 8 9WILINK_ROOT = ../.. 10CUDK_ROOT ?= $(WILINK_ROOT)/CUDK 11CU_ROOT = $(CUDK_ROOT)/configurationutility 12OUTPUT_DIR ?= $(CUDK_ROOT)/output 13TI_OS_LIB_DIR=$(CUDK_ROOT)/output 14ifeq ($(STATIC_LIB),y) 15 TI_OS_LIB = tiOsLib.a 16else 17 TI_OS_LIB = tiOsLib.so 18endif 19 20ifeq ($(DEBUG),y) 21 DEBUGFLAGS = -O2 -g -DDEBUG -DTI_DBG -fno-builtin 22else 23 DEBUGFLAGS = -O2 24endif 25 26DEBUGFLAGS+= -DHOST_COMPILE -DANDROID 27 28ifeq ($(XCC), y) 29 DK_DEFINES = -D XCC_MODULE_INCLUDED 30endif 31ifeq ($(WPA_ENTERPRISE), y) 32 DK_DEFINES += -D WPA_ENTERPRISE 33endif 34 35TARGET := $(OUTPUT_DIR)/wlan_cu 36SRCS := \ 37 src/console.c \ 38 src/cu_common.c \ 39 src/cu_cmd.c \ 40 src/ticon.c \ 41 src/wpa_core.c 42 43ifeq ($(XCC), y) 44SRCS += \ 45 XCC/cu_XCC.c 46endif 47 48 49OBJS = $(SRCS:.c=.o) 50 51DEPS = $(SRCS:%.c=%.d) 52 53ARMFLAGS = -fno-common -pipe 54 55#Supplicant image building 56ifeq ($(BUILD_SUPPL), y) 57DK_DEFINES += -D WPA_SUPPLICANT -D CONFIG_CTRL_IFACE -D CONFIG_CTRL_IFACE_UNIX 58 -include $(CU_ROOT)/$(TI_SUPP_LIB_DIR)/.config 59ifeq ($(CONFIG_EAP_WSC), y) 60DK_DEFINES += -DCONFIG_EAP_WSC 61endif 62endif 63 64INCLUDES = \ 65 -I inc \ 66 -I $(CUDK_ROOT)/os/linux/inc \ 67 -I $(CUDK_ROOT)/os/common/inc \ 68 -I $(WILINK_ROOT)/stad/Export_Inc \ 69 -I $(WILINK_ROOT)/stad/src/Sta_Management \ 70 -I $(WILINK_ROOT)/stad/src/Application \ 71 -I $(WILINK_ROOT)/utils \ 72 -I $(WILINK_ROOT)/Txn \ 73 -I $(WILINK_ROOT)/TWD/TWDriver \ 74 -I $(WILINK_ROOT)/TWD/FirmwareApi \ 75 -I $(WILINK_ROOT)/TWD/TwIf \ 76 -I $(WILINK_ROOT)/platforms/os/linux/inc \ 77 -I $(WILINK_ROOT)/platforms/os/common/inc \ 78 -I $(KERNEL_DIR)/include \ 79 -I $(WILINK_ROOT)/TWD/FW_Transfer/Export_Inc \ 80 -I $(CUDK_ROOT)/$(TI_SUPP_LIB_DIR) 81 82ifeq ($(XCC), y) 83INCLUDES += \ 84 -I XCC \ 85 -I $(WILINK_ROOT)/stad/Export_Inc/XCC \ 86 -I $(WILINK_ROOT)/utils/XCC \ 87 -I $(CUDK_ROOT)/devicescape-dsa-XCC-wps-2.0.1-008 \ 88 -I $(CUDK_ROOT)/devicescape-dsa-XCC-wps-2.0.1-008/openssl-0.9.8e/include 89endif 90 91CFLAGS = $(OPT) -Wall -Wstrict-prototypes $(DEBUGFLAGS) $(INCLUDES) -D__LINUX__ $(DK_DEFINES) -D__BYTE_ORDER_LITTLE_ENDIAN 92CFLAGS += -DDRV_NAME='"tiwlan"' 93 94ifneq "$(CROSS_COMPILE)" "" #compile for ARM 95 CFLAGS += $(ARMFLAGS) 96 # strip symbols 97ifneq "$(DEBUG)" "y" 98 LDFLAGS = -s 99endif 100 101endif # CROSS_COMPILE != "" 102 103.PHONY: all 104 105all: $(TARGET) 106 107$(TARGET): $(OBJS) 108 $(CROSS_COMPILE)gcc --static $(OBJS) $(TI_OS_LIB_DIR)/$(TI_OS_LIB) -L $(CU_ROOT)/Output $(LDFLAGS) -lpthread -lc -o $@ 109ifeq ($(DEBUG), y) 110 cp -a $(TARGET) $(TARGET)_debug 111 $(CROSS_COMPILE)strip -s $(TARGET) 112endif #DEBUG 113 114ifeq ("$(findstring $(MAKECMDGOALS), clean cleanall)", "") 115-include .depend 116endif 117 118%.o: %.cpp 119 @echo $@ 120 @$(CROSS_COMPILE)gcc $(CFLAGS) -c $^ -o $@ 121 122%.o: %.c 123 @echo $@ 124 @$(CROSS_COMPILE)gcc -s $(CFLAGS) -c $< -o $@ 125 126%.i: %.c 127 @$(CROSS_COMPILE)gcc $(CFLAGS) -E -c $< > $@ 128 129%.d: %.c 130 @echo $@ 131 @$(CROSS_COMPILE)gcc $< -MT$(^:%.c=%.o) -M $(CFLAGS) > $@ 132 133%.d: %.cpp 134 @echo $@ 135 @$(CROSS_COMPILE)gcc $< -MT$(^:%.cpp=%.o) -M $(CFLAGS) > $@ 136 137.depend: $(DEPS) 138 rm -f $@ 139 for aa in $^; do cat $$aa >> $@; done 140 141.PHONY: clean 142clean: 143 @echo cleaning configuration utility... 144 rm -f .depend $(OBJS) $(DEPS) $(SRCS:.c=.i) *.ko .*.cmd .*.flags *.mod.c *~ *.~* $(OUTPUT_DIR)/wlan_cu $(OUTPUT_DIR)/wlan_cu_debug 145 146cleanall: clean 147 148 149