]> git.openfabrics.org - ~emulex/compat.git/commitdiff
compat: explicitly define paths for local configs
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Mon, 27 Feb 2012 21:41:57 +0000 (13:41 -0800)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Mon, 27 Feb 2012 21:41:57 +0000 (13:41 -0800)
As noted in the previous commit a Linux kernel module's
Makefile will be read twice, during initial GNU make run,
and later for when the kernel will build the external module.
Variables that require path consideration must address in
which context it needs to be defined and do so by detecting
at which run time case it wants to instantiate variables. In
our case we want to ensure that both COMPAT_CONFIG and
COMPAT_AUTOCONF are defined within the context of the
directory of the external module we are building as otherwise
GNU Make will try to treat it as part of the kernel's build
directory's files.

We already have COMPAT_CONFIG and COMPAT_AUTOCONF defined
under a ifeq ($(KERNELRELEASE),) check, we now just need
to add the directory context and then remove the other
now superfluous uses of the $(PWD).

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

index 287f35f604b0e524720b2762cdcf7a2d1e5220c5..423d1ed3d91a21b276ff4fa91027031009714316 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,8 @@ export COMPAT_BASE_TREE_VERSION := "next-20100517"
 export COMPAT_VERSION := $(shell git describe)
 
 # to check config and compat autoconf
-export COMPAT_CONFIG=.config
-export COMPAT_AUTOCONF=include/linux/compat_autoconf.h
+export COMPAT_CONFIG=$(PWD)/.config
+export COMPAT_AUTOCONF=$(PWD)/include/linux/compat_autoconf.h
 export MAKE
 
 else
@@ -43,7 +43,7 @@ endif
 
 # Recursion lets us ensure we get this file included.
 # Trick is to run make -C $(PWD) modules later.
--include $(PWD)/$(COMPAT_CONFIG)
+-include $(COMPAT_CONFIG)
 
 obj-y += compat/
 
@@ -62,8 +62,8 @@ install: modules
 $(COMPAT_AUTOCONF): ;
 
 $(COMPAT_CONFIG):
-       +@$(PWD)/scripts/gen-compat-config.sh > $(PWD)/$(COMPAT_CONFIG)
-       +@$(PWD)/scripts/gen-compat-autoconf.sh $(COMPAT_CONFIG) > $(PWD)/$(COMPAT_AUTOCONF)
+       +@$(PWD)/scripts/gen-compat-config.sh > $(COMPAT_CONFIG)
+       +@$(PWD)/scripts/gen-compat-autoconf.sh $(COMPAT_CONFIG) > $(COMPAT_AUTOCONF)
        @$(MAKE) -C $(PWD) modules
 
 install: modules