]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Fix `make distclean` for `./configure --with-config=user
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 5 Apr 2011 20:13:01 +0000 (13:13 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 5 Apr 2011 20:33:28 +0000 (13:33 -0700)
    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 <dajhorn@vanadac.com>.
This commit is a slightly refined form of the original.

module/Makefile.in

index 78e48147ae8525b865e01909cd8bb0bac0294737..d9f73c28786d9cdb8df113dff0918f3f9cfc17c3 100644 (file)
@@ -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