updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / rr231x_0x / kernel3.patch
blobf17e67f87bc10f61d52cc6d4ed1c36bf187e8eb7
1 --- src/rr231x_0x-linux-src-v2.5/inc/linux/Makefile.def.orig 2011-08-13 10:13:37.000000000 +0200
2 +++ src/rr231x_0x-linux-src-v2.5/inc/linux/Makefile.def 2011-08-13 11:15:53.000000000 +0200
3 @@ -74,19 +74,39 @@
4 KERNELDIR := /lib/modules/$(shell uname -r)/build
5 endif
7 -KERNEL_VER := 2.$(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
8 +KERNEL_MAJ_VER := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 65536 % 65536)
10 +KERNEL_VER := $(KERNEL_MAJ_VER).$(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
12 ifeq ($(KERNEL_VER),)
13 $(error Cannot find kernel version. Check $(KERNELDIR)/include/linux/version.h.)
14 endif
17 ifneq ($(KERNEL_VER), 2.6)
18 ifneq ($(KERNEL_VER), 2.4)
19 -$(error Only kernel 2.4/2.6 is supported but you use $(KERNEL_VER))
20 +ifneq ($(KERNEL_MAJ_VER), 3)
21 +$(error Only kernel 2.4/2.6/3 is supported but you use $(KERNEL_VER))
22 endif
23 endif
24 +endif
26 +ifeq ($(KERNEL_VER), 2.4)
28 +HPT_LIB := $(HPT_LIB)-regparm0
29 +_TARGETMODS := $(addprefix $(HPT_LIB)/,$(TARGETMODS))
31 +VPATH := .. $(HPT_ROOT)/osm/linux
32 +TARGET := $(TARGETNAME).o
34 +C_INCLUDES += -I$(HPT_ROOT)/osm/linux -I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/scsi
36 +$(TARGET): $(TARGETOBJS) $(_TARGETMODS)
37 + @echo $(if $V,,[LD] $@)
38 + $(if $V,,@)$(CROSS_COMPILE)$(LD) -r -o $@ $^
41 -ifeq ($(KERNEL_VER), 2.6)
42 +else # for kernel >= 2.6
44 TARGET := $(TARGETNAME).ko
46 @@ -119,20 +139,6 @@
47 @echo '$$(addprefix $$(obj)/,$$(TARGETMODS)): $$(obj)/%.o: $$(HPT_LIB)/%.o' >>$@
48 @echo ' @cp -f $$< $$@' >>$@
50 -else # for kernel 2.4 modules
52 -HPT_LIB := $(HPT_LIB)-regparm0
53 -_TARGETMODS := $(addprefix $(HPT_LIB)/,$(TARGETMODS))
55 -VPATH := .. $(HPT_ROOT)/osm/linux
56 -TARGET := $(TARGETNAME).o
58 -C_INCLUDES += -I$(HPT_ROOT)/osm/linux -I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/scsi
60 -$(TARGET): $(TARGETOBJS) $(_TARGETMODS)
61 - @echo $(if $V,,[LD] $@)
62 - $(if $V,,@)$(CROSS_COMPILE)$(LD) -r -o $@ $^
64 endif # KERNEL_VER
66 endif # KMOD