File: Makefile

package info (click to toggle)
rt2x00 0cvs20060928-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,580 kB
  • ctags: 4,930
  • sloc: ansic: 29,329; makefile: 241
file content (209 lines) | stat: -rw-r--r-- 5,453 bytes parent folder | download
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#	Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
#	<http://rt2x00.serialmonkey.com>
#
#	This program is free software; you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation; either version 2 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with this program; if not, write to the
#	Free Software Foundation, Inc.,
#	59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#	Module: Makefile
#	Abstract: Makefile for rt2x00 kernel module

#
# Set the enviroment variables.
#
ifndef SUBDIRS
	SUBDIRS=$(shell pwd)
endif

ifdef KERNDIR
	KERNEL_SOURCES := $(KERNDIR)
else
	KERNEL_SOURCES := /lib/modules/$(shell uname -r)/build
endif

ifdef KERNOUT
	KERNEL_OUTPUT := KBUILD_OUTPUT=$(KERNOUT)
else
	KERNEL_OUTPUT :=
endif

ifdef KBUILD_EXTMOD
	IEEE80211_DIR := $(KBUILD_EXTMOD)/ieee80211
	RFKILL_DIR := $(KBUILD_EXTMOD)/rfkill
	CRC_ITU_T_DIR := $(KBUILD_EXTMOD)/crc-itu-t
else
	IEEE80211_DIR := ieee80211
	RFKILL_DIR := rfkill
	CRC_ITU_T_DIR := /crc-itu-t
endif

#
# Include kernel and rt2x00 config.
#
include $(KERNEL_SOURCES)/.config
include $(SUBDIRS)/config

#
# Determine if and with what options the dscape stack should be build
#
80211-objs := \
	ieee80211/ieee80211.o \
	ieee80211/ieee80211_ioctl.o \
	ieee80211/ieee80211_scan.o \
	ieee80211/ieee80211_sta.o \
	ieee80211/ieee80211_dev.o \
	ieee80211/ieee80211_iface.o \
	ieee80211/ieee80211_sysfs.o \
	ieee80211/ieee80211_sysfs_sta.o \
	ieee80211/sta_info.o \
	ieee80211/wme.o \
	ieee80211/wep.o \
	ieee80211/wpa.o \
	ieee80211/michael.o \
	ieee80211/tkip.o \
	ieee80211/aes_ccm.o

ifeq ($(CONFIG_D80211_LEDS),y)
	80211-objs += ieee80211/ieee80211_led.o
endif

ifeq ($(CONFIG_NET_SCHED),)
	80211-objs += ieee80211/fifo_qdisc.o
endif

rate_control-objs := ieee80211/rate_control.o

ifeq ($(CONFIG_D80211),y)
	obj-m += 80211.o rate_control.o
ifeq ($(CONFIG_D80211_ASM),y)
	always += $(80211-objs:.o=.s) $(rate_control-objs:.o=.s)
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

#
# Determine if and with what options the crc-itu-t driver should be build
#
crc-itu-t-objs := crc-itu-t/crc-itu-t.o

ifeq ($(CONFIG_CRC_ITU_T),y)
	obj-m += crc-itu-t.o
ifeq ($(CONFIG_CRC_ITU_T_ASM),y)
	always += $(crc-itu-t-objs:.o=.s)
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

#
# Determine if and with what options the rfkill driver should be build
#
rfkill-objs := rfkill/rfkill.o

ifeq ($(CONFIG_RFKILL),y)
	obj-m += rfkill.o
ifeq ($(CONFIG_RFKILL_ASM),y)
	always += $(rfkill-objs:.o=.s)
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

#
# Determine which and with what options the drivers should be build
#
ifeq ($(CONFIG_RT2400PCI),y)
	obj-m += rt2400pci.o
ifeq ($(CONFIG_RT2400PCI_ASM),y)
	always += rt2400pci.s
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

ifeq ($(CONFIG_RT2500PCI),y)
	obj-m += rt2500pci.o
ifeq ($(CONFIG_RT2500PCI_ASM),y)
	always += rt2500pci.s
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

ifeq ($(CONFIG_RT2500USB),y)
	obj-m += rt2500usb.o
ifeq ($(CONFIG_RT2500USB_ASM),y)
	always += rt2500usb.s
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

ifeq ($(CONFIG_RT61PCI),y)
	obj-m += rt61pci.o
ifeq ($(CONFIG_RT61PCI_ASM),y)
	always += rt61pci.s
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

ifeq ($(CONFIG_RT73USB),y)
	obj-m += rt73usb.o
ifeq ($(CONFIG_RT73USB_ASM),y)
	always += rt73usb.s
	EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fverbose-asm
endif
endif

MAKEFLAGS += --no-print-directory
CFLAGS := -I$(IEEE80211_DIR) -I$(RFKILL_DIR) -I$(CRC_ITU_T_DIR) \
	-include $(SUBDIRS)/rt2x00_compat.h $(CFLAGS)
CPPFLAGS := -I$(IEEE80211_DIR) -I$(RFKILL_DIR) -I$(CRC_ITU_T_DIR) \
	-include $(SUBDIRS)/rt2x00_compat.h $(CPPFLAGS)

all: default

config_header:
	@if [ ! -f "rt2x00_config.h" ] || [ "rt2x00_config.h" -ot "config" ]; \
	then \
		awk -F = > rt2x00_config.h < config '/^CONFIG.*$\/ { \
			if($$2 == "y") { \
				print "#ifndef " $$1; \
				print "#define " $$1; \
				print "#endif"; \
				print "" \
			} else { \
				print "#undef " $$1; \
				print ""; \
			} \
		}'; \
	fi

default: config_header
	@$(MAKE) -C $(KERNEL_SOURCES) SUBDIRS=$(SUBDIRS) $(KERNEL_OUTPUT) \
		modules

install: config_header
	@$(MAKE) -C $(KERNEL_SOURCES) SUBDIRS=$(SUBDIRS) $(KERNEL_OUTPUT) \
		INSTALL_MOD_DIR=rt2x00 $(KERNEL_OUTPUT) modules_install
	/sbin/depmod -a

clean:
	@rm -f rt2x00_config.h
	@rm -f Modules.symvers
	@rm -f *.o ieee80211/*.o rfkill/*.o crc-itu-t/*.o
	@rm -f *.ko ieee80211/*.ko rfkill/*.ko crc-itu-t/*.ko
	@rm -f *.s ieee80211/*.s rfkill/*.s crc-itu-t/*.s
	@rm -f *.mod.c ieee80211/*.mod.c rfkill/*.mod.c crc-itu-t/*.mod.c
	@rm -f *~ ieee80211/*~ ieee80211/net/*~ rfkill/*~ rfkill/linux/*~ crc-itu-t/*~ crc-itu-t/linux/*~
	@rm -f .*.cmd ieee80211/.*.cmd rfkill/.*.cmd crc-itu-t/.*.cmd
	@rm -f .*.flags ieee80211/.*.flags rfkill/.*.flags crc-itu-t/.*.flags
	@rm -f .*.o.d ieee80211/.*.o.d rfkill/.*.o.d crc-itu-t/.*.o.d
	@rm -f .*.s.d ieee80211/.*.s.d rfkill/.*.s.d crc-itu-t/.*.s.d
	@rm -fr .tmp_versions ieee80211/.tmp_versions rfkill/.tmp_versions crc-itu-t/.tmp_versions