summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-04-05 13:13:01 -0700
committerBrian Behlendorf <[email protected]>2011-04-05 13:33:28 -0700
commitd433c206515e567c52ce09589033405a0ae3716e (patch)
treeb3490a255f584a9e63bd6389033a5dcb750a8972 /module
parentfa417e57a68b7aa026ec5fd8c0471b6c60ca109f (diff)
Fix `make distclean` for `./configure --with-config=user
Making distclean in module make[1]: Entering directory `/zfs/module' make -C SUBDIRS=`pwd` clean make: Entering an unknown directory make: *** SUBDIRS=/zfs/module: No such file or directory. Stop. When using --with-config=user the 'distclean' target would fail because it assumes the kernel configuration infrastrure is set up. This is not the case, nor does it need to be, because the '--with-config=user' option will prune the entire ./module subtree from SUBDIRS. This prevents most build rules from operating in the ./module directory. However, the 'dist*' rules will still traverse this directory because it is listed in DIST_SUBDIRS. This is correct because we need to ensure the dist rules package the directory contents regardless of the configuration for the 'dist' rule. The correct way to handle this is to only invoke the kernel build system as part of the 'clean' rule when CONFIG_KERNEL_TRUE is set. Initial fix provided by Darik Horn <[email protected]>. This commit is a slightly refined form of the original.
Diffstat (limited to 'module')
-rw-r--r--module/Makefile.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/module/Makefile.in b/module/Makefile.in
index 78e48147a..d9f73c287 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -24,7 +24,10 @@ modules:
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
clean:
- $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
+ @# Only cleanup the kernel build directories when CONFIG_KERNEL
+ @# is defined. This indicates that kernel modules should be built.
+@CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
+
if [ -f @SPL_SYMBOLS@ ]; then $(RM) @SPL_SYMBOLS@; fi
if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi
if [ -f Module.markers ]; then $(RM) Module.markers; fi