xref: /freebsd/sys/contrib/openzfs/scripts/Makefile.am (revision d500a85e640d1cd270747c12e17c511b53864436)
1pkgdatadir = $(datadir)/@PACKAGE@
2
3dist_pkgdata_SCRIPTS = \
4	zimport.sh \
5	zfs.sh \
6	zfs-tests.sh \
7	zloop.sh \
8	zfs-helpers.sh
9
10EXTRA_DIST = \
11	commitcheck.sh \
12	common.sh.in \
13	cstyle.pl \
14	dkms.mkconf \
15	dkms.postbuild \
16	enum-extract.pl \
17	kmodtool \
18	make_gitrev.sh \
19	man-dates.sh \
20	paxcheck.sh \
21	zfs2zol-patch.sed \
22	zol2zfs-patch.sed
23
24define EXTRA_ENVIRONMENT
25
26# Only required for in-tree use
27export INTREE="yes"
28export GDB="libtool --mode=execute gdb"
29export LDMOD=/sbin/insmod
30
31export CMD_DIR=@abs_top_builddir@/cmd
32export UDEV_RULE_DIR=@abs_top_builddir@/udev/rules.d
33export ZEDLET_ETC_DIR=$$CMD_DIR/zed/zed.d
34export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/zed/zed.d
35export ZPOOL_SCRIPT_DIR=$$CMD_DIR/zpool/zpool.d
36export ZPOOL_SCRIPTS_PATH=$$CMD_DIR/zpool/zpool.d
37export ZPOOL_COMPAT_DIR=$$CMD_DIR/zpool/compatibility.d
38export CONTRIB_DIR=@abs_top_builddir@/contrib
39export LIB_DIR=@abs_top_builddir@/lib
40export SYSCONF_DIR=@abs_top_builddir@/etc
41
42export INSTALL_UDEV_DIR=@udevdir@
43export INSTALL_UDEV_RULE_DIR=@udevruledir@
44export INSTALL_MOUNT_HELPER_DIR=@mounthelperdir@
45export INSTALL_SYSCONF_DIR=@sysconfdir@
46export INSTALL_PYTHON_DIR=@pythonsitedir@
47
48export KMOD_SPL=@abs_top_builddir@/module/spl/spl.ko
49export KMOD_ZAVL=@abs_top_builddir@/module/avl/zavl.ko
50export KMOD_ZNVPAIR=@abs_top_builddir@/module/nvpair/znvpair.ko
51export KMOD_ZUNICODE=@abs_top_builddir@/module/unicode/zunicode.ko
52export KMOD_ZCOMMON=@abs_top_builddir@/module/zcommon/zcommon.ko
53export KMOD_ZLUA=@abs_top_builddir@/module/lua/zlua.ko
54export KMOD_ICP=@abs_top_builddir@/module/icp/icp.ko
55export KMOD_ZFS=@abs_top_builddir@/module/zfs/zfs.ko
56export KMOD_FREEBSD=@abs_top_builddir@/module/openzfs.ko
57export KMOD_ZZSTD=@abs_top_builddir@/module/zstd/zzstd.ko
58endef
59
60export EXTRA_ENVIRONMENT
61
62all-local:
63	-$(SED) -e '\|^export BIN_DIR=|s|$$|@abs_top_builddir@/bin|' \
64		-e '\|^export SBIN_DIR=|s|$$|@abs_top_builddir@/bin|' \
65		-e '\|^export LIBEXEC_DIR=|s|$$|@abs_top_builddir@/bin|' \
66		-e '\|^export ZTS_DIR=|s|$$|@abs_top_srcdir@/tests|' \
67		-e '\|^export SCRIPT_DIR=|s|$$|@abs_top_srcdir@/scripts|' \
68		$(abs_top_srcdir)/scripts/common.sh.in >common.sh
69	-echo "$$EXTRA_ENVIRONMENT" >>common.sh
70
71clean-local:
72	-$(RM) common.sh
73
74install-data-hook:
75	-$(SED) -e '\|^export BIN_DIR=|s|$$|@bindir@|' \
76		-e '\|^export SBIN_DIR=|s|$$|@sbindir@|' \
77		-e '\|^export LIBEXEC_DIR=|s|$$|@zfsexecdir@|' \
78		-e '\|^export ZTS_DIR=|s|$$|@datadir@/@PACKAGE@|' \
79		-e '\|^export SCRIPT_DIR=|s|$$|@datadir@/@PACKAGE@|' \
80		$(abs_top_srcdir)/scripts/common.sh.in \
81		>$(DESTDIR)$(datadir)/@PACKAGE@/common.sh
82