1 --- inc/linux/Makefile.def.orig 2011-12-09 12:07:33.666795160 +0100
2 +++ inc/linux/Makefile.def 2011-12-09 12:10:10.243467698 +0100
4 KERNELDIR := /lib/modules/$(shell uname -r)/build
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)
13 $(error Cannot find kernel version. Check $(KERNELDIR)/include/linux/version.h.)
16 ifneq ($(KERNEL_VER), 2.6)
17 ifneq ($(KERNEL_VER), 2.4)
18 -$(error Only kernel 2.4/2.6 is supported but you use $(KERNEL_VER))
19 +ifneq ($(KERNEL_MAJ_VER), 3)
20 +$(error Only kernel 2.4/2.6/3 is supported but you use $(KERNEL_VER))
25 -ifeq ($(KERNEL_VER), 2.6)
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 $@ $^
40 +else # for kernel >= 2.6
42 TARGET := $(TARGETNAME).ko
45 @echo '$$(addprefix $$(obj)/,$$(TARGETMODS)): $$(obj)/%.o: $$(HPT_LIB)/%.o' >>$@
46 @echo ' @cp -f $$< $$@' >>$@
48 -else # for kernel 2.4 modules
50 -HPT_LIB := $(HPT_LIB)-regparm0
51 -_TARGETMODS := $(addprefix $(HPT_LIB)/,$(TARGETMODS))
53 -VPATH := .. $(HPT_ROOT)/osm/linux
54 -TARGET := $(TARGETNAME).o
56 -C_INCLUDES += -I$(HPT_ROOT)/osm/linux -I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/scsi
58 -$(TARGET): $(TARGETOBJS) $(_TARGETMODS)
59 - @echo $(if $V,,[LD] $@)
60 - $(if $V,,@)$(CROSS_COMPILE)$(LD) -r -o $@ $^