COMPAT_LATEST_VERSION = 32
KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
COMPAT_VERSIONS := $(shell I=$(COMPAT_LATEST_VERSION); while [ "$$I" -gt $(KERNEL_SUBLEVEL) ]; do echo $$I; I=$$(($$I - 1)); done)
-$(foreach ver,$(COMPAT_VERSIONS),$(eval CONFIG_COMPAT_KERNEL_$(ver)=y))
+$(foreach ver,$(COMPAT_VERSIONS),$(eval export CONFIG_COMPAT_KERNEL_$(ver)=y))
endif
obj-y += compat/
# This hack lets us put our include path first than the kernel's
# when building our compat modules. Your own makefile would look
# the same.
-NOSTDINC_FLAGS := -I$(M)/include/ -include $(M)/include/linux/compat.h $(CFLAGS)
+NOSTDINC_FLAGS := -I$(M)/include/ -include $(M)/include/linux/compat-2.6.h $(CFLAGS)
modules:
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean
all: modules
-clean-files := Module.symvers modules.order Module.markers
+clean-files := Module.symvers modules.order Module.markers compat/modules.order