]> git.proxmox.com Git - mirror_zfs.git/blame - scripts/Makefile.am
Remove constrained path on clean
[mirror_zfs.git] / scripts / Makefile.am
CommitLineData
0a8b1fc6
AZ
1scriptsdir = $(datadir)/$(PACKAGE)
2dist_scripts_SCRIPTS = \
3 %D%/zfs-helpers.sh \
4 %D%/zfs-tests.sh \
5 %D%/zfs.sh \
6 %D%/zimport.sh \
7 %D%/zloop.sh
c8f9061f 8
c3ef9f75 9EXTRA_SCRIPTS = \
0a8b1fc6
AZ
10 %D%/commitcheck.sh \
11 %D%/common.sh.in \
12 %D%/dkms.mkconf \
13 %D%/dkms.postbuild \
14 %D%/kmodtool \
15 %D%/make_gitrev.sh \
16 %D%/man-dates.sh \
17 %D%/mancheck.sh \
18 %D%/paxcheck.sh \
19 %D%/zfs-tests-color.sh
c3ef9f75 20
0a8b1fc6
AZ
21EXTRA_DIST += \
22 %D%/cstyle.pl \
23 %D%/enum-extract.pl \
24 %D%/zfs2zol-patch.sed \
25 %D%/zol2zfs-patch.sed \
c3ef9f75
AZ
26 $(EXTRA_SCRIPTS)
27
0a8b1fc6 28SHELLCHECKSCRIPTS += $(dist_scripts_SCRIPTS) $(EXTRA_SCRIPTS)
c8f9061f 29
0a8b1fc6 30define SCRIPTS_EXTRA_ENVIRONMENT
c8f9061f
BB
31
32# Only required for in-tree use
33export INTREE="yes"
54007c79 34export GDB="libtool --mode=execute gdb"
c8f9061f
BB
35export LDMOD=/sbin/insmod
36
0a8b1fc6 37export CMD_DIR=$(abs_top_builddir)
0a9aaa7f
AZ
38export UDEV_SCRIPT_DIR=$(abs_top_srcdir)/udev
39export UDEV_CMD_DIR=$(abs_top_builddir)/udev
0a8b1fc6 40export UDEV_RULE_DIR=$(abs_top_builddir)/udev/rules.d
5cdca5b1
AZ
41export ZEDLET_ETC_DIR=$$CMD_DIR/cmd/zed/zed.d
42export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/cmd/zed/zed.d
43export ZPOOL_SCRIPT_DIR=$$CMD_DIR/cmd/zpool/zpool.d
44export ZPOOL_SCRIPTS_PATH=$$CMD_DIR/cmd/zpool/zpool.d
45export ZPOOL_COMPAT_DIR=$$CMD_DIR/cmd/zpool/compatibility.d
0a8b1fc6
AZ
46export CONTRIB_DIR=$(abs_top_builddir)/contrib
47export LIB_DIR=$(abs_top_builddir)/.libs
48export SYSCONF_DIR=$(abs_top_builddir)/etc
c8f9061f 49
0a8b1fc6
AZ
50export INSTALL_UDEV_DIR=$(udevdir)
51export INSTALL_UDEV_RULE_DIR=$(udevruledir)
52export INSTALL_MOUNT_HELPER_DIR=$(mounthelperdir)
53export INSTALL_SYSCONF_DIR=$(sysconfdir)
54export INSTALL_PYTHON_DIR=$(pythonsitedir)
c8f9061f 55
0a8b1fc6
AZ
56export KMOD_SPL=$(abs_top_builddir)/module/spl.ko
57export KMOD_ZFS=$(abs_top_builddir)/module/zfs.ko
58export KMOD_FREEBSD=$(abs_top_builddir)/module/openzfs.ko
c8f9061f
BB
59endef
60
0a8b1fc6 61export SCRIPTS_EXTRA_ENVIRONMENT
c8f9061f 62
0a8b1fc6
AZ
63CLEANFILES += %D%/common.sh
64%D%/common.sh: %D%/common.sh.in Makefile
65 -$(AM_V_at)$(MKDIR_P) $(@D)
66 -$(AM_V_GEN)$(SED) -e '/^export BIN_DIR=/s|$$|$(abs_top_builddir)/tests/zfs-tests/bin|' \
67 -e '/^export SBIN_DIR=/s|$$|$(abs_top_builddir)|' \
68 -e '/^export LIBEXEC_DIR=/s|$$|$(abs_top_builddir)|' \
69 -e '/^export ZTS_DIR=/s|$$|$(abs_top_srcdir)/tests|' \
70 -e '/^export SCRIPT_DIR=/s|$$|$(abs_top_srcdir)/scripts|' \
71 $< >$@
72 -$(AM_V_at)echo "$$SCRIPTS_EXTRA_ENVIRONMENT" >>$@
c8f9061f 73
0a8b1fc6
AZ
74ALL_LOCAL += scripts-all-local
75scripts-all-local: %D%/common.sh
76 -SCRIPT_COMMON=$< $(srcdir)/%D%/zfs-tests.sh -c
c8f9061f 77
3ed04d66
AZ
78CLEAN_LOCAL += scripts-clean-local
79scripts-clean-local:
80 -$(RM) -r tests/zfs-tests/bin/
81
0a8b1fc6
AZ
82INSTALL_DATA_HOOKS += scripts-install-data-hook
83scripts-install-data-hook: %D%/common.sh.in Makefile
84 -$(SED) -e '/^export BIN_DIR=/s|$$|$(bindir)|' \
85 -e '/^export SBIN_DIR=/s|$$|$(sbindir)|' \
86 -e '/^export LIBEXEC_DIR=/s|$$|$(zfsexecdir)|' \
87 -e '/^export ZTS_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
88 -e '/^export SCRIPT_DIR=/s|$$|$(datadir)/$(PACKAGE)|' \
89 $< >$(DESTDIR)$(datadir)/$(PACKAGE)/common.sh