10 obj-m += os/linux/zfs/
12 INSTALL_MOD_DIR ?= extra
14 ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement
15 ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@
16 ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
17 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/kernel
18 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/spl
19 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/zfs
20 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include
21 ZFS_MODULE_CPPFLAGS += -D_KERNEL
22 ZFS_MODULE_CPPFLAGS += @KERNEL_DEBUG_CPPFLAGS@
24 @CONFIG_QAT_TRUE@ZFS_MODULE_CFLAGS += -I@QAT_SRC@/include
25 @CONFIG_QAT_TRUE@KBUILD_EXTRA_SYMBOLS += @QAT_SYMBOLS@
27 export ZFS_MODULE_CFLAGS ZFS_MODULE_CPPFLAGS
29 SUBDIR_TARGETS = icp lua
32 distclean maintainer-clean: clean
33 install: modules_install
34 uninstall: modules_uninstall
38 list='$(SUBDIR_TARGETS)'; for targetdir in $$list; do \
39 $(MAKE) -C $$targetdir; \
41 $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ CONFIG_ZFS=m modules
46 modules: modules-@ac_system@
49 @# Only cleanup the kernel build directories when CONFIG_KERNEL
50 @# is defined. This indicates that kernel modules should be built.
51 @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ M=`pwd` @KERNEL_MAKE@ clean
53 if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi
54 if [ -f Module.markers ]; then $(RM) Module.markers; fi
56 find . -name '*.ur-safe' -type f -print | xargs $(RM)
58 clean: clean-@ac_system@
60 modules_install-Linux:
61 @# Install the kernel modules
62 $(MAKE) -C @LINUX_OBJ@ M=`pwd` modules_install \
63 INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
64 INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
65 KERNELRELEASE=@LINUX_VERSION@
66 @# Remove extraneous build products when packaging
67 kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
68 if [ -n "$(DESTDIR)" ]; then \
69 find $$kmoddir -name 'modules.*' | xargs $(RM); \
71 sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
72 if [ -f $$sysmap ]; then \
73 depmod -ae -F $$sysmap @LINUX_VERSION@; \
77 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
78 $(am__define_uniq_tagged_files); \
79 test -z "$(CTAGS_ARGS)$$unique" \
80 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
84 here=`$(am__cd) $(top_builddir) && pwd` \
85 && $(am__cd) $(top_srcdir) \
86 && gtags -i $(GTAGS_ARGS) "$$here"
87 cscopelist: cscopelist-recursive
89 cscopelist-am: $(am__tagged_files)
90 list='$(am__tagged_files)'; \
92 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
93 *) sdir=$(subdir)/$(srcdir) ;; \
96 if test -f "$$i"; then \
97 echo "$(subdir)/$$i"; \
101 done >> $(top_builddir)/cscope.files
103 modules_install: modules_install-@ac_system@
105 modules_uninstall-Linux:
106 @# Uninstall the kernel modules
107 kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
108 list='$(obj-m)'; for objdir in $$list; do \
109 $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$objdir; \
112 modules_uninstall: modules_uninstall-@ac_system@
115 list='$(obj-m)'; for objdir in $$list; do \
116 (cd @top_srcdir@/module && find $$objdir \
117 -name '*.c' -o -name '*.h' -o -name '*.S' | \
118 xargs -r cp --parents -t @abs_top_builddir@/module/$$distdir); \