10 INSTALL_MOD_DIR ?= extra
12 ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement
13 ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@
14 ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
15 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/spl
16 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include
18 ZFS_MODULE_CPPFLAGS += -D_KERNEL
19 ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@
21 @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include
22 @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@
24 export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS
26 SUBDIR_TARGETS = icp lua
29 list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \
30 $(MAKE) -C $$targetdir; \
32 $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ CONFIG_ZFS=m $@
35 @# Only cleanup the kernel build directories when CONFIG_KERNEL
36 @# is defined. This indicates that kernel modules should be built.
37 @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ $@
39 if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi
40 if [ -f Module.markers ]; then $(RM) Module.markers; fi
42 find . -name '*.ur-safe' -type f -print | xargs $(RM)
45 @# Install the kernel modules
46 $(MAKE) -C @LINUX_OBJ@ M=`pwd` $@ \
47 INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
48 INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
49 KERNELRELEASE=@LINUX_VERSION@
50 @# Remove extraneous build products when packaging
51 kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
52 if [ -n "$(DESTDIR)" ]; then \
53 find $$kmoddir -name 'modules.*' | xargs $(RM); \
55 sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
56 if [ -f $$sysmap ]; then \
57 depmod -ae -F $$sysmap @LINUX_VERSION@; \
61 @# Uninstall the kernel modules
62 kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
63 list='$(subdir-m)'; for subdir in $$list; do \
64 $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
68 list='$(subdir-m)'; for subdir in $$list; do \
69 (cd @top_srcdir@/module && find $$subdir \
70 -name '*.c' -o -name '*.h' -o -name '*.S' | \
71 xargs cp --parents -t @abs_top_builddir@/module/$$distdir); \
74 distclean maintainer-clean: clean
75 install: modules_install
76 uninstall: modules_uninstall