summaryrefslogtreecommitdiffstats
path: root/module/spl
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-06-07 17:03:12 -0400
committerBrian Behlendorf <[email protected]>2020-06-10 09:24:15 -0700
commit71504277ae5537007a99864e53a3b5ceb211a660 (patch)
tree7bd3dacc2432c27ce0a60516c795a38477adcfd8 /module/spl
parentdd4bc569b9f73e8c2445bed90d82c92d98aada03 (diff)
Cleanup linux module kbuild files
The linux module can be built either as an external module, or compiled into the kernel, using copy-builtin. The source and build directories are slightly different between the two cases, and currently, compiling into the kernel still refers to some files from the configured ZFS source tree, instead of the copies inside the kernel source tree. There is also duplication between copy-builtin, which creates a Kbuild file to build ZFS inside the kernel tree, and the top-level module/Makefile.in. Fix this by moving the list of modules and the CFLAGS settings into a new module/Kbuild.in, which will be used by the kernel kbuild infrastructure, and using KBUILD_EXTMOD to distinguish the two cases within the Makefiles, in order to choose appropriate include directories etc. Module CFLAGS setting is simplified by using subdir-ccflags-y (available since 2.6.30) to set them in the top-level Kbuild instead of each individual module. The disabling of -Wunused-but-set-variable is removed from the lua and zfs modules. The variable that the Makefile uses is actually not defined, so this has no effect; and the warning has long been disabled by the kernel Makefile itself. The target_cpu definition in module/{zfs,zcommon} is removed as it was replaced by use of CONFIG_SPARC64 in commit 70835c5b755e ("Unify target_cpu handling") os/linux/{spl,zfs} are removed from obj-m, as they are not modules in themselves, but are included by the Makefile in the spl and zfs module directories. The vestigial Makefiles in os and os/linux are removed. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10379 Closes #10421
Diffstat (limited to 'module/spl')
-rw-r--r--module/spl/Makefile.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/module/spl/Makefile.in b/module/spl/Makefile.in
index 8602f4edd..cedbfe92b 100644
--- a/module/spl/Makefile.in
+++ b/module/spl/Makefile.in
@@ -1,11 +1,13 @@
-src = @abs_top_srcdir@/module/spl
+ifneq ($(KBUILD_EXTMOD),)
+src = @abs_srcdir@
obj = @abs_builddir@
+mfdir = $(obj)
+else
+mfdir = $(srctree)/$(src)
+endif
MODULE := spl
obj-$(CONFIG_ZFS) := $(MODULE).o
-ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
-
-
--include @abs_top_builddir@/module/os/linux/spl/Makefile
+include $(mfdir)/../os/linux/spl/Makefile