8 ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h
9 ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
10 ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@
11 export ZFS_MODULE_CFLAGS
14 @# Make the exported SPL symbols available to these modules.
15 @# They may be in the root of SPL_OBJ when building against
16 @# installed devel headers, or they may be in the module
17 @# subdirectory when building against the spl source tree.
18 @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
19 /bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
20 elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
21 /bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
24 "*** Missing spl symbols ensure you have built the spl:\n" \
25 "*** - @SPL_OBJ@/@SPL_SYMBOLS@, or\n" \
26 "*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
29 $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
32 @# Only cleanup the kernel build directories when CONFIG_KERNEL
33 @# is defined. This indicates that kernel modules should be built.
34 @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
36 if [ -f @SPL_SYMBOLS@ ]; then $(RM) @SPL_SYMBOLS@; fi
37 if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi
38 if [ -f Module.markers ]; then $(RM) Module.markers; fi
41 @# Install the kernel modules
42 $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
43 INSTALL_MOD_PATH=$(DESTDIR) \
44 INSTALL_MOD_DIR=addon/zfs $@
45 @# Remove extraneous build products when packaging
46 if [ -n "$(DESTDIR)" ]; then \
47 find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \
48 -name 'modules.*' | xargs $(RM); \
50 sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \
51 if [ -f $$sysmap ]; then \
52 depmod -ae -F $$sysmap @LINUX_VERSION@; \
56 @# Uninstall the kernel modules
57 $(RM) -R $(DESTDIR)/lib/modules/@LINUX_VERSION@/addon/zfs
61 distclean maintainer-clean: clean
62 install: modules_install
63 uninstall: modules_uninstall