1
2##
3##
4## File lists and locations
5##
6##
7
8#
9# DK_ROOT must be set prior to including common.inc
10#
11DK_ROOT = ../../..
12
13#
14# Includes common definitions and source file list
15#
16ifneq ($(KERNELRELEASE),)
17    include $(M)/common.inc
18    include $(M)/drv_sources.inc
19else
20    include common.inc
21    include drv_sources.inc
22endif
23
24#
25# Include directory for Odyssey supplicant files
26#
27ifeq ($(BUILD_SUPPL),y)
28    ODD_INC = $(DK_ROOT)/CUDK/Supplicant/odyssey/odSupp/linux/inc 
29else
30    ODD_INC = 
31endif
32
33#
34# OS include paths required for compilation.
35# 
36OS_INCS = $(DK_ROOT)/platforms/os/linux/inc $(DK_ROOT)/platforms/os/common/inc
37#OS_INCS += $(DK_ROOT)/stad/src/core/EvHandler $(DK_ROOT)/Test $(DK_ROOT)/platforms/hw/host_platform_$(HOST_PLATFORM)/linux
38OS_INCS += $(DK_ROOT)/stad/src/core/EvHandler $(DK_ROOT)/Test $(DK_ROOT)/platforms/hw/linux
39
40#
41# Location and filename of the driver .lib file created by this makefile.
42#
43OUTPUT_DIR = $(DK_ROOT)/stad/build/linux
44OUTPUT_FILE = $(OUTPUT_DIR)/libestadrv.a
45
46
47
48
49
50##
51##
52## Build process
53##
54##
55
56ifneq ($(KERNELRELEASE),)
57
58
59##
60##
61## This is the kernel build phase - set the appropriate arguments
62##
63##
64
65#
66# Adds the current directory as a prefix to all include directories.
67#
68	EXTRA_CFLAGS += $(addprefix -I$(M)/, $(DK_INCS) $(OS_INCS) $(ODD_INC))
69
70#
71# Intermediate object name - this should be converted to the appropriate library file
72# after the kernel makefile finishes its work.
73#
74	obj-m = tiwlan_drv.o
75
76#
77# List of object files the kernel makefile needs to compile.
78#
79	tiwlan_drv-y = $(DK_OBJS)
80
81
82else	# ifneq ($(KERNELRELEASE),)
83
84
85##
86##
87## This is the regular build phase - act according to the make actions
88##
89##
90
91#
92# The location of the kernel makefile
93#
94KERNEL_DIR ?= 
95
96
97#
98# Build the driver lib file
99#
100.PHONY: all
101all: .depend $(OUTPUT_FILE)
102
103
104#
105# Prints variables
106#
107.PHONY: help
108help:
109	@echo Default Compilation:	PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) INTR=$(INTR) WSPI=$(WSPI) XCC=$(XCC) EXTRA CFLAGS: $(EXTRA_CFLAGS)
110#
111# Recursively cleans the driver files.
112#
113.PHONY: clean
114clean:
115	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) clean
116	@rm -f *.o *.a .*.o.cmd *~ *.~* core .depend dep $(DK_OBJS) $(DEPS)
117
118
119#
120# Causes the library file to get rebuilt.
121#
122.depend:
123	rm -f $(OUTPUT_FILE)
124#
125# Recursively builds the library file.
126#
127$(OUTPUT_FILE):
128	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
129	@$(CROSS_COMPILE)$(AR) rcs $@ $(DK_OBJS)
130
131
132endif	# ifneq ($(KERNELRELEASE),)
133