Created
August 15, 2011 09:55
-
-
Save robertoaloi/1145977 to your computer and use it in GitHub Desktop.
Rebar plugin to compile dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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