Skip to content

Instantly share code, notes, and snippets.

@robertoaloi
Created August 15, 2011 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertoaloi/1145977 to your computer and use it in GitHub Desktop.
Save robertoaloi/1145977 to your computer and use it in GitHub Desktop.
Rebar plugin to compile dependencies
-module(rebar_compiledeps_plugin).
-export([pre_compile/2]).
pre_compile(_, _) ->
Cwd = rebar_utils:get_cwd(),
case lists:suffix("my_dep", Cwd) of
true ->
Opts = [{cd, Cwd}],
case filelib:is_regular(filename:join([Cwd, "Makefile"])) of
true ->
rebar_utils:sh("make [OPTIONS]", Opts);
false ->
rebar_utils:sh("./configure && make [OPTIONS]", Opts)
end;
false ->
ok
end,
ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment