109d2c9310
Currently an out-of-tree build does not work with read-only source directory because zfs_gitrev.h can't be created. Move this file to the build directory, which is more appropriate for a generated file, and drop the dist-hook for zfs_gitrev.h. There is no need to distribute this file since it will be regenerated as part of the compilation in any case. scripts/make_gitrev.sh tries to avoid updating zfs_gitrev.h if there has been no change, however this doesn't cover the case when the source directory is not in git: in that case zfs_gitrev.h gets overwritten even though it's always "unknown". Simplify the logic to always write out a new version of zfs_gitrev.h, compare against the old and overwrite only if different. This is now simple enough to just include in the Makefile, so drop the script. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Closes #10493
47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
# When integrated in to a monolithic kernel the spl module must appear
|
|
# first. This ensures its module initialization function is run before
|
|
# any of the other module initialization functions which depend on it.
|
|
ZFS_MODULES += spl/
|
|
ZFS_MODULES += avl/
|
|
ZFS_MODULES += icp/
|
|
ZFS_MODULES += lua/
|
|
ZFS_MODULES += nvpair/
|
|
ZFS_MODULES += unicode/
|
|
ZFS_MODULES += zcommon/
|
|
ZFS_MODULES += zfs/
|
|
|
|
# The rest is only relevant when run by kbuild
|
|
ifneq ($(KERNELRELEASE),)
|
|
|
|
obj-$(CONFIG_ZFS) := $(ZFS_MODULES)
|
|
|
|
ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement
|
|
ZFS_MODULE_CFLAGS += -Wmissing-prototypes
|
|
ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ @NO_FORMAT_ZERO_LENGTH@
|
|
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
zfs_include = @abs_top_srcdir@/include
|
|
ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
|
|
ZFS_MODULE_CFLAGS += -I@abs_top_builddir@/include
|
|
else
|
|
zfs_include = $(srctree)/include/zfs
|
|
ZFS_MODULE_CFLAGS += -include $(zfs_include)/zfs_config.h
|
|
endif
|
|
|
|
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/kernel
|
|
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/spl
|
|
ZFS_MODULE_CFLAGS += -I$(zfs_include)/os/linux/zfs
|
|
ZFS_MODULE_CFLAGS += -I$(zfs_include)
|
|
ZFS_MODULE_CPPFLAGS += -D_KERNEL
|
|
ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@
|
|
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
@CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include
|
|
@CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@
|
|
endif
|
|
|
|
subdir-asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
|
|
subdir-ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
|
|
|
|
endif
|