Lines 1-6
Link Here
|
1 |
VERSION = 0.50 |
1 |
VERSION = 0.50 |
2 |
CVSVERSION = "$Experimental work Michel Xhaard && Reza Jelveh 03/02/2004" |
2 |
CVSVERSION = "$Experimental work Michel Xhaard && Reza Jelveh 03/02/2004" |
3 |
DEFINES = |
3 |
DEFINES = |
|
|
4 |
KERNEL_VERSION := `uname -r` |
4 |
|
5 |
|
5 |
### |
6 |
### |
6 |
# The following flags enable experimental features. |
7 |
# The following flags enable experimental features. |
Lines 45-51
Link Here
|
45 |
DEFINES += -DCONFIG_USB_SPCA50X_MODULE=1 -DMODULE -D__KERNEL__ |
46 |
DEFINES += -DCONFIG_USB_SPCA50X_MODULE=1 -DMODULE -D__KERNEL__ |
46 |
DEFINES += -DVID_HARDWARE_SPCA50X=0xFF -DSPCA50X_VERSION=\"$(VERSION)\" |
47 |
DEFINES += -DVID_HARDWARE_SPCA50X=0xFF -DSPCA50X_VERSION=\"$(VERSION)\" |
47 |
|
48 |
|
48 |
ifneq ($(shell uname -r | cut -d. -f1,2), 2.4) |
49 |
ifneq ($(shell echo $(KERNEL_VERSION) | cut -d. -f1,2), 2.4) |
49 |
|
50 |
|
50 |
ifneq ($(KERNELRELEASE),) # We were called by kbuild |
51 |
ifneq ($(KERNELRELEASE),) # We were called by kbuild |
51 |
CFLAGS += $(DEFINES) |
52 |
CFLAGS += $(DEFINES) |
Lines 54-60
Link Here
|
54 |
|
55 |
|
55 |
else # We were called from command line |
56 |
else # We were called from command line |
56 |
|
57 |
|
57 |
KERNEL_VERSION = `uname -r` |
|
|
58 |
KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build |
58 |
KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build |
59 |
PWD := $(shell pwd) |
59 |
PWD := $(shell pwd) |
60 |
MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/media/ |
60 |
MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/media/ |
Lines 64-70
Link Here
|
64 |
@echo ' Building SPCA5XX driver for 2.5/2.6 kernel.' |
64 |
@echo ' Building SPCA5XX driver for 2.5/2.6 kernel.' |
65 |
@echo ' PLEASE IGNORE THE "Overriding SUBDIRS" WARNING' |
65 |
@echo ' PLEASE IGNORE THE "Overriding SUBDIRS" WARNING' |
66 |
@echo ' Remember: you must have read/write access to your kernel source tree.' |
66 |
@echo ' Remember: you must have read/write access to your kernel source tree.' |
67 |
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules |
67 |
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules KERNEL_VERSION=$(KERNEL_VERSION) |
68 |
|
68 |
|
69 |
install: |
69 |
install: |
70 |
install -c -m 0644 spca50x.ko $(MODULE_INSTALLDIR) |
70 |
install -c -m 0644 spca50x.ko $(MODULE_INSTALLDIR) |
Lines 89-96
Link Here
|
89 |
# source tree. It makes it easier to swap kernels. |
89 |
# source tree. It makes it easier to swap kernels. |
90 |
|
90 |
|
91 |
|
91 |
|
92 |
KERNEL_VERSION = `uname -r` |
|
|
93 |
|
94 |
### |
92 |
### |
95 |
# Location of the header files (most importantly the config files) |
93 |
# Location of the header files (most importantly the config files) |
96 |
# for the kernel you want to build the module against. |
94 |
# for the kernel you want to build the module against. |
Lines 167-174
Link Here
|
167 |
|
165 |
|
168 |
install-root: |
166 |
install-root: |
169 |
@echo Installing.. |
167 |
@echo Installing.. |
170 |
@mkdir -p /lib/modules/`uname -r`/kernel/drivers/usb |
168 |
@mkdir -p /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb |
171 |
@cp spca50x.o /lib/modules/`uname -r`/kernel/drivers/usb/spca50x.o |
169 |
@cp spca50x.o /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/spca50x.o |
172 |
@/sbin/depmod |
170 |
@/sbin/depmod |
173 |
|
171 |
|
174 |
dist: clean binary |
172 |
dist: clean binary |