From 3e7c5625f68345659e8e0091d93dc9d78534e5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 18 May 2015 11:25:50 +0300 Subject: Proper fix for NIF code detection when port_specs is used Adds rafter back to the index. --- core/deps.mk | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'core') diff --git a/core/deps.mk b/core/deps.mk index a69b153..eb552a3 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -243,11 +243,21 @@ define dep_autopatch_rebar.erl [[" ../", F] || F <- Input] ]) end, + fun() -> + case filelib:is_dir("$(DEPS_DIR)/$(1)/c_src") of + false -> ok; + true -> + Sources = filelib:fold_files("$(DEPS_DIR)/$(1)/c_src", ".*\\\\.(c|C|cc|cpp)$$$$", true, fun(F, Acc) -> [F|Acc] end, []), + Write(io_lib:format("SOURCES :=~s\n", [[[" ", S] || S <- Sources]])) + end + end(), fun() -> case lists:keyfind(port_specs, 1, Conf) of - {_, [{Output, _}]} -> + {_, [{Output, Wildcards}]} -> filelib:ensure_dir("$(DEPS_DIR)/$(1)/" ++ Output), - Write("C_SRC_OUTPUT = " ++ Escape(Output) ++ "\n"); + Write("C_SRC_OUTPUT = " ++ Escape(Output) ++ "\n"), + Sources = [[[" ", S] || S <- filelib:wildcard("$(DEPS_DIR)/$(1)/" ++ W)] || W <- Wildcards], + Write(io_lib:format("SOURCES :=~s\n", [Sources])); {_, [First, Second]} -> PortSpec("1", First), PortSpec("2", Second), @@ -285,14 +295,6 @@ define dep_autopatch_rebar.erl _ -> ok end end(), - fun() -> - case filelib:is_dir("$(DEPS_DIR)/$(1)/c_src") of - false -> ok; - true -> - Sources = filelib:fold_files("$(DEPS_DIR)/$(1)/c_src", ".*\\\\.(c|C|cc|cpp)$$$$", true, fun(F, Acc) -> [F|Acc] end, []), - Write(io_lib:format("SOURCES :=~s\n", [[[" ", S] || S <- Sources]])) - end - end(), Write("\n\nrebar_dep: pre-deps deps pre-app app\n"), Write("\npre-deps::\n"), Write("\npre-app::\n"), -- cgit v1.2.3