From 1b9e73c99561e0661862b10f3c5fd9dbb8cc1f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 18 Jun 2015 20:51:28 +0200 Subject: 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). --- core/core.mk | 2 ++ core/deps.mk | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'core') 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; -- cgit v1.2.3