diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2013-02-26 07:22:47 -0800 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2013-02-26 07:22:47 -0800 |
commit | 174c69022a0af3341678d078231c66d60d8cb447 (patch) | |
tree | 108c21849e5acf68e0e5f621bc9132a960b6dea7 /src/rebar_port_compiler.erl | |
parent | 78fa8fc3d5215e076284b37394e5ca149e945997 (diff) | |
parent | 4b8c81fb53e2caaa74a33d5b62664a67427a7bbf (diff) |
Merge pull request #22 from tuncer/help
Implement 'rebar help CMD1 CMD2' and extend common 'rebar help' msg
Diffstat (limited to 'src/rebar_port_compiler.erl')
-rw-r--r-- | src/rebar_port_compiler.erl | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl index 06a79bc..36d741d 100644 --- a/src/rebar_port_compiler.erl +++ b/src/rebar_port_compiler.erl @@ -27,8 +27,11 @@ -module(rebar_port_compiler). -export([compile/2, - clean/2, - setup_env/1]). + clean/2]). + +%% for internal use only +-export([setup_env/1, + info/2]). -include("rebar.hrl"). @@ -149,6 +152,27 @@ setup_env(Config) -> %% Internal functions %% =================================================================== +info(help, compile) -> + info_help("Build port sources"); +info(help, clean) -> + info_help("Delete port build results"). + +info_help(Description) -> + ?CONSOLE( + "~s.~n" + "~n" + "Valid rebar.config options:~n" + " ~p~n" + " ~p~n", + [ + Description, + {port_env, [{"CFLAGS", "$CFLAGS -Ifoo"}, + {"freebsd", "LDFLAGS", "$LDFLAGS -lfoo"}]}, + {port_specs, [{"priv/so_name.so", ["c_src/*.c"]}, + {"linux", "priv/hello_linux", ["c_src/hello_linux.c"]}, + {"linux", "priv/hello_linux", ["c_src/*.c"], [{env, []}]}]} + ]). + setup_env(Config, ExtraEnv) -> %% Extract environment values from the config (if specified) and %% merge with the default for this operating system. This enables |