aboutsummaryrefslogtreecommitdiffstats
path: root/module/Makefile.in
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/Makefile.in
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/Makefile.in')
-rw-r--r--module/Makefile.in30
1 files changed, 3 insertions, 27 deletions
diff --git a/module/Makefile.in b/module/Makefile.in
index 39acdac20..3485649dc 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -1,31 +1,7 @@
-obj-m += avl/
-obj-m += icp/
-obj-m += lua/
-obj-m += nvpair/
-obj-m += spl/
-obj-m += os/linux/spl/
-obj-m += unicode/
-obj-m += zcommon/
-obj-m += zfs/
-obj-m += os/linux/zfs/
+include Kbuild
INSTALL_MOD_DIR ?= extra
-ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement
-ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ @NO_FORMAT_ZERO_LENGTH@
-ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
-ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/kernel
-ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/spl
-ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/zfs
-ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include
-ZFS_MODULE_CPPFLAGS += -D_KERNEL
-ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@
-
-@CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include
-@CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@
-
-export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS
-
SUBDIR_TARGETS = icp lua
all: modules
@@ -119,7 +95,7 @@ modules_install: modules_install-@ac_system@
modules_uninstall-Linux:
@# Uninstall the kernel modules
kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
- list='$(obj-m)'; for objdir in $$list; do \
+ list='$(ZFS_MODULES)'; for objdir in $$list; do \
$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$objdir; \
done
@@ -129,7 +105,7 @@ modules_uninstall-FreeBSD:
modules_uninstall: modules_uninstall-@ac_system@
distdir:
- list='$(obj-m)'; for objdir in $$list; do \
+ list='$(ZFS_MODULES)'; for objdir in $$list os/linux/spl os/linux/zfs; do \
(cd @top_srcdir@/module && find $$objdir -name '*.[chS]' | \
while read path; do \
mkdir -p @abs_top_builddir@/module/$$distdir/$${path%/*}; \