aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-14 00:13:21 +0300
committerLoïc Hoguin <[email protected]>2015-05-14 00:13:21 +0300
commit1493e9394c9a44bb381cd687485f7eab128b040d (patch)
tree66bbb73e5eac7a466f66d39d44dd032d75f25634
parent6f71fd18bd5fd8c5dcedb2fa064ee2d4867288b5 (diff)
downloaderlang.mk-1493e9394c9a44bb381cd687485f7eab128b040d.tar.gz
erlang.mk-1493e9394c9a44bb381cd687485f7eab128b040d.tar.bz2
erlang.mk-1493e9394c9a44bb381cd687485f7eab128b040d.zip
Initial autopatch of port env and hooks
-rw-r--r--core/deps.mk25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/deps.mk b/core/deps.mk
index f44b9a3..bae195b 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -133,6 +133,31 @@ define dep_autopatch_rebar.erl
Write(io_lib:format("COMPILE_FIRST +=~s\n", [Names]))
end
end(),
+ fun() ->
+ case lists:keyfind(port_env, 1, Conf) of
+ {_, Vars} ->
+ [Write(K ++ " = $$$$\(shell echo " ++ re:replace(V, "\\\\$$$$", "\$$$$$$$$", [global, {return, list}]) ++ "\)\n")
+ || {K, V} <- Vars],
+ Write("CFLAGS += $$$$\(DRV_CFLAGS\)\n"),
+ Write("CXXFLAGS += $$$$\(DRV_CFLAGS\)\n"),
+ Write("LDFLAGS += $$$$\(DRV_LDFLAGS\)\n");
+ _ -> ok
+ end
+ end(),
+ fun() ->
+ case lists:keyfind(pre_hooks, 1, Conf) of
+ false -> ok;
+ {_, Hooks} ->
+ [case H of
+ {'get-deps', Command} ->
+ Write("\npre::\n\t" ++ Command ++ "\n");
+ {compile, Command} ->
+ Write("\npre::\n\t" ++ Command ++ "\n");
+ _ -> ok
+ end || H <- Hooks],
+ Write("\npre:: deps app\n\n")
+ end
+ end(),
case $(1) of
proper -> Write("\n# Proper hack.\napp::\n\t./write_compile_flags include/compile_flags.hrl\n");
_ -> ok