]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/compat-wireless.git/blob - Makefile
Re-order patch location and compat code
[wl12xx/compat-wireless.git] / Makefile
1 export KMODDIR?=       updates
2 KMODDIR_ARG:=   "INSTALL_MOD_DIR=$(KMODDIR)"
3 ifneq ($(origin KLIB), undefined)
4 KMODPATH_ARG:=  "INSTALL_MOD_PATH=$(KLIB)"
5 else
6 export KLIB:=          /lib/modules/$(shell uname -r)
7 endif
8 export KLIB_BUILD ?=    $(KLIB)/build
9 # Sometimes not available in the path
10 MODPROBE := /sbin/modprobe
11 MADWIFI=$(shell $(MODPROBE) -l ath_pci)
12 OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
14 DESTDIR?=
16 ifneq ($(KERNELRELEASE),)
18 include $(M)/$(COMPAT_CONFIG)
20 NOSTDINC_FLAGS := -I$(M)/include/ -include $(M)/include/net/compat.h $(CFLAGS)
22 obj-y := \
23         compat/ \
24         net/rfkill/
25         net/bluetooth/ \
26         net/wireless/ net/mac80211/
28 ifeq ($(ONLY_CORE),)
29 obj-m += \
30         drivers/ssb/ \
31         drivers/misc/eeprom/ \
32         drivers/net/ \
33         drivers/net/usb/ \
34         drivers/net/wireless/ \
35         drivers/bluetooth/
36 endif
38 else
40 export PWD :=   $(shell pwd)
42 # These exported as they are used by the scripts
43 # to check config and compat autoconf
44 export COMPAT_CONFIG=config.mk
45 export CONFIG_CHECK=.$(COMPAT_CONFIG)_md5sum.txt
46 export COMPAT_AUTOCONF=include/linux/compat_autoconf.h
47 export CREL=$(shell cat $(PWD)/compat-release)
48 export CREL_PRE:=.compat_autoconf_
49 export CREL_CHECK:=$(CREL_PRE)$(CREL)
51 include $(PWD)/$(COMPAT_CONFIG)
53 all: modules
55 modules: $(CREL_CHECK)
56         @./scripts/check_config.sh
57         $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
58         @touch $@
60 # With the above and this we make sure we generate a new compat autoconf per
61 # new relase of compat-wireless-2.6 OR when the user updates the 
62 # $(COMPAT_CONFIG) file
63 $(CREL_CHECK):
64         @# Force to regenerate compat autoconf
65         @rm -f $(CONFIG_CHECK)
66         @./scripts/check_config.sh
67         @touch $@
68         @md5sum $(COMPAT_CONFIG) > $(CONFIG_CHECK)
70 install: uninstall install-modules install-scripts
72 install-modules: modules
73         $(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
74                 modules_install
75         @./scripts/update-initramfs
77 install-scripts:
78         @# All the scripts we can use
79         @mkdir -p $(DESTDIR)/usr/lib/compat-wireless/
80         @install scripts/modlib.sh      $(DESTDIR)/usr/lib/compat-wireless/
81         @install scripts/madwifi-unload $(DESTDIR)/usr/sbin/
82         @# This is to allow switching between drivers without blacklisting
83         @install scripts/athenable      $(DESTDIR)/usr/sbin/
84         @install scripts/b43enable      $(DESTDIR)/usr/sbin/
85         @install scripts/iwl-enable     $(DESTDIR)/usr/sbin/
86         @install scripts/athload        $(DESTDIR)/usr/sbin/
87         @install scripts/b43load        $(DESTDIR)/usr/sbin/
88         @install scripts/iwl-load       $(DESTDIR)/usr/sbin/
89         @if [ ! -z "$(MADWIFI)" ] && [ -z "$(DESTDIR)" ]; then \
90                 echo ;\
91                 echo -n "Note: madwifi detected, we're going to disable it. "  ;\
92                 echo "If you would like to enable it later you can run:"  ;\
93                 echo "    sudo athenable madwifi"  ;\
94                 echo ;\
95                 echo Running athenable ath5k...;\
96                 /usr/sbin/athenable ath5k ;\
97         fi
98         @if [ ! -z "$(OLD_IWL)" ] && [ -z "$(DESTDIR)" ]; then \
99                 echo ;\
100                 echo -n "Note: iwl4965 detected, we're going to disable it. "  ;\
101                 echo "If you would like to enable it later you can run:"  ;\
102                 echo "    sudo iwl-load iwl4965"  ;\
103                 echo ;\
104                 echo Running iwl-enable iwlagn...;\
105                 /usr/sbin/iwl-enable iwlagn ;\
106         fi
107         @# If on distributions like Mandriva which like to
108         @# compress their modules this will find out and do
109         @# it for you. Reason is some old version of modutils
110         @# won't know mac80211.ko should be used instead of
111         @# mac80211.ko.gz
112         @./scripts/compress_modules
113         @# Mandrake doesn't have a depmod.d/ conf file to prefer
114         @# the updates/ dir which is what we use so we add one for it
115         @# (or any other distribution that doens't have this).
116         @./scripts/check_depmod
117         @/sbin/depmod -ae
118         @echo
119         @echo "Currently detected wireless subsystem modules:"
120         @echo 
121         @$(MODPROBE) -l mac80211
122         @$(MODPROBE) -l cfg80211
123         @$(MODPROBE) -l lib80211
124         @$(MODPROBE) -l adm8211
125         @$(MODPROBE) -l ar9170usb
126         @$(MODPROBE) -l at76c50x-usb
127         @$(MODPROBE) -l ath
128         @$(MODPROBE) -l ath5k
129         @$(MODPROBE) -l ath9k
130         @$(MODPROBE) -l b43
131         @$(MODPROBE) -l b43legacy
132         @$(MODPROBE) -l b44
133         @$(MODPROBE) -l cdc_ether
134         @$(MODPROBE) -l eeprom_93cx6
135         @$(MODPROBE) -l ipw2100
136         @$(MODPROBE) -l ipw2200
137         @$(MODPROBE) -l iwl3945
138         @$(MODPROBE) -l iwlagn
139         @$(MODPROBE) -l iwlcore
140         @$(MODPROBE) -l lib80211_crypt_ccmp
141         @$(MODPROBE) -l lib80211_crypt_tkip
142         @$(MODPROBE) -l lib80211_crypt_wep
143         @$(MODPROBE) -l libertas
144         @$(MODPROBE) -l libertas_cs
145         @$(MODPROBE) -l libertas_sdio
146         @$(MODPROBE) -l libertas_spi
147         @$(MODPROBE) -l libertas_tf
148         @$(MODPROBE) -l libertas_tf_usb
149         @$(MODPROBE) -l libipw
150         @$(MODPROBE) -l mac80211_hwsim
151         @$(MODPROBE) -l mwl8k
152         @$(MODPROBE) -l p54common
153         @$(MODPROBE) -l p54pci
154         @$(MODPROBE) -l p54spi
155         @$(MODPROBE) -l p54usb
156         @$(MODPROBE) -l rndis_host
157         @$(MODPROBE) -l rndis_wlan
158         @$(MODPROBE) -l rt2400pci
159         @$(MODPROBE) -l rt2500pci
160         @$(MODPROBE) -l rt2500usb
161         @$(MODPROBE) -l rt2x00lib
162         @$(MODPROBE) -l rt2x00pci
163         @$(MODPROBE) -l rt2x00usb
164         @$(MODPROBE) -l rt61pci
165         @$(MODPROBE) -l rt73usb
166         @$(MODPROBE) -l rtl8180
167         @$(MODPROBE) -l rtl8187
168         @$(MODPROBE) -l ssb
169         @$(MODPROBE) -l usb8xxx
170         @$(MODPROBE) -l usbnet
171         @$(MODPROBE) -l zd1211rw
172         @echo
173         @echo "Currently detected bluetooth subsystem modules:"
174         @echo
175         @$(MODPROBE) -l sco
176         @$(MODPROBE) -l l2cap
177         @$(MODPROBE) -l hidp
178         @$(MODPROBE) -l rfcomm
179         @$(MODPROBE) -l bnep
180         @$(MODPROBE) -l btusb
181         @$(MODPROBE) -l bluetooth
182         @echo 
183         @echo Now run:
184         @echo 
185         @echo sudo make unload to unload both wireless and bluetooth modules
186         @echo sudo make wlunload to unload wireless modules
187         @echo sudo make btunload to unload bluetooth modules
188         @echo
189         @echo And then load the wireless or bluetooth module you need. If unsure reboot.
190         @echo Alternatively use "sudo make load/wlload/btload" to load modules
191         @echo
193 uninstall:
194         @# New location, matches upstream
195         @rm -rf $(KLIB)/$(KMODDIR)/net/mac80211/
196         @rm -rf $(KLIB)/$(KMODDIR)/net/rfkill/
197         @rm -rf $(KLIB)/$(KMODDIR)/net/wireless/
198         @rm -rf $(KLIB)/$(KMODDIR)/drivers/ssb/
199         @rm -rf $(KLIB)/$(KMODDIR)/drivers/net/usb/
200         @rm -rf $(KLIB)/$(KMODDIR)/drivers/net/wireless/
201         @# Lets only remove the stuff we are sure we are providing
202         @# on the misc directory.
203         @rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom/eeprom_93cx6.ko*
204         @rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom_93cx6.ko*
205         @rm -f $(KLIB)/$(KMODDIR)/drivers/net/b44.ko*
206         @/sbin/depmod -ae
207         @echo
208         @echo "Your old wireless subsystem modules were left intact:"
209         @echo 
210         @$(MODPROBE) -l mac80211
211         @$(MODPROBE) -l cfg80211
212         @$(MODPROBE) -l lib80211
213         @$(MODPROBE) -l adm8211
214         @$(MODPROBE) -l ar9170usb
215         @$(MODPROBE) -l at76c50x-usb
216         @$(MODPROBE) -l ath
217         @$(MODPROBE) -l ath5k
218         @$(MODPROBE) -l ath9k
219         @$(MODPROBE) -l b43
220         @$(MODPROBE) -l b43legacy
221         @$(MODPROBE) -l b44
222         @$(MODPROBE) -l cdc_ether
223         @$(MODPROBE) -l eeprom_93cx6
224         @$(MODPROBE) -l ipw2100
225         @$(MODPROBE) -l ipw2200
226         @$(MODPROBE) -l iwl3945
227         @$(MODPROBE) -l iwlagn
228         @$(MODPROBE) -l iwlcore
229         @$(MODPROBE) -l lib80211_crypt_ccmp
230         @$(MODPROBE) -l lib80211_crypt_tkip
231         @$(MODPROBE) -l lib80211_crypt_wep
232         @$(MODPROBE) -l libertas
233         @$(MODPROBE) -l libertas_cs
234         @$(MODPROBE) -l libertas_sdio
235         @$(MODPROBE) -l libertas_spi
236         @$(MODPROBE) -l libertas_tf
237         @$(MODPROBE) -l libertas_tf_usb
238         @$(MODPROBE) -l libipw
239         @$(MODPROBE) -l mac80211_hwsim
240         @$(MODPROBE) -l mwl8k
241         @$(MODPROBE) -l p54common
242         @$(MODPROBE) -l p54pci
243         @$(MODPROBE) -l p54spi
244         @$(MODPROBE) -l p54usb
245         @$(MODPROBE) -l rndis_host
246         @$(MODPROBE) -l rndis_wlan
247         @$(MODPROBE) -l rt2400pci
248         @$(MODPROBE) -l rt2500pci
249         @$(MODPROBE) -l rt2500usb
250         @$(MODPROBE) -l rt2x00lib
251         @$(MODPROBE) -l rt2x00pci
252         @$(MODPROBE) -l rt2x00usb
253         @$(MODPROBE) -l rt61pci
254         @$(MODPROBE) -l rt73usb
255         @$(MODPROBE) -l rtl8180
256         @$(MODPROBE) -l rtl8187
257         @$(MODPROBE) -l ssb
258         @$(MODPROBE) -l usb8xxx
259         @$(MODPROBE) -l usbnet
260         @$(MODPROBE) -l zd1211rw
261         @echo
262         @echo "Your old bluetooth subsystem modules were left intact:"
263         @echo
264         @$(MODPROBE) -l sco
265         @$(MODPROBE) -l l2cap
266         @$(MODPROBE) -l hidp
267         @$(MODPROBE) -l rfcomm
268         @$(MODPROBE) -l bnep
269         @$(MODPROBE) -l btusb
270         @$(MODPROBE) -l bluetooth
271         @
272         @echo 
274 clean:
275         @if [ -d net -a -d $(KLIB_BUILD) ]; then \
276                 $(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean ;\
277         fi
278         @rm -f $(CREL_PRE)*
279 unload:
280         @./scripts/unload.sh
282 load: unload
283         @./scripts/load.sh
285 btunload:
286         @./scripts/btunload.sh
288 btload: btunload
289         @./scripts/btload.sh
291 wlunload:
292         @./scripts/wlunload.sh
294 wlload: wlunload
295         @./scripts/wlload.sh
297 .PHONY: all clean install uninstall unload load btunload btload wlunload wlload
299 endif
301 clean-files += Module.symvers Module.markers modules modules.order
302 clean-files += $(CREL_CHECK) $(CONFIG_CHECK)