subdir-m += zfs
subdir-m += zpios
+ZFS_MODULE_CFLAGS += -include @SPL_OBJ@/spl_config.h
+ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h
+ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include -I@SPL@/include -I@SPL@
+export ZFS_MODULE_CFLAGS
+
modules:
@# Make the exported SPL symbols available to these modules.
@# They may be in the root of SPL_OBJ when building against
"*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
exit 1; \
fi
- $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
+ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
clean:
@# Only cleanup the kernel build directories when CONFIG_KERNEL
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
INSTALL_MOD_PATH=$(DESTDIR) \
INSTALL_MOD_DIR=addon/zfs $@
- find $(DESTDIR)/lib/modules/ -name 'modules.*' | xargs $(RM)
+ @# Remove extraneous build products when packaging
+ if [ -n "$(DESTDIR)" ]; then \
+ find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \
+ -name 'modules.*' | xargs $(RM); \
+ fi
sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \
if [ -f $$sysmap ]; then \
depmod -ae -F $$sysmap @LINUX_VERSION@; \