aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-06-18 20:51:28 +0200
committerLoïc Hoguin <[email protected]>2015-06-18 20:51:28 +0200
commit1b9e73c99561e0661862b10f3c5fd9dbb8cc1f0f (patch)
treeff2c4db2cd88610b4b1fcfe6ef4f91494399189a
parent6612bae420c8062000fa050ea40d89b6dda7c175 (diff)
downloaderlang.mk-1b9e73c99561e0661862b10f3c5fd9dbb8cc1f0f.tar.gz
erlang.mk-1b9e73c99561e0661862b10f3c5fd9dbb8cc1f0f.tar.bz2
erlang.mk-1b9e73c99561e0661862b10f3c5fd9dbb8cc1f0f.zip
Use the real path instead of symbolic links to erlang.mk
This will fix some issues where a symbolic link can link to another symbolic link (Cowboy examples), and issues where symbolic links can't be used (VirtualBox shared folders).
-rw-r--r--core/core.mk2
-rw-r--r--core/deps.mk5
2 files changed, 4 insertions, 3 deletions
diff --git a/core/core.mk b/core/core.mk
index 46b12d1..4fe4e5c 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -14,6 +14,8 @@
.PHONY: all deps app rel docs install-docs tests check clean distclean help erlang-mk
+ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
+
ERLANG_MK_VERSION = 1
# Core configuration.
diff --git a/core/deps.mk b/core/deps.mk
index ae786da..78ce3ca 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -107,8 +107,7 @@ endef
# Overwrite erlang.mk with the current file by default.
ifeq ($(NO_AUTOPATCH_ERLANG_MK),)
define dep_autopatch_erlang_mk
- rm -f $(DEPS_DIR)/$(1)/erlang.mk; \
- cd $(DEPS_DIR)/$(1)/ && ln -s ../../erlang.mk
+ echo "include $(ERLANG_MK_FILENAME)" > $(DEPS_DIR)/$(1)/erlang.mk
endef
else
define dep_autopatch_erlang_mk
@@ -394,7 +393,7 @@ define dep_autopatch_rebar.erl
end,
[PortSpec(S) || S <- PortSpecs]
end,
- Write("\ninclude ../../erlang.mk"),
+ Write("\ninclude $(ERLANG_MK_FILENAME)"),
RunPlugin = fun(Plugin, Step) ->
case erlang:function_exported(Plugin, Step, 2) of
false -> ok;