From 06b5c19d63ac6d26543301ed70d6dfb637363016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 26 Nov 2018 17:18:44 +0100 Subject: 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. --- core/compat.mk | 5 +---- core/core.mk | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/compat.mk b/core/compat.mk index 37a73a7..906faac 100644 --- a/core/compat.mk +++ b/core/compat.mk @@ -28,8 +28,5 @@ $(call comma_list,$(foreach d,$(DEPS),\ {erl_opts, $(call compat_erlc_opts_to_list,$(ERLC_OPTS))}. endef -$(eval _compat_rebar_config = $$(compat_rebar_config)) -$(eval export _compat_rebar_config) - rebar.config: - $(gen_verbose) echo "$${_compat_rebar_config}" > rebar.config + $(gen_verbose) $(call core_render,compat_rebar_config,rebar.config) 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 -- cgit v1.2.3