2
# Makefile for the Linux Wireless network device drivers.
4
# Original makefile by Peter Johanson
6
# NOTE: This make file can serve as both an external Makefile (launched
7
# directly by the user), or as the sub-dir Makefile used by the kernel
10
# If CONFIG_IPW* isn't set, we'll assume the user has never configured
11
# their kernel to include this module and set up some defaults.
13
# NOTE: If you have previously added the IPW project to your kernel
14
# and configured it for inclusion, these settings will be
15
# overridden by your kernel configuration.
19
CONFIG_IPW2200_DEBUG=y
22
# If you are not interested in using monitor mode, simply comment out:
24
# NOTE: If you have problems compiling due to IW_MODE_MONITOR not being
25
# defined then you need to update the wireless extension version
26
# installed in your kernel, or comment this line out.
27
CONFIG_IPW2200_MONITOR=y
29
# If you are interested in using radiotap headers in monitor mode,
32
# NOTE: To use RADIOTAP you must also enable MONITOR above.
33
#CONFIG_IPW2200_RADIOTAP=y
35
# The above monitor mode provides standard monitor mode. The following
36
# will create a new interface (named rtap%d) which will be sent all
37
# 802.11 frames received on the interface
39
# NOTE: To use PROMISCUOUS you must also enable MONITOR above.
40
#CONFIG_IPW2200_PROMISCUOUS=y
44
# We have to add drivers/net/wireless until ieee802_11.h is in the default
46
EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/wireless
48
ifeq ($(IEEE80211_INC),)
49
IEEE80211_INC := /lib/modules/$(shell uname -r)/include
50
IEEE80211_MODVERDIR=/lib/modules/$(KVER)/net/ieee80211/.tmp_versions
52
IEEE80211_MODVERDIR=$(IEEE80211_INC)/.tmp_versions
54
EXTRA_CFLAGS += -I$(IEEE80211_INC)
56
ifeq ($(CONFIG_IPW2200_DEBUG),y)
57
EXTRA_CFLAGS += -g -Wa,-adhlms=$@.lst
61
EXTRA_CFLAGS += -I$(KBUILD_EXTMOD) -DKBUILD_EXTMOD
65
list-$(CONFIG_IPW2200) += ipw2200
66
obj-$(CONFIG_IPW2200) += ipw2200.o
69
# Begin dual Makefile mode here. First we provide support for when we
70
# are being invoked by the kernel build system
72
ifneq ($(KERNELRELEASE),)
75
# If you receive a compile message about multiple definitions of
76
# CONFIG_IPW2200_DEBUG, then you have IPW* into the full kernel build, and
77
# these definitions are now being set up by the kernel build system.
80
# To correct this, remove any CONFIG_{IPW,IEEE80211}* lines from
81
# $(KSRC)/.config and $(KSRC)/include/linux/autoconf.h
84
EXTRA_CFLAGS += -DCONFIG_PM
86
ifeq ($(EXTERNAL_BUILD),y)
87
ifeq ($(CONFIG_IPW2200_DEBUG),y)
88
EXTRA_CFLAGS += -DCONFIG_IPW2200_DEBUG
90
ifeq ($(CONFIG_IPW2200_MONITOR),y)
91
EXTRA_CFLAGS += -DCONFIG_IPW2200_MONITOR
92
ifeq ($(CONFIG_IPW2200_RADIOTAP),y)
93
EXTRA_CFLAGS += -DCONFIG_IPW2200_RADIOTAP
95
ifeq ($(CONFIG_IPW2200_PROMISCUOUS),y)
96
EXTRA_CFLAGS += -DCONFIG_IPW2200_PROMISCUOUS
99
ifeq ($(CONFIG_IPW2200_QOS),y)
100
EXTRA_CFLAGS += -DCONFIG_IPW2200_QOS
105
# Here we begin the portion that is executed if the user invoked this Makefile
108
# KSRC should be set to the path to your sources
109
# modules are installed into KMISC
110
KVER := $(shell uname -r)
111
KSRC := /lib/modules/$(KVER)/build
112
KMISC := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
113
KMISC_INC := /lib/modules/$(KVER)/include
115
# KSRC_OUTPUT should be overridden if you are using a 2.6 kernel that
116
# has it's output sent elsewhere via KBUILD_OUTPUT= or O=
117
KSRC_OUTPUT := $(KSRC)
121
VERFILE := $(KSRC_OUTPUT)/include/linux/version.h
122
KERNELRELEASE := $(shell \
123
if [ -r $(VERFILE) ]; then \
124
(cat $(VERFILE); echo UTS_RELEASE) | \
125
$(CC) -I$(KSRC_OUTPUT) $(CFLAGS) -E - | \
132
MODPATH := $(DESTDIR)/lib/modules/$(KERNELRELEASE)
134
all: check_inc modules
137
@([ ! -e $(IEEE80211_INC)/net/ieee80211.h ] && \
139
"\n ERROR: ieee80211.h not found in '$(IEEE80211_INC)'.\n\n"\
140
"You need to install the ieee80211 subsystem from http://ieee80211.sf.net\n"\
141
"and point this build to the location where you installed those sources, eg.:\n\n"\
142
"% make IEEE80211_INC=/usr/src/ieee80211/\n\n"\
143
"will look for ieee80211.h in /usr/src/ieee80211/net/\n") || exit 0
144
@[ -e $(IEEE80211_INC)/net/ieee80211.h ]
147
rm -f *.mod.c *.mod *.o *.ko .*.cmd .*.flags .lst *.lst
148
rm -rf $(PWD)/tmp Modules.symvers Module.symvers
149
for file in *.{c,h}; do \
150
sed -i -e "s:\ *$$::g" -e "s:\t*$$::g" $$file; \
157
MODVERDIR=$(TMP)/.tmp_versions
160
mkdir -p $(MODVERDIR)
161
-@([ -f $(IEEE80211_MODVERDIR)/../Module.symvers ] && \
162
cp $(IEEE80211_MODVERDIR)/../Module.symvers $(PWD)) || \
163
([ -f $(IEEE80211_MODVERDIR)/../Modules.symvers ] && \
164
cp $(IEEE80211_MODVERDIR)/../Modules.symvers $(PWD)) || \
165
([ -f $(IEEE80211_MODVERDIR)/ieee80211.mod ] && \
166
cp $(IEEE80211_MODVERDIR)/*.mod $(MODVERDIR)) || true
167
$(MAKE) -C $(KSRC) M=$(PWD) MODVERDIR=$(MODVERDIR) modules
172
"\n This will install this IPW2200 driver into your\n"\
173
" kernel tree located here:\n"\
175
" If you would like to instal to a different location, run\n"\
176
" this as follows: make KSRC=/path/to/kernel patch_kernel \n"
177
@(read -p "Do you wish to continue? [Yn] " reply; \
180
*) echo "Terminating patch prcoess." ; exit 1 ;; \
182
@if [ "$(shell whoami)" != "root" ]; then \
184
"\nIf this fails, you may need to be root to patch the kernel.\n" ; \
186
@(grep -q "ipw2200" ${KSRC}/drivers/net/wireless/Makefile || \
188
"obj-\$$(CONFIG_IPW2200) += ipw2200.o" >> \
189
${KSRC}/drivers/net/wireless/Makefile)
190
@cp README.ipw2200 ${KSRC}/Documentation/networking
191
@cp ipw2200.{c,h} ${KSRC}/drivers/net/wireless
192
@cp compat.{c,h} ${KSRC}/drivers/net/wireless
193
@cp in-tree/Kconfig.ipw2200 ${KSRC}/drivers/net/wireless
194
@(grep -q "Kconfig\.ipw2200" ${KSRC}/drivers/net/wireless/Kconfig || \
195
grep -q "IPW2200" ${KSRC}/drivers/net/wireless/Kconfig || \
196
sed -i -e "s:^endmenu:source \"drivers/net/wireless/Kconfig.ipw2200\"\n\nendmenu:g" ${KSRC}/drivers/net/wireless/Kconfig)
197
@echo -e "Kernel has been udpated to include this ipw2200 driver.\n"
201
install -m 644 -c $(addsuffix .ko,$(list-m)) $(KMISC)
202
/sbin/depmod -a ${KVER}
203
@echo "Don't forget to copy firmware to your hotplug's firmware directory and have the "
204
@echo "hotplug tools in place."
205
@echo "See INSTALL for more information."
208
rm -rf $(addprefix $(KMISC),$(addsuffix .ko,$(list-m)))
209
/sbin/depmod -a ${KVER}
211
endif # End of internal build
214
.PHONY: TAGS tags check_inc
216
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o
218
( find . $(RCS_FIND_IGNORE) -name '*.[chS]' -print )
222
$(all-sources) | etags -
225
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
226
$(all-sources) | xargs ctags $$CTAGSF -a