1 scriptsdir = $(datadir)/$(PACKAGE)
2 dist_noinst_SCRIPTS = \
12 %D%/zfs-tests-color.sh
22 dist_scripts_SCRIPTS = $(scripts_scripts)
23 dist_zfsexec_SCRIPTS = \
26 dist_noinst_SCRIPTS += $(scripts_scripts)
31 %D%/update_authors.pl \
32 %D%/zfs2zol-patch.sed \
35 SHELLCHECKSCRIPTS += $(dist_scripts_SCRIPTS) $(dist_noinst_SCRIPTS)
37 define SCRIPTS_EXTRA_ENVIRONMENT
39 # Only required for in-tree use
41 export GDB="libtool --mode=execute gdb"
42 export LDMOD=/sbin/insmod
44 export CMD_DIR=$(abs_top_builddir)
45 export UDEV_SCRIPT_DIR=$(abs_top_srcdir)/udev
46 export UDEV_CMD_DIR=$(abs_top_builddir)/udev
47 export UDEV_RULE_DIR=$(abs_top_builddir)/udev/rules.d
48 export ZEDLET_ETC_DIR=$$CMD_DIR/cmd/zed/zed.d
49 export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/cmd/zed/zed.d
50 export ZPOOL_SCRIPT_DIR=$$CMD_DIR/cmd/zpool/zpool.d
51 export ZPOOL_SCRIPTS_PATH=$$CMD_DIR/cmd/zpool/zpool.d
52 export ZPOOL_COMPAT_DIR=$$CMD_DIR/cmd/zpool/compatibility.d
53 export CONTRIB_DIR=$(abs_top_builddir)/contrib
54 export LIB_DIR=$(abs_top_builddir)/.libs
55 export SYSCONF_DIR=$(abs_top_builddir)/etc
57 export INSTALL_UDEV_DIR=$(udevdir)
58 export INSTALL_UDEV_RULE_DIR=$(udevruledir)
59 export INSTALL_MOUNT_HELPER_DIR=$(mounthelperdir)
60 export INSTALL_SYSCONF_DIR=$(sysconfdir)
61 export INSTALL_PYTHON_DIR=$(pythonsitedir)
63 export KMOD_SPL=$(abs_top_builddir)/module/spl.ko
64 export KMOD_ZFS=$(abs_top_builddir)/module/zfs.ko
65 export KMOD_FREEBSD=$(abs_top_builddir)/module/openzfs.ko
68 export SCRIPTS_EXTRA_ENVIRONMENT
70 CLEANFILES += %D%/common.sh
71 %D%/common.sh: %D%/common.sh.in Makefile
72 -$(AM_V_at)$(MKDIR_P) $(@D)
73 -$(AM_V_GEN)$(SED) -e '/^export BIN_DIR=/s|$$|$(abs_top_builddir)/tests/zfs-tests/bin|' \
74 -e '/^export SBIN_DIR=/s|$$|$(abs_top_builddir)|' \
75 -e '/^export LIBEXEC_DIR=/s|$$|$(abs_top_builddir)|' \
76 -e '/^export ZTS_DIR=/s|$$|$(abs_top_srcdir)/tests|' \
77 -e '/^export SCRIPT_DIR=/s|$$|$(abs_top_srcdir)/scripts|' \
79 -$(AM_V_at)echo "$$SCRIPTS_EXTRA_ENVIRONMENT" >>$@
81 ALL_LOCAL += scripts-all-local
82 scripts-all-local: %D%/common.sh
83 -SCRIPT_COMMON=$< $(srcdir)/%D%/zfs-tests.sh -c
85 CLEAN_LOCAL += scripts-clean-local
87 -$(RM) -r tests/zfs-tests/bin/
89 INSTALL_DATA_HOOKS += scripts-install-data-hook
90 scripts-install-data-hook: %D%/common.sh.in Makefile
91 -$(SED) -e '/^export BIN_DIR=/s|$$|$(bindir)|' \
92 -e '/^export SBIN_DIR=/s|$$|$(sbindir)|' \
93 -e '/^export LIBEXEC_DIR=/s|$$|$(zfsexecdir)|' \
94 -e '/^export ZTS_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
95 -e '/^export SCRIPT_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
96 $< >$(DESTDIR)$(datadir)/$(PACKAGE)/common.sh