Просмотр исходного кода

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).
Loïc Hoguin 10 лет назад
Родитель
Сommit
1b9e73c995
2 измененных файлов с 4 добавлено и 3 удалено
  1. 2 0
      core/core.mk
  2. 2 3
      core/deps.mk

+ 2 - 0
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.

+ 2 - 3
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;