summaryrefslogtreecommitdiff
path: root/wl1271/stad/build/linux/Makefile
blob: e98697ecc25ca63f111bfe8748587ebee7cfe129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

##
##
## File lists and locations
##
##

#
# DK_ROOT must be set prior to including common.inc
#
DK_ROOT = ../../..

#
# Includes common definitions and source file list
#
ifneq ($(KERNELRELEASE),)
    include $(M)/common.inc
    include $(M)/drv_sources.inc
else
    include common.inc
    include drv_sources.inc
endif

#
# Include directory for Odyssey supplicant files
#
ifeq ($(BUILD_SUPPL),y)
    ODD_INC = $(DK_ROOT)/CUDK/Supplicant/odyssey/odSupp/linux/inc 
else
    ODD_INC = 
endif

#
# OS include paths required for compilation.
# 
OS_INCS = $(DK_ROOT)/platforms/os/linux/inc $(DK_ROOT)/platforms/os/common/inc
#OS_INCS += $(DK_ROOT)/stad/src/core/EvHandler $(DK_ROOT)/Test $(DK_ROOT)/platforms/hw/host_platform_$(HOST_PLATFORM)/linux
OS_INCS += $(DK_ROOT)/stad/src/core/EvHandler $(DK_ROOT)/Test $(DK_ROOT)/platforms/hw/linux

#
# Location and filename of the driver .lib file created by this makefile.
#
OUTPUT_DIR = $(DK_ROOT)/stad/build/linux
OUTPUT_FILE = $(OUTPUT_DIR)/libestadrv.a





##
##
## Build process
##
##

ifneq ($(KERNELRELEASE),)


##
##
## This is the kernel build phase - set the appropriate arguments
##
##

#
# Adds the current directory as a prefix to all include directories.
#
	EXTRA_CFLAGS += $(addprefix -I$(M)/, $(DK_INCS) $(OS_INCS) $(ODD_INC))

#
# Intermediate object name - this should be converted to the appropriate library file
# after the kernel makefile finishes its work.
#
	obj-m = tiwlan_drv.o

#
# List of object files the kernel makefile needs to compile.
#
	tiwlan_drv-y = $(DK_OBJS)


else	# ifneq ($(KERNELRELEASE),)


##
##
## This is the regular build phase - act according to the make actions
##
##

#
# The location of the kernel makefile
#
KERNEL_DIR ?= 


#
# Build the driver lib file
#
.PHONY: all
all: .depend $(OUTPUT_FILE)


#
# Prints variables
#
.PHONY: help
help:
	@echo Default Compilation:	PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) INTR=$(INTR) WSPI=$(WSPI) XCC=$(XCC) EXTRA CFLAGS: $(EXTRA_CFLAGS)
#
# Recursively cleans the driver files.
#
.PHONY: clean
clean:
	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) clean
	@rm -f *.o *.a .*.o.cmd *~ *.~* core .depend dep $(DK_OBJS) $(DEPS)


#
# Causes the library file to get rebuilt.
#
.depend:
	rm -f $(OUTPUT_FILE)
#
# Recursively builds the library file.
#
$(OUTPUT_FILE):
	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
	@$(CROSS_COMPILE)$(AR) rcs $@ $(DK_OBJS)


endif	# ifneq ($(KERNELRELEASE),)