summaryrefslogtreecommitdiff
path: root/sta_dk_4_0_4_32/Makefile
blob: 802a7fbd64aec0c7429610e07a64fc399f62bdb5 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
##
## Flags
##
export FIRMWARE_DYNAMIC_LOAD ?= y

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

#
# DK_ROOT must be set prior to including common.inc
#
DK_ROOT := .
ifeq ($(M),)
    M = drivers/net/wireless/tiwlan1251
endif
DK_ROOT_INC = $(M)

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

#
# OS include paths required for compilation.
# 
OS_INCS = $(DK_ROOT)/pform/linux/inc $(DK_ROOT)/pform/common/inc
OS_INCS += $(DK_ROOT)/common/src/core/EvHandler

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

OS_SRCS = \
    $(DK_ROOT)/pform/common/src/osCmd.c \
    $(DK_ROOT)/pform/common/src/osUtil.c \
    $(DK_ROOT)/pform/common/src/osClsfr.c \
    $(DK_ROOT)/pform/common/src/osRgstry.c \
    $(DK_ROOT)/pform/linux/src/esta_drv.c \
    $(DK_ROOT)/pform/linux/src/chip_stat.c \
    $(DK_ROOT)/pform/linux/src/mmc_tnetw1150_api.c \
    $(DK_ROOT)/pform/linux/src/tnetw_sdio.c \
    $(DK_ROOT)/pform/linux/src/osapi.c \
    $(DK_ROOT)/pform/linux/src/osmemapi.c \
    $(DK_ROOT)/pform/linux/src/env_tst.c \
    $(DK_ROOT)/pform/linux/src/ioctl_list.c \
    $(DK_ROOT)/pform/linux/src/ioctl_utils.c \
    $(DK_ROOT)/pform/linux/src/osRgstry_parser.c \
    $(DK_ROOT)/pform/linux/src/ipc_k.c \
    $(DK_ROOT)/pform/linux/src/proc_stat.c
    
ifeq ($(DRIVER_PROFILING),y)
    OS_SRCS += $(DK_ROOT)/pform/linux/src/tiwlan_profile.c
endif

ifeq ($(STACK_PROFILING_ON),y)
    OS_SRCS += $(DK_ROOT)/pform/linux/src/stack_profile.c
    EXTRA_CFLAGS += -D STACK_PROFILE
endif

ifeq ($(NO_ARCH_STRCMP),y)
    OS_SRCS += $(DK_ROOT)/pform/linux/src/string.c
endif
    
OS_OBJS = $(patsubst %.c, %.o, $(OS_SRCS))

#
# Remove debug info
#
EXTRA_LDFLAGS += --strip-debug

##
##
## 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$(DK_ROOT_INC)/, $(DK_INCS) $(OS_INCS))

	#
	# Intermediate object name - this should be converted to the appropriate library file
	# after the kernel makefile finishes its work.
	#
	obj-m += wlan.o
	
	#
	# List of object files the kernel makefile needs to compile.
	#
	wlan-objs := $(DK_OBJS) $(OS_OBJS)

	
else	# ifneq ($(KERNELRELEASE),)

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


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

#
# The location of the kernel makefile
#
KERNEL_DIR ?= /vobs/wlan_linux2.6/kernel-2.6/


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


#
# Prints variables
#
.PHONY: help
help:
	@echo Default Compilation:	BOARD=$(WIFI_BOARD) PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) INTR=$(INTR) WSPI=$(WSPI) EXC=$(EXC) 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 *~ *.~* core .depend dep $(DK_OBJS) $(OS_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) $(OS_OBJS)
	$(CROSS_COMPILE)strip --strip-unneeded wlan.ko

endif	# ifneq ($(KERNELRELEASE),)