X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2FMakefile.in;h=4c6d381681494a41378ebd6782a2e0401d87e1d2;hb=b28e57cb82c5d5a992b90c56f67dd7dbf9b6f296;hp=50cbb58915821623f2550a9867fdea4244fd3faa;hpb=fe0ed8f910c1e4288dc190546cfe98ecf545b547;p=zfs.git diff --git a/module/Makefile.in b/module/Makefile.in index 50cbb58..4c6d381 100644 --- a/module/Makefile.in +++ b/module/Makefile.in @@ -5,6 +5,13 @@ subdir-m += zcommon subdir-m += zfs subdir-m += zpios +INSTALL_MOD_DIR ?= extra + +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 @@ -21,7 +28,7 @@ modules: "*** - @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 @@ -34,22 +41,25 @@ clean: modules_install: @# Install the kernel modules - $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \ - INSTALL_MOD_PATH=$(DESTDIR) \ - INSTALL_MOD_DIR=addon/zfs $@ + $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \ + INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \ + INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) @# Remove extraneous build products when packaging - if [ -n "$(DESTDIR)" ]; then \ - find $(DESTDIR)/lib/modules/@LINUX_VERSION@ \ - -name 'modules.*' | xargs $(RM); \ + kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \ + if [ -n $$kmoddir ]; then \ + find $$kmoddir -name 'modules.*' | xargs $(RM); \ fi - sysmap=$(DESTDIR)/boot/System.map-@LINUX_VERSION@; \ + sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \ if [ -f $$sysmap ]; then \ depmod -ae -F $$sysmap @LINUX_VERSION@; \ fi modules_uninstall: @# Uninstall the kernel modules - $(RM) -R $(DESTDIR)/lib/modules/@LINUX_VERSION@/addon/zfs + kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@ + list='$(subdir-m)'; for subdir in $$list; do \ + $(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \ + done distdir: