Browse Source

Do not export templates as environment variables

We can write the file using the Makefile variables without going
through environment variables.
Jean-Sébastien Pédron 9 years ago
parent
commit
d8678a9ff1
2 changed files with 1 additions and 9 deletions
  1. 1 5
      plugins/bootstrap.mk
  2. 0 4
      plugins/c_src.mk

+ 1 - 5
plugins/bootstrap.mk

@@ -344,7 +344,7 @@ endef
 # Plugin-specific targets.
 
 define render_template
-	$(verbose) echo "$${_$(1)}" > $(2)
+	$(verbose) printf -- '$(subst $(newline),\n,$(subst %,%%,$(subst ','\'',$(subst $(tab),$(WS),$(call $(1))))))\n' > $(2)
 endef
 
 ifndef WS
@@ -355,10 +355,6 @@ WS = $(tab)
 endif
 endif
 
-$(foreach template,$(filter bs_% tpl_%,$(.VARIABLES)), \
-	$(eval _$(template) = $$(subst $$(tab),$$(WS),$$($(template)))) \
-	$(eval export _$(template)))
-
 bootstrap:
 ifneq ($(wildcard src/),)
 	$(error Error: src/ directory already exists)

+ 0 - 4
plugins/c_src.mk

@@ -192,10 +192,6 @@ hello(_) ->
 	erlang:nif_error({not_loaded, ?MODULE}).
 endef
 
-$(foreach template,bs_c_nif bs_erl_nif, \
-	$(eval _$(template) = $$(subst $$(tab),$$(WS),$$($(template)))) \
-	$(eval export _$(template)))
-
 new-nif:
 ifneq ($(wildcard $(C_SRC_DIR)/$n.c),)
 	$(error Error: $(C_SRC_DIR)/$n.c already exists)