From 08fcf4b85cb62af57008bfe5ad24143baecd8127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 12 May 2015 23:03:36 +0300 Subject: More build improvements * Generate configure if there is only configure.ac * Don't touch the .app/.app.src if neither exists --- core/deps.mk | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'core/deps.mk') diff --git a/core/deps.mk b/core/deps.mk index 1e58a72..28eff93 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -140,14 +140,18 @@ endef define dep_autopatch_appsrc.erl AppSrcOut = "$(DEPS_DIR)/$(1)/src/$(1).app.src", AppSrcIn = case filelib:is_regular(AppSrcOut) of false -> "$(DEPS_DIR)/$(1)/ebin/$(1).app"; true -> AppSrcOut end, - fun() -> - {ok, [{application, $(1), L}]} = file:consult(AppSrcIn), - L2 = case lists:keyfind(modules, 1, L) of {_, _} -> L; false -> [{modules, []}|L] end, - L3 = case lists:keyfind(vsn, 1, L2) of {vsn, git} -> lists:keyreplace(vsn, 1, L2, {vsn, "git"}); _ -> L2 end, - ok = file:write_file(AppSrcOut, io_lib:format("~p.~n", [{application, $(1), L3}])) - end(), - case AppSrcOut of AppSrcIn -> ok; _ -> ok = file:delete(AppSrcIn) end, - halt(). + case filelib:is_regular(AppSrcIn) of + false -> ok; + true -> + fun() -> + {ok, [{application, $(1), L}]} = file:consult(AppSrcIn), + L2 = case lists:keyfind(modules, 1, L) of {_, _} -> L; false -> [{modules, []}|L] end, + L3 = case lists:keyfind(vsn, 1, L2) of {vsn, git} -> lists:keyreplace(vsn, 1, L2, {vsn, "git"}); _ -> L2 end, + ok = file:write_file(AppSrcOut, io_lib:format("~p.~n", [{application, $(1), L3}])) + end(), + case AppSrcOut of AppSrcIn -> ok; _ -> ok = file:delete(AppSrcIn) end + end, + halt() endef define dep_fetch @@ -197,6 +201,10 @@ else endif endif endif + @if [ -f $(DEPS_DIR)/$(1)/configure.ac ]; then \ + echo " AUTO " $(1); \ + cd $(DEPS_DIR)/$(1) && autoreconf -vif; \ + fi -@if [ -f $(DEPS_DIR)/$(1)/configure ]; then \ echo " CONF " $(1); \ cd $(DEPS_DIR)/$(1) && ./configure; \ -- cgit v1.2.3