1 # Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
2 # <http://rt2x00.serialmonkey.com>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the
16 # Free Software Foundation, Inc.,
17 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # Abstract: Makefile for rt2x00 kernel module
23 # Set the enviroment variables.
30 KERNEL_SOURCES
:= $(KERNDIR
)
32 KERNEL_SOURCES
:= /lib
/modules
/$(shell uname
-r
)/build
36 KERNEL_OUTPUT
:= KBUILD_OUTPUT
=$(KERNOUT
)
42 # Determine if and with what options the rt2x00 drivers should be build
44 rt2x00lib-objs
:= rt2x00dev.o rt2x00mac.o rt2x00config.o rt2x00firmware.o
46 ifeq ($(CONFIG_RT2X00
),y
)
49 ifeq ($(CONFIG_RT2X00PCI
),y
)
53 ifeq ($(CONFIG_RT2X00USB
),y
)
57 ifeq ($(CONFIG_RT2X00_LIB_DEBUGFS
),y
)
58 rt2x00lib-objs
+= rt2x00debug.o
61 ifeq ($(CONFIG_RT2400PCI
),y
)
63 ifeq ($(CONFIG_RT2400PCI_RFKILL
),y
)
64 rt2x00lib-objs
+= rt2x00rfkill.o
65 EXTRA_CFLAGS
+= -DCONFIG_RT2X00_LIB_RFKILL
69 ifeq ($(CONFIG_RT2500PCI
),y
)
71 ifeq ($(CONFIG_RT2500PCI_RFKILL
),y
)
72 rt2x00lib-objs
+= rt2x00rfkill.o
73 EXTRA_CFLAGS
+= -DCONFIG_RT2X00_LIB_RFKILL
77 ifeq ($(CONFIG_RT2500USB
),y
)
81 ifeq ($(CONFIG_RT61PCI
),y
)
82 EXTRA_CFLAGS
+= -DCONFIG_RT2X00_LIB_FIRMWARE
83 rt2x00lib-objs
+= rt2x00firmware.o
85 ifeq ($(CONFIG_RT61PCI_RFKILL
),y
)
86 rt2x00lib-objs
+= rt2x00rfkill.o
87 EXTRA_CFLAGS
+= -DCONFIG_RT2X00_LIB_RFKILL
91 ifeq ($(CONFIG_RT73USB
),y
)
92 EXTRA_CFLAGS
+= -DCONFIG_RT2X00_LIB_FIRMWARE
93 rt2x00lib-objs
+= rt2x00firmware.o
99 MAKEFLAGS
+= --no-print-directory
100 EXTRA_CFLAGS
:= -include $(SUBDIRS
)/rt2x00_compat.h
$(CFLAGS
)
105 @if
[ ! -f
"rt2x00_config.h" ] ||
[ "rt2x00_config.h" -ot
"config" ]; \
107 awk
-F
= > rt2x00_config.h
< config
'/^CONFIG.*$\/ \
110 print "#ifndef " $$1; \
111 print "#define " $$1; \
115 print "#undef " $$1; \
121 default
: config_header
122 @
$(MAKE
) -C
$(KERNEL_SOURCES
) SUBDIRS
=$(SUBDIRS
) $(KERNEL_OUTPUT
) \
125 sparse
: config_header
126 @
$(MAKE
) -C
$(KERNEL_SOURCES
) SUBDIRS
=$(SUBDIRS
) $(KERNEL_OUTPUT
) \
127 modules C
=1 CF
=-D__CHECK_ENDIAN__
129 install: config_header
130 @
$(MAKE
) -C
$(KERNEL_SOURCES
) SUBDIRS
=$(SUBDIRS
) $(KERNEL_OUTPUT
) \
131 INSTALL_MOD_DIR
=rt2x00
$(KERNEL_OUTPUT
) modules_install
135 @
rm -f rt2x00_config.h
136 @
rm -f Modules.symvers Module.symvers
137 @for folder in
$(EXTMODDIRS
); \
139 rm -f
$${folder}/*.o \
140 rm -f
$${folder}/*.ko \
141 rm -f
$${folder}/*.s \
142 rm -f
$${folder}/*.mod.c \
143 rm -f
$${folder}/.
*.cmd \
144 rm -f
$${folder}/.
*.flags \
145 rm -f
$${folder}/.
*.o.d \
146 rm -f
$${folder}/.
*.s.d \
147 rm -f
$${folder}/.
#* \
148 rm -f
$${folder}/*~ \
149 rm -fr
$${folder}/.tmp_versions
; \