diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2009-12-12 07:43:12 -0700 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2009-12-12 07:43:12 -0700 |
commit | 5618198eeb924b225e39f91d793483d305a90cda (patch) | |
tree | 070d54be0bee84b9c11b9a6ab2abd788115935c1 /bootstrap | |
parent | 3990f0a0766e5e508e319e73139df93cc4c3bde4 (diff) | |
parent | 9e618f79c5ff5a55418adbe3909b9490d7ccde91 (diff) |
Merging mainline
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -2,8 +2,21 @@ %% -*- erlang -*- main(Args) -> + %% Get a string repr of build time + Built = build_time(), + + %% Check for force=1 flag to force a rebuild + case lists:member("force=1", Args) of + true -> + [] = os:cmd("rm -rf ebin/*.beam"), + ok; + false -> + ok + end, + %% Compile all src/*.erl to ebin - case make:files(filelib:wildcard("src/*.erl"), [{outdir, "ebin"}, {i, "include"}]) of + case make:files(filelib:wildcard("src/*.erl"), [{outdir, "ebin"}, {i, "include"}, + {d, 'BUILD_TIME', Built}]) of up_to_date -> ok; error -> @@ -55,5 +68,8 @@ main(Args) -> "and you can use rebar to build OTP-compliant apps.\n"). - +build_time() -> + {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(now()), + lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w", [Y, M, D, H, Min, S])). + |