aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-12-02 15:30:56 +0000
committerng0 <ng0@n0.is>2019-12-02 15:30:56 +0000
commitc8e5e28048dd9605f7958ef95f2a6dd626658069 (patch)
tree52375a14cc93c4161a658b4c7a1926dda11d8909 /contrib
parent53f35813d89de6f7c91883277129ffda3ca5b772 (diff)
downloadgnunet-c8e5e28048dd9605f7958ef95f2a6dd626658069.tar.gz
gnunet-c8e5e28048dd9605f7958ef95f2a6dd626658069.zip
rewrite sed logic used in Makefiles and move into dosubst awk script.
include 'bin' and its files in dist files, this is where dosubst is located. While the invocation (passing of the variables) is not optimal (yet, will be changed), this will in the end allow sharing code between Makefiles better, and maybe drop sed usage in the future.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/scripts/Makefile.am6
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/scripts/Makefile.am b/contrib/scripts/Makefile.am
index f55bcabfe..f8b7ec3d1 100644
--- a/contrib/scripts/Makefile.am
+++ b/contrib/scripts/Makefile.am
@@ -39,8 +39,6 @@ EXTRA_DIST = \
39CLEANFILES = \ 39CLEANFILES = \
40 $(noinst_SCRIPTS) 40 $(noinst_SCRIPTS)
41 41
42do_subst = $(AWK) -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" '{if (/@AWKEXE@/) { gsub("@AWKEXE@",awkay)}; gsub("@PYTHONEXE@",py); print $$0}'
43
44# Use SUFFIX Extension rules, they are more portable for every 42# Use SUFFIX Extension rules, they are more portable for every
45# implementation of 'make'. 43# implementation of 'make'.
46# You'll also run into the "'%' is a GNU make extension warning" 44# You'll also run into the "'%' is a GNU make extension warning"
@@ -54,11 +52,11 @@ do_subst = $(AWK) -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" '{if (/@AWKEXE@/) {
54SUFFIXES = .py.in .py 52SUFFIXES = .py.in .py
55 53
56.py.in.py: 54.py.in.py:
57 $(do_subst) < $< > $@ 55 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $< > $@
58 chmod +x $@ 56 chmod +x $@
59 57
60if HAVE_AWK 58if HAVE_AWK
61check-texinfo.awk: check-texinfo.awk.in Makefile 59check-texinfo.awk: check-texinfo.awk.in Makefile
62 $(do_subst) < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk 60 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk
63 chmod +x check-texinfo.awk 61 chmod +x check-texinfo.awk
64endif 62endif