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)/$(DK_ROOT)/stad/build/linux/common.inc
18    include $(M)/$(DK_ROOT)/platforms/os/common/build/linux/os_sources.inc
19else
20    include $(DK_ROOT)/stad/build/linux/common.inc
21    include $(DK_ROOT)/platforms/os/common/build/linux/os_sources.inc
22endif
23
24
25#
26# List of platform independent OS files needed to be compiled
27#
28OS_SRCS = \
29    $(DK_ROOT)/platforms/os/common/src/osRgstry.c \
30    $(COMSRC)/Ctrl_Interface/CmdHndlr.c \
31
32ifeq ($(TI_TRACE_BUFFER),y)
33   OS_SRCS += $(DK_ROOT)/platforms/os/common/src/tracebuf.c
34endif
35
36OS_OBJS = $(patsubst %.c, %.o, $(OS_SRCS))
37
38#
39# OS include paths required for compilation.
40# 
41OS_INCS = $(DK_ROOT)/platforms/os/linux/inc $(DK_ROOT)/platforms/os/linux/src $(DK_ROOT)/platforms/os/common/inc
42
43#
44# Location and filename of the OS .lib file created by this makefile.
45#
46OUTPUT_DIR = $(DK_ROOT)/platforms/os/common/build/linux
47OUTPUT_FILE = $(OUTPUT_DIR)/libuadrv.a
48
49
50
51
52
53##
54##
55## Build process
56##
57##
58
59ifneq ($(KERNELRELEASE),)
60
61
62	##
63	##
64	## This is the kernel build phase - set the appropriate arguments
65    ##
66    ##
67
68	#
69	# Adds the current directory as a prefix to all include directories.
70	#
71	EXTRA_CFLAGS += $(addprefix -I$(M)/, $(OS_DK_INCS) $(OS_INCS))
72
73	#
74	# Intermediate object name - this should be converted to the appropriate library file
75	# after the kernel makefile finishes its work.
76	#
77	obj-m = tiwlan_drv.o
78
79	#
80	# List of object files the kernel makefile needs to compile.
81	#
82	tiwlan_drv-y = $(OS_OBJS) $(OS_AUXILIARY_LIBS)
83
84
85else	# ifneq ($(KERNELRELEASE),)
86
87
88##
89##
90## This is the regular build phase - act according to the make actions
91##
92##
93
94#
95# The location of the kernel makefile
96#
97KERNEL_DIR ?= 
98
99
100#
101# Build the OS lib file
102#
103.PHONY: all
104all: .depend $(OUTPUT_FILE)
105
106#
107# Prints variables
108#
109.PHONY: help
110help:
111	@echo Default Compilation:	PLATFORM=$(PLATFORM) DEBUG=$(DEBUG) INTR=$(INTR) WSPI=$(WSPI) XCC=$(XCC) EXTRA CFLAGS: $(EXTRA_CFLAGS)
112
113
114#
115# Recursively cleans the OS lib object files
116#
117.PHONY: clean
118clean:
119	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) clean
120	@rm -f *.o .*.o.cmd *~ *.a *.~* core .depend dep $(OS_OBJS)
121#
122# Causes the library file to get rebuilt
123#
124.depend:
125	rm -f $(OUTPUT_FILE)
126
127#
128# Recursively builds the library file
129#
130$(OUTPUT_FILE):
131	$(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
132	@$(CROSS_COMPILE)$(AR) rcs $@ $(OS_OBJS)
133
134
135endif	# ifneq ($(KERNELRELEASE),)
136