aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-07 12:11:38 +0200
committerLoïc Hoguin <[email protected]>2018-05-07 12:11:38 +0200
commitc5250f4c82ce8d5cde4f65e0c690a923092807e6 (patch)
tree0be1c7cd71c49cb468d8906e7557b58374ce2970
parent4522af8cc771c7f6f1ac2712a1c4e9e023dafe50 (diff)
downloaderlang.mk-c5250f4c82ce8d5cde4f65e0c690a923092807e6.tar.gz
erlang.mk-c5250f4c82ce8d5cde4f65e0c690a923092807e6.tar.bz2
erlang.mk-c5250f4c82ce8d5cde4f65e0c690a923092807e6.zip
Escape double quotes when passing ERLC_OPTS during tests
-rw-r--r--core/core.mk6
-rw-r--r--core/test.mk6
-rw-r--r--plugins/dialyzer.mk2
3 files changed, 9 insertions, 5 deletions
diff --git a/core/core.mk b/core/core.mk
index 9925856..0d0fd90 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -154,9 +154,13 @@ define comma_list
$(subst $(space),$(comma),$(strip $(1)))
endef
+define escape_dquotes
+$(subst ",\",$1)
+endef
+
# Adding erlang.mk to make Erlang scripts who call init:get_plain_arguments() happy.
define erlang
-$(ERL) $(2) -pz $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(subst ",\",$(1)))" -- erlang.mk
+$(ERL) $2 -pz $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(call escape_dquotes,$1))" -- erlang.mk
endef
ifeq ($(PLATFORM),msys2)
diff --git a/core/test.mk b/core/test.mk
index fa715e7..c0c7199 100644
--- a/core/test.mk
+++ b/core/test.mk
@@ -32,17 +32,17 @@ endif
ifeq ($(wildcard src),)
test-build:: ERLC_OPTS=$(TEST_ERLC_OPTS)
test-build:: clean deps test-deps
- $(verbose) $(MAKE) --no-print-directory test-dir ERLC_OPTS="$(TEST_ERLC_OPTS)"
+ $(verbose) $(MAKE) --no-print-directory test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
else
ifeq ($(wildcard ebin/test),)
test-build:: ERLC_OPTS=$(TEST_ERLC_OPTS)
test-build:: clean deps test-deps $(PROJECT).d
- $(verbose) $(MAKE) --no-print-directory app-build test-dir ERLC_OPTS="$(TEST_ERLC_OPTS)"
+ $(verbose) $(MAKE) --no-print-directory app-build test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
$(gen_verbose) touch ebin/test
else
test-build:: ERLC_OPTS=$(TEST_ERLC_OPTS)
test-build:: deps test-deps $(PROJECT).d
- $(verbose) $(MAKE) --no-print-directory app-build test-dir ERLC_OPTS="$(TEST_ERLC_OPTS)"
+ $(verbose) $(MAKE) --no-print-directory app-build test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
endif
clean:: clean-test-dir
diff --git a/plugins/dialyzer.mk b/plugins/dialyzer.mk
index e7f502e..63e64b8 100644
--- a/plugins/dialyzer.mk
+++ b/plugins/dialyzer.mk
@@ -57,4 +57,4 @@ dialyze:
else
dialyze: $(DIALYZER_PLT)
endif
- $(verbose) dialyzer --no_native `$(ERL) -eval "$(subst $(newline),,$(subst ",\",$(call filter_opts.erl)))" -extra $(ERLC_OPTS)` $(DIALYZER_DIRS) $(DIALYZER_OPTS)
+ $(verbose) dialyzer --no_native `$(ERL) -eval "$(subst $(newline),,$(call escape_dquotes,$(call filter_opts.erl)))" -extra $(ERLC_OPTS)` $(DIALYZER_DIRS) $(DIALYZER_OPTS)