Upgrade rt2x00 to a more recent snapshot, master mode now working, thanks to Daniel...
[openwrt.git] / package / rt2x00 / src / Makefile
1 # Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
2 # <http://rt2x00.serialmonkey.com>
3 #
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.
8 #
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.
13 #
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.
18
19 # Module: Makefile
20 # Abstract: Makefile for rt2x00 kernel module
21
22 #
23 # Set the enviroment variables.
24 #
25 ifndef SUBDIRS
26 SUBDIRS=$(shell pwd)
27 endif
28
29 ifdef KERNDIR
30 KERNEL_SOURCES := $(KERNDIR)
31 else
32 KERNEL_SOURCES := /lib/modules/$(shell uname -r)/build
33 endif
34
35 ifdef KERNOUT
36 KERNEL_OUTPUT := KBUILD_OUTPUT=$(KERNOUT)
37 else
38 KERNEL_OUTPUT :=
39 endif
40
41 #
42 # Include kernel and rt2x00 config.
43 #
44 include $(KERNEL_SOURCES)/.config
45 include $(SUBDIRS)/config
46
47 #
48 # Determine if and with what options the rt2x00 drivers should be build
49 #
50 rt2x00lib-objs := rt2x00dev.o rt2x00mac.o
51
52 ifeq ($(CONFIG_RT2X00),y)
53
54 ifeq ($(CONFIG_RT2X00_LIB_DEBUGFS),y)
55 rt2x00lib-objs += rt2x00debug.o
56 endif
57
58 ifeq ($(CONFIG_RT2400PCI),y)
59 obj-m += rt2400pci.o rt2x00pci.o rt2x00lib.o
60 ifeq ($(CONFIG_RT2400PCI_RFKILL),y)
61 rt2x00lib-objs += rt2x00rfkill.o
62 CFLAGS += -DCONFIG_RT2X00_LIB_RFKILL
63 endif
64 endif
65
66 ifeq ($(CONFIG_RT2500PCI),y)
67 obj-m += rt2500pci.o rt2x00pci.o rt2x00lib.o
68 ifeq ($(CONFIG_RT2500PCI_RFKILL),y)
69 rt2x00lib-objs += rt2x00rfkill.o
70 CFLAGS += -DCONFIG_RT2X00_LIB_RFKILL
71 endif
72 endif
73
74 ifeq ($(CONFIG_RT2500USB),y)
75 obj-m += rt2500usb.o rt2x00usb.o rt2x00lib.o
76 endif
77
78 ifeq ($(CONFIG_RT61PCI),y)
79 CFLAGS += -DCONFIG_RT2X00_LIB_FIRMWARE
80 rt2x00lib-objs += rt2x00firmware.o
81 obj-m += rt61pci.o rt2x00pci.o rt2x00lib.o
82 ifeq ($(CONFIG_RT61PCI_RFKILL),y)
83 rt2x00lib-objs += rt2x00rfkill.o
84 CFLAGS += -DCONFIG_RT2X00_LIB_RFKILL
85 endif
86 endif
87
88 ifeq ($(CONFIG_RT73USB),y)
89 CFLAGS += -DCONFIG_RT2X00_LIB_FIRMWARE
90 rt2x00lib-objs += rt2x00firmware.o
91 obj-m += rt73usb.o rt2x00usb.o rt2x00lib.o
92 endif
93
94 endif
95
96 MAKEFLAGS += --no-print-directory
97 CFLAGS := -include $(SUBDIRS)/rt2x00_compat.h $(CFLAGS)
98
99 all: default
100
101 config_header:
102 @if [ ! -f "rt2x00_config.h" ] || [ "rt2x00_config.h" -ot "config" ]; \
103 then \
104 awk -F = > rt2x00_config.h < config '/^CONFIG.*$\/ \
105 { \
106 if($$2 == "y") { \
107 print "#ifndef " $$1; \
108 print "#define " $$1; \
109 print "#endif"; \
110 print "" \
111 } else { \
112 print "#undef " $$1; \
113 print ""; \
114 } \
115 }'; \
116 fi
117
118 default: config_header
119 @$(MAKE) -C $(KERNEL_SOURCES) SUBDIRS=$(SUBDIRS) $(KERNEL_OUTPUT) \
120 modules
121
122 sparse: config_header
123 @$(MAKE) -C $(KERNEL_SOURCES) SUBDIRS=$(SUBDIRS) $(KERNEL_OUTPUT) \
124 modules C=1 CF=-D__CHECK_ENDIAN__
125
126 install: config_header
127 @$(MAKE) -C $(KERNEL_SOURCES) SUBDIRS=$(SUBDIRS) $(KERNEL_OUTPUT) \
128 INSTALL_MOD_DIR=rt2x00 $(KERNEL_OUTPUT) modules_install
129 /sbin/depmod -a
130
131 clean:
132 @rm -f rt2x00_config.h
133 @rm -f Modules.symvers Module.symvers
134 @for folder in $(EXTMODDIRS); \
135 do \
136 rm -f $${folder}/*.o \
137 rm -f $${folder}/*.ko \
138 rm -f $${folder}/*.s \
139 rm -f $${folder}/*.mod.c \
140 rm -f $${folder}/.*.cmd \
141 rm -f $${folder}/.*.flags \
142 rm -f $${folder}/.*.o.d \
143 rm -f $${folder}/.*.s.d \
144 rm -f $${folder}/.#* \
145 rm -f $${folder}/*~ \
146 rm -fr $${folder}/.tmp_versions; \
147 done
This page took 0.05703 seconds and 5 git commands to generate.