2020-07-12 02:35:58 +03:00
|
|
|
subst_sed_cmd = \
|
2022-04-10 01:16:59 +03:00
|
|
|
-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
|
2020-07-12 02:35:58 +03:00
|
|
|
-e 's|@bindir[@]|$(bindir)|g' \
|
|
|
|
-e 's|@datadir[@]|$(datadir)|g' \
|
|
|
|
-e 's|@initconfdir[@]|$(initconfdir)|g' \
|
|
|
|
-e 's|@initdir[@]|$(initdir)|g' \
|
|
|
|
-e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \
|
2022-04-10 19:24:48 +03:00
|
|
|
-e 's|@pammoduledir[@]|$(pammoduledir)|g' \
|
|
|
|
-e 's|@runstatedir[@]|$(runstatedir)|g' \
|
|
|
|
-e 's|@sbindir[@]|$(sbindir)|g' \
|
|
|
|
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
2020-07-12 02:35:58 +03:00
|
|
|
-e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \
|
|
|
|
-e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \
|
|
|
|
-e 's|@udevdir[@]|$(udevdir)|g' \
|
|
|
|
-e 's|@udevruledir[@]|$(udevruledir)|g' \
|
|
|
|
-e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \
|
2022-04-10 19:24:48 +03:00
|
|
|
\
|
|
|
|
-e 's|@ASAN_ENABLED[@]|$(ASAN_ENABLED)|g' \
|
2020-07-12 02:35:58 +03:00
|
|
|
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \
|
2021-05-13 07:21:35 +03:00
|
|
|
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' \
|
2024-04-09 02:52:24 +03:00
|
|
|
-e 's|@IS_SYSV_RC[@]|$(IS_SYSV_RC)|g' \
|
2021-05-13 07:21:35 +03:00
|
|
|
-e 's|@LIBFETCH_DYNAMIC[@]|$(LIBFETCH_DYNAMIC)|g' \
|
2022-02-04 01:35:38 +03:00
|
|
|
-e 's|@LIBFETCH_SONAME[@]|$(LIBFETCH_SONAME)|g' \
|
2022-04-10 19:24:48 +03:00
|
|
|
-e 's|@PYTHON[@]|$(PYTHON)|g' \
|
|
|
|
-e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \
|
|
|
|
-e 's|@UBSAN_ENABLED[@]|$(UBSAN_ENABLED)|g' \
|
|
|
|
-e 's|@VERSION[@]|$(VERSION)|g'
|
2020-07-12 02:35:58 +03:00
|
|
|
|
2022-04-09 05:09:55 +03:00
|
|
|
define SUBST
|
|
|
|
$(1) : $(2)$(1).in Makefile;
|
|
|
|
$$(AM_V_GEN)set -e; \
|
|
|
|
$$(MKDIR_P) $$(@D); \
|
|
|
|
$$(RM) $$@~; \
|
|
|
|
$$(SED) $$(subst_sed_cmd) $$< >$$@~; \
|
|
|
|
if grep -E '@[a-zA-Z0-9_]+@' $$@~ >&2; then \
|
2020-07-12 02:35:58 +03:00
|
|
|
echo "Undefined substitution" >&2; \
|
|
|
|
exit 1; \
|
2022-04-09 05:09:55 +03:00
|
|
|
fi; \
|
|
|
|
[ -x $$< ] && chmod +x $$@~; \
|
|
|
|
mv -f $$@~ $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
SUBSTFILES =
|
|
|
|
CLEANFILES += $(SUBSTFILES)
|
2022-05-26 19:24:50 +03:00
|
|
|
dist_noinst_DATA += $(SUBSTFILES:=.in)
|
2022-04-09 05:09:55 +03:00
|
|
|
|
2024-04-10 02:34:58 +03:00
|
|
|
$(SUBSTFILES): $(call SUBST,%,)
|