aboutsummaryrefslogtreecommitdiffstats
path: root/core/core.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-26 17:18:44 +0100
committerLoïc Hoguin <[email protected]>2018-11-26 17:18:44 +0100
commit06b5c19d63ac6d26543301ed70d6dfb637363016 (patch)
tree46b3db2275672d42025612b70ee1e84aa3c5c39a /core/core.mk
parentf1ff84ab745b0dfacd56be0fb41f035e764240a3 (diff)
downloaderlang.mk-06b5c19d63ac6d26543301ed70d6dfb637363016.tar.gz
erlang.mk-06b5c19d63ac6d26543301ed70d6dfb637363016.tar.bz2
erlang.mk-06b5c19d63ac6d26543301ed70d6dfb637363016.zip
Rename render_template to core_render and move into core
Also remove the last instance of an "eval export" that pollutes the environment and use the new core_render for it instead. core_render does not include $(verbose) as this needs to be different depending on who calls it. It's now set explicitly everywhere required.
Diffstat (limited to 'core/core.mk')
-rw-r--r--core/core.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/core.mk b/core/core.mk
index 0d0fd90..bc4d306 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -182,6 +182,10 @@ core_ls = $(filter-out $(1),$(shell echo $(1)))
# @todo Use a solution that does not require using perl.
core_relpath = $(shell perl -e 'use File::Spec; print File::Spec->abs2rel(@ARGV) . "\n"' $1 $2)
+define core_render
+ printf -- '$(subst $(newline),\n,$(subst %,%%,$(subst ','\'',$(subst $(tab),$(WS),$(call $(1))))))\n' > $(2)
+endef
+
# Automated update.
ERLANG_MK_REPO ?= https://github.com/ninenines/erlang.mk