]> git.openfabrics.org - ~aditr/compat.git/commitdiff
compat: avoid NOSTDINC_FLAGS during modpost
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Sat, 25 Feb 2012 03:40:22 +0000 (19:40 -0800)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Sat, 25 Feb 2012 03:40:22 +0000 (19:40 -0800)
modpost, the second part of module building, does not
use NOSTDINC_FLAGS and friends so all the hackery we did
to use it to prefer our header files and include compat-2.6.h
will not work during modpost for older kernels. We don't really
need all that stuff during modpost even for newer kernels so
just avoid it all together.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Makefile

index fdcff5c721aec17a8e6f5818499c74e548ecb280..d96d098092212cba7aa497edfedea301babc4aa0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,22 @@ export COMPAT_BASE_TREE := "linux-next.git"
 # working with.
 export COMPAT_BASE_TREE_VERSION := "next-20100517"
 export COMPAT_VERSION := $(shell git describe)
+
+else
+# By stuffing this hear we avoid using
+# this hackery on modpost, the 2nd section of module building.
+#
+# 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-2.6.h \
+       $(CFLAGS) \
+       -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \
+       -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \
+       -DCOMPAT_PROJECT="\"Generic kernel\"" \
+       -DCOMPAT_VERSION="\"$(COMPAT_VERSION)\""
+
 endif
 
 # to check config and compat autoconf
@@ -31,17 +47,6 @@ export MAKE
 
 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-2.6.h \
-       $(CFLAGS) \
-       -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \
-       -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \
-       -DCOMPAT_PROJECT="\"Generic kernel\"" \
-       -DCOMPAT_VERSION="\"$(COMPAT_VERSION)\""
-
 all: $(COMPAT_CONFIG)
 
 modules: $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)