Makefile (1888B)
1 # changelog : 2 #------------ 3 # naresh - 29-Mar-2007 : cyan_00391 4 # fixed the code which detects the existing kernel module 5 # 6 # Notes: 7 # ----------- 8 # This clever makefile was shamelessly copied from the ivtv project. 9 # 10 # By default, the build is done against the running kernel version. 11 # to build against a different kernel version, set KVER 12 # 13 # make KVER=2.6.11-alpha 14 # 15 # Alternatively, set KDIR 16 # 17 # make KDIR=/usr/src/linux 18 19 V ?= 0 20 MDIR := extra 21 22 KVER ?= $(shell uname -r) 23 KDIR ?= /lib/modules/$(KVER)/build 24 FWDIR ?= /lib/firmware 25 26 # Old module name to detect and complain about when installing 27 OLD_MODULE_NM = ry5u870.ko 28 29 FWFILES = r5u870_1830.fw r5u870_1832.fw r5u870_1833.fw r5u870_1834.fw r5u870_1835.fw r5u870_1836.fw r5u870_1870_1.fw r5u870_1870.fw r5u870_1810.fw r5u870_183a.fw r5u870_183b.fw r5u870_1839.fw r5u870_1841.fw 30 31 ifneq ($(KERNELRELEASE),) 32 include $(src)/Kbuild 33 else 34 35 all:: 36 $(MAKE) -C $(KDIR) M=$(CURDIR) V=$(V) modules 37 38 install:: all 39 $(MAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=$(MDIR) \ 40 -C $(KDIR) M=$(CURDIR) modules_install 41 42 clean:: 43 $(MAKE) -C $(KDIR) M=$(CURDIR) clean 44 rm -f Module.symvers 45 46 endif 47 48 install:: 49 install -m 0644 -o root -g root $(FWFILES) $(FWDIR) 50 /sbin/depmod -a 51 @if find /lib/modules -name $(OLD_MODULE_NM) | grep $(OLD_MODULE_NM) >/dev/null; then \ 52 echo; \ 53 echo "*** !!! WARNING !!! ***"; \ 54 echo "A prior version of this driver was detected, installed with a different file"; \ 55 echo "name. It is possible that a boot-time device detection component will choose"; \ 56 echo "to load the older version of this driver instead of the newly installed"; \ 57 echo "version."; \ 58 echo; \ 59 echo "Please consider deleting the following files:"; \ 60 echo; \ 61 find /lib/modules -name $(OLD_MODULE_NM); \ 62 echo; \ 63 echo "*** !!! WARNING !!! ***"; \ 64 echo; \ 65 printf "\\a"; sleep 1; printf "\\a"; sleep 1; printf "\\a"; \ 66 fi