• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2##
3##
4## Application Make Flags
5##
6##
7
8#
9# Statically link the CU
10#
11STATIC_LIB ?= y
12
13#
14# Rebuild the supplicant
15#
16BUILD_SUPPL ?= n
17
18#
19# Supplicant
20#
21SUPPL ?= ANDROID
22
23#
24# XCC
25#
26XCC ?= n
27#ifeq ($(XCC),y)
28#	SUPPL = DEVICESCAPE
29#endif
30
31#
32# FW
33#
34FW ?= 1273
35
36#
37# Full Async Mode
38#
39FULL_ASYNC ?= n
40
41#
42# Build bmtrace performance tool
43#
44BMTRACE ?= n
45
46#
47# Full Async Mode
48#
49USE_IRQ_ACTIVE_HIGH ?= n
50
51#
52# bus test-driver
53#
54TEST ?= n
55
56#
57# Eth Support
58#
59ETH_SUPPORT ?= n
60
61#
62# Debug
63#
64DEBUG ?= y
65
66##
67##
68## File lists and locations
69##
70##
71
72#
73# DK_ROOT must be set prior to including common.inc
74#
75DK_ROOT = ../../..
76
77#
78# Includes common definitions and source file list
79#
80ifneq ($(KERNELRELEASE),)
81    include $(M)/$(DK_ROOT)/stad/build/linux/common.inc
82else
83    include $(DK_ROOT)/stad/build/linux/common.inc
84endif
85
86#
87# Location and filename of the driver .lib file.
88#
89DRIVER_LIB_DIR = $(DK_ROOT)/stad/build/linux
90DRIVER_LIB = $(DRIVER_LIB_DIR)/libestadrv.a
91
92#
93# Location and filename of the OS .lib file.
94#
95OS_COMMON_DIR = $(DK_ROOT)/platforms/os/common/build/linux
96OS_COMMON = $(OS_COMMON_DIR)/libuadrv.a
97
98#
99# Location and filename of the linux OS object file.
100#
101OS_LINUX_DIR = $(DK_ROOT)/platforms/os/linux/build
102OS_LINUX = $(OS_LINUX_DIR)/tiwlan_drv_stub.o
103OS_AUXILIARY_LIBS = ../$(DRIVER_LIB)\ ../$(OS_COMMON)
104
105#
106# Location and filename of the wlan user-mode programs root directory.
107#
108WLAN_CUDK_DIR = $(DK_ROOT)/CUDK
109
110#
111# Location and filename of the wlan configuraion utility CLI program.
112#
113WLAN_CU_CLI_DIR = $(DK_ROOT)/CUDK/configurationutility
114WLAN_CU_CLI = $(WLAN_CUDK_DIR)/output/wlan_cu
115
116#
117# Location and filename of the wlan logger utility program.
118#
119WLAN_LOGGER_DIR = $(DK_ROOT)/CUDK/logger
120WLAN_LOGGER = $(WLAN_CUDK_DIR)/output/wlan_logger
121
122#
123# Location and filename of the WLAN loader utility
124#
125WLAN_LOADER_DIR = $(DK_ROOT)/CUDK/tiwlan_loader/
126WLAN_LOADER = $(WLAN_CUDK_DIR)/output/tiwlan_loader
127
128#
129# Location and filename of the Linux Wireless Tools
130#
131
132#LINUX_WIRELESS_TOOLS_DIR = $(DK_ROOT)/CUDK/wireless_tools
133#LINUX_WIRELESS_TOOLS = $(LINUX_WIRELESS_TOOLS_DIR)/iwconfig
134
135#
136# The location of the supplicant depending on whether or not we rebuild it.
137#
138SUPPLICANT = $(WLAN_CUDK_DIR)/output/wpa_supplicant
139
140#
141# The combined linux module file.
142#
143OUTPUT_DIR = $(DK_ROOT)/platforms/os/linux
144OUTPUT_FILE = $(OUTPUT_DIR)/tiwlan_drv.ko
145
146##
147##
148## Build process
149##
150##
151
152#ifneq ($(KERNELRELEASE),)
153
154
155##
156##
157## This is the kernel build phase - set the appropriate arguments
158##
159##
160
161#
162# Intermediate object name - this should be renamed to the desired object name
163# after the kernel makefile finishes its work.
164#
165#       obj-m = linux.o
166
167#
168# List of object files the kernel makefile needs to compile.
169#
170#       linux-y = $(DRIVER_LIB) $(OS_COMMON) $(OS_LINUX)
171
172
173#else   # ifneq ($(KERNELRELEASE),)
174
175
176##
177##
178## This is the regular build phase - act according to the make actions
179##
180##
181
182#
183# The location of the kernel makefile
184#
185KERNEL_DIR ?=
186
187#
188# Dont use the original mkfs.jffs2 on TI's servers (voice.img won't work)
189#
190MAKEJFFS2 ?= /apps/crosstool/bin/mkfs.jffs2
191
192#
193# Used to check if the necessary packages are present.
194#
195HAVE_NONGPL = $(wildcard $(DRIVER_LIB_DIR)/Makefile)
196HAVE_GPL = $(wildcard $(OS_LINUX_DIR)/Makefile)
197#
198# Combines all the three components to create the driver.
199#
200HOST_PLATFORM ?= *UNDEFINED*
201ifeq "$(HOST_PLATFORM)" "omap2430"
202TARGET = apps.tar
203endif
204ifeq "$(HOST_PLATFORM)" "omap3430"
205TARGET = apps.tar
206endif
207ifeq "$(HOST_PLATFORM)" "zoom2"
208TARGET = apps.tar
209endif
210ifeq "$(HOST_PLATFORM)" "zoom1"
211TARGET = apps.tar
212endif
213ifeq "$(HOST_PLATFORM)" "sholes"
214TARGET = apps.tar
215endif
216#
217.PHONY: all
218all: verifypackages .depend $(TARGET)
219help:
220	@echo
221	@echo 'In order to select host platform one of the scripts: omap2430_env.tcsh or omap3430_env.tcsh must be run:'
222	@echo 'source omap2430_env.tcsh'
223	@echo 'or'
224	@echo 'source omap3430_env.tcsh'
225	@echo
226	@echo Default Compilation:
227	@echo ====================
228	@echo HOST_PLATFORM = $(HOST_PLATFORM)  // omap2430 or omap3430
229	@echo DEBUG = $(DEBUG) 			// Include debug prints and statistics
230	@echo INTR = $(INTR)
231	@echo WSPI = $(WSPI)
232	@echo XCC  = $(XCC)
233	@echo SUPPL  = $(SUPPL) 		// WPA or DEVICESCAPE
234	@echo FPGA1273 = $(FPGA1273)		// FPGA device support
235	@echo FULL_ASYNC = $(FULL_ASYNC)     	// Use only Asynchronous bus transactions
236	@echo USE_IRQ_ACTIVE_HIGH = $(USE_IRQ_ACTIVE_HIGH)      // Use IRQ polarity high
237	@echo TEST = $(TEST)		     	// Build also the bus test-driver
238	@echo BMTRACE = $(BMTRACE)		// Build also the bmtrace performance tool
239	@echo TARGET  = $(TARGET)
240	@echo ETH_SUPPORT = $(ETH_SUPPORT)
241	@echo
242	@echo EXTRA CFLAGS  = $(EXTRA_CFLAGS)
243	@echo
244#
245# Create the images
246#
247.PHONY: suppl.img voice.img apps.img apps.tar $(BUS_DRV)
248MODULES_LIST = tiwlan_drv.ko
249TAR_FILE = $(HOST_PLATFORM)Binaries.tar
250
251apps.tar: apps
252ifeq ($(STRIP),y)
253	@echo stripping...
254	cd $(OUTPUT_DIR) && $(CROSS_COMPILE)strip -g --strip-unneeded $(MODULES_LIST)
255#	cd $(DK_ROOT)/external_drivers/$(HOST_PLATFORM)/Linux/$(BUS_DRV) && $(CROSS_COMPILE)strip -g $(BUS_DRIVER_MODULE)
256endif
257
258
259
260apps.img: apps
261	mkcramfs apps apps.cram
262	mkimgti -t data -o apps.img apps.cram
263
264apps: $(OUTPUT_FILE)
265#	rm -f $(OUTPUT_DIR)/$(BUS_DRV_REMOVE).ko $(OUTPUT_DIR)/$(BUS_DRV_REMOVE)_test
266#	cp -f $(DK_ROOT)/external_drivers/$(HOST_PLATFORM)/Linux/$(BUS_DRV)/$(BUS_DRIVER_MODULE) $(OUTPUT_DIR)
267
268voice.img:
269	$(MAKEJFFS2) -l -r voice -e 0x10000 -o voice.jffs2
270	mkimgti -t data -o voice.img voice.jffs2
271
272suppl.img:
273ifeq ($(BUILD_SUPPL),y)
274	cp -f $(SUPPLICANT) .
275endif
276	mkcramfs suppl suppl.cram
277	mkimgti -t data -o suppl.img suppl.cram
278
279#
280# Recursively cleans the driver, OS, bus and CLI files
281#
282.PHONY: clean
283clean:
284	$(MAKE) -C $(DRIVER_LIB_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB) clean
285	$(MAKE) -C $(OS_COMMON_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB) clean
286	$(MAKE) -C $(OS_LINUX_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB) clean
287#	$(MAKE) -C $(DK_ROOT)/external_drivers/$(HOST_PLATFORM)/Linux/$(BUS_DRV) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) KERNEL_DIR=$(KERNEL_DIR) OUTPUT_DIR=$(shell pwd)/$(OUTPUT_DIR) clean
288#	$(MAKE) -C $(WLAN_CUDK_DIR) CROSS_COMPILE=$(CROSS_COMPILE) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) clean
289#       $(MAKE) -C $(WLAN_CU_CLI_DIR) CROSS_COMPILE=$(CROSS_COMPILE) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) cleanall
290#       $(MAKE) -C $(WLAN_LOADER_DIR) CROSS_COMPILE=$(CROSS_COMPILE) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) clean
291#       $(MAKE) -C $(LINUX_WIRELESS_TOOLS_DIR) CROSS_COMPILE=$(CROSS_COMPILE) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) clean
292#       $(MAKE) -C $(DBG_MDL) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) KERNEL_DIR=$(KERNEL_DIR) clean
293
294#	@rm -f suppl.* apps.* voice.*
295#	@rm -f *spi*.ko sdio.ko
296#	@rm -f $(OUTPUT_DIR)/wlan_cu
297	@rm -f $(OUTPUT_DIR)/tiwlan_drv.ko
298#	@rm -f wpa_supplicant
299#	@rm -f $(FW_IMAGE_DEST_FILE)
300#	@rm -rf *.o *.a \.*.o.cmd *~ *.~* core .depend dep
301
302#       @rm -f tiwlan_drv.ko $(OUTPUT_DIR)/gwsi_drv.o $(OUTPUT_DIR)/debug_tools.o
303#       @rm -rf $(OUTPUT_DIR)/iwconfig apps/iwlist $(OUTPUT_DIR)/iwevent
304
305# in order to remove all .*.o.cmd
306	@find ../../../. -type f -print | grep .o.cmd | xargs rm -f
307# in order to remove all *.order and *.symvers
308	@find ../../../. -type f -print | grep .order | xargs rm -f
309	@find ../../../. -type f -print | grep .symvers | xargs rm -f
310# in order to remove Module.markers file
311	@find ../../../. -type f -print | grep Module.markers | xargs rm -f
312# in order to remove the binaries tar
313#	@rm -rf $(TAR_FILE)
314
315
316#
317# Verifies that all necessary packages are present.
318#
319.PHONY: verifypackages
320verifypackages:
321ifeq ($(strip $(HAVE_GPL)),)
322	@echo "*** The GPL package does not seem to be present. You will need both the"
323	@echo "*** GPL package and the Non GPL package to execute this makefile."
324	exit 1
325endif
326
327ifeq ($(strip $(HAVE_NONGPL)),)
328	@echo "*** The Non GPL package does not seem to be present. You will need both the"
329	@echo "*** GPL package and the Non GPL package to execute this makefile."
330	exit 1
331endif
332
333
334# Builds the WSPI or SDIO driver
335#
336$(BUS_DRV):
337	$(MAKE) -C $(DK_ROOT)/external_drivers/$(HOST_PLATFORM)/Linux/$(BUS_DRV) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) KERNEL_DIR=$(KERNEL_DIR) OUTPUT_DIR=$(shell pwd)/$(OUTPUT_DIR) all
338
339
340#
341# Causes the driver and the configuration utility object files to get rebuilt
342#
343.depend:
344	rm -f $(OUTPUT_FILE) $(DRIVER_LIB) $(OS_COMMON) $(OS_LINUX) $(WLAN_CU_CLI) $(WLAN_LOADER) $(WLAN_LOGGER)
345
346
347#
348# Build the configuration utility; optionally rebuilds the supplicant
349#
350#$(SUPPLICANT): $(WLAN_CU_CLI)
351
352.PHONY: CU_DK
353CU_DK:
354#	$(MAKE) -C $(WLAN_CUDK_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) STATIC_LIB=$(STATIC_LIB) SG=$(SG) ETH_SUPPORT=$(ETH_SUPPORT)
355
356#$(WLAN_CU_CLI):
357#        $(MAKE) -C $(WLAN_CU_CLI_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) XCC=$(XCC) STATIC_LIB=$(STATIC_LIB) SG=$(SG)
358
359#$(LINUX_WIRELESS_TOOLS):
360#       $(MAKE) -C $(LINUX_WIRELESS_TOOLS_DIR) CROSS_COMPILE=$(CROSS_COMPILE)
361
362#$(WLAN_LOADER):
363#        $(MAKE) -C $(WLAN_LOADER_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) XCC=$(XCC) STATIC_LIB=$(STATIC_LIB) SG=$(SG)
364
365
366#
367# Recursively builds the driver lib file
368#
369$(DRIVER_LIB):
370	$(MAKE) -C $(DRIVER_LIB_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB)
371
372
373#
374# Recursively builds the OS lib file
375#
376$(OS_COMMON):
377	$(MAKE) -C $(OS_COMMON_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB) OS_AUXILIARY_LIBS+=../../$(DRIVER_LIB)
378
379
380#
381# Recursively builds the linux OS stub object file
382#
383$(OS_LINUX):
384	$(MAKE) -C $(OS_LINUX_DIR) CROSS_COMPILE=$(CROSS_COMPILE) DEBUG=$(DEBUG) BUILD_SUPPL=$(BUILD_SUPPL) SUPPL=$(SUPPL) WSPI=$(WSPI) INTR=$(INTR) XCC=$(XCC) INFO=$(INFO) STATIC_LIB=$(STATIC_LIB) OS_AUXILIARY_LIBS+=../$(DRIVER_LIB) OS_AUXILIARY_LIBS+=../$(OS_COMMON)
385
386
387#
388# Recursively builds the driver object file
389#
390$(OUTPUT_FILE): $(DRIVER_LIB) $(OS_COMMON) $(OS_LINUX)
391	mv $(OS_LINUX) $(OUTPUT_FILE)
392
393.PHONY: link
394link:
395	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
396	mv tiwlan_drv.ko $(OUTPUT_FILE)
397
398
399#
400# Builds the debug module object file
401#
402#$(DBG_MDL)/debug_module.ko:
403#       $(MAKE) -C $(DBG_MDL) KERNEL_DIR=$(KERNEL_DIR)
404#       mv $(DBG_MDL)/debug_module.ko $(OUTPUT_DIR)/debug_tools.o
405
406
407#
408# Not in use?
409#
410TAGS: $(SRCS)
411	{ find ${DK_ROOT}/common -name '*.h' -print ; \
412	  find . -name '*.h' -print ; } | etags -
413	  etags -a $(SRCS)
414
415CTAGS: $(SRCS)
416	find ${DK_ROOT} -iname '*.[ch]' -print | ctags --c++-types=+px --excmd=pattern -L -
417
418
419#endif  # ifneq ($(KERNELRELEASE),)
420