1 scriptsdir = $(datadir)/$(PACKAGE)
2 dist_scripts_SCRIPTS = \
9 dist_noinst_SCRIPTS = \
19 %D%/zfs-tests-color.sh
24 %D%/zfs2zol-patch.sed \
27 SHELLCHECKSCRIPTS += $(dist_scripts_SCRIPTS) $(dist_noinst_SCRIPTS)
29 define SCRIPTS_EXTRA_ENVIRONMENT
31 # Only required for in-tree use
33 export GDB="libtool --mode=execute gdb"
34 export LDMOD=/sbin/insmod
36 export CMD_DIR=$(abs_top_builddir)
37 export UDEV_SCRIPT_DIR=$(abs_top_srcdir)/udev
38 export UDEV_CMD_DIR=$(abs_top_builddir)/udev
39 export UDEV_RULE_DIR=$(abs_top_builddir)/udev/rules.d
40 export ZEDLET_ETC_DIR=$$CMD_DIR/cmd/zed/zed.d
41 export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/cmd/zed/zed.d
42 export ZPOOL_SCRIPT_DIR=$$CMD_DIR/cmd/zpool/zpool.d
43 export ZPOOL_SCRIPTS_PATH=$$CMD_DIR/cmd/zpool/zpool.d
44 export ZPOOL_COMPAT_DIR=$$CMD_DIR/cmd/zpool/compatibility.d
45 export CONTRIB_DIR=$(abs_top_builddir)/contrib
46 export LIB_DIR=$(abs_top_builddir)/.libs
47 export SYSCONF_DIR=$(abs_top_builddir)/etc
49 export INSTALL_UDEV_DIR=$(udevdir)
50 export INSTALL_UDEV_RULE_DIR=$(udevruledir)
51 export INSTALL_MOUNT_HELPER_DIR=$(mounthelperdir)
52 export INSTALL_SYSCONF_DIR=$(sysconfdir)
53 export INSTALL_PYTHON_DIR=$(pythonsitedir)
55 export KMOD_SPL=$(abs_top_builddir)/module/spl.ko
56 export KMOD_ZFS=$(abs_top_builddir)/module/zfs.ko
57 export KMOD_FREEBSD=$(abs_top_builddir)/module/openzfs.ko
60 export SCRIPTS_EXTRA_ENVIRONMENT
62 CLEANFILES += %D%/common.sh
63 %D%/common.sh: %D%/common.sh.in Makefile
64 -$(AM_V_at)$(MKDIR_P) $(@D)
65 -$(AM_V_GEN)$(SED) -e '/^export BIN_DIR=/s|$$|$(abs_top_builddir)/tests/zfs-tests/bin|' \
66 -e '/^export SBIN_DIR=/s|$$|$(abs_top_builddir)|' \
67 -e '/^export LIBEXEC_DIR=/s|$$|$(abs_top_builddir)|' \
68 -e '/^export ZTS_DIR=/s|$$|$(abs_top_srcdir)/tests|' \
69 -e '/^export SCRIPT_DIR=/s|$$|$(abs_top_srcdir)/scripts|' \
71 -$(AM_V_at)echo "$$SCRIPTS_EXTRA_ENVIRONMENT" >>$@
73 ALL_LOCAL += scripts-all-local
74 scripts-all-local: %D%/common.sh
75 -SCRIPT_COMMON=$< $(srcdir)/%D%/zfs-tests.sh -c
77 CLEAN_LOCAL += scripts-clean-local
79 -$(RM) -r tests/zfs-tests/bin/
81 INSTALL_DATA_HOOKS += scripts-install-data-hook
82 scripts-install-data-hook: %D%/common.sh.in Makefile
83 -$(SED) -e '/^export BIN_DIR=/s|$$|$(bindir)|' \
84 -e '/^export SBIN_DIR=/s|$$|$(sbindir)|' \
85 -e '/^export LIBEXEC_DIR=/s|$$|$(zfsexecdir)|' \
86 -e '/^export ZTS_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
87 -e '/^export SCRIPT_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
88 $< >$(DESTDIR)$(datadir)/$(PACKAGE)/common.sh