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