From 3d7cfde000cb4be5ad9cf363d3ee9b4571c24904 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Mon, 8 Mar 2010 13:45:51 -0800
Subject: [PATCH] Remove Module.markers and Module.symver{s} in clean target

Split 'modules' and 'clean' Makefile targets to allow us to
cleanly remove the Module.* build products with a 'make clean'.
---
 module/Makefile.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/module/Makefile.in b/module/Makefile.in
index 13a5a81333..df6d78c77c 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -4,11 +4,17 @@ subdir-m += unicode
 subdir-m += zcommon
 subdir-m += zfs
 
-modules clean:
+modules:
 	# Make the exported SPL symbols available to these modules.
 	cp @SPL_OBJ@/@SPL_SYMBOLS@ .
 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
 
+clean:
+	$(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
+
 modules_install:
 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
 		INSTALL_MOD_PATH=$(DESTDIR) \