X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2FMakefile.in;h=c69b8a35560e401b4392f344f65cf1210874a116;hb=b876dac776afc8ea2c598eac53b9903de01c6172;hp=78e48147ae8525b865e01909cd8bb0bac0294737;hpb=6283f55ea1b91e680386388c17d14b89e344fa8d;p=zfs.git diff --git a/module/Makefile.in b/module/Makefile.in index 78e4814..c69b8a3 100644 --- a/module/Makefile.in +++ b/module/Makefile.in @@ -5,6 +5,11 @@ subdir-m += zcommon 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 @@ -21,10 +26,13 @@ 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: - $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@ + @# Only cleanup the kernel build directories when CONFIG_KERNEL + @# is defined. This indicates that kernel modules should be built. +@CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@ + if [ -f @SPL_SYMBOLS@ ]; then $(RM) @SPL_SYMBOLS@; fi if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi if [ -f Module.markers ]; then $(RM) Module.markers; fi @@ -34,7 +42,11 @@ modules_install: $(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@; \