diff options
author | Magnus Henoch <[email protected]> | 2015-10-26 15:55:49 +0000 |
---|---|---|
committer | Magnus Henoch <[email protected]> | 2015-10-26 15:55:49 +0000 |
commit | fb1c22169c96b51f331c0e7885cdbd0806585da2 (patch) | |
tree | 06481deb3fcc80b66bc49f0f1b87a6bcd52460bb | |
parent | bd1251dfe4d60f09e569731d36a92e94acbe297a (diff) | |
download | otp-fb1c22169c96b51f331c0e7885cdbd0806585da2.tar.gz otp-fb1c22169c96b51f331c0e7885cdbd0806585da2.tar.bz2 otp-fb1c22169c96b51f331c0e7885cdbd0806585da2.zip |
Make erl -make return non-zero exit code on failure
This makes it behave like similar Unix tools.
-rw-r--r-- | erts/etc/common/erlexec.c | 2 | ||||
-rw-r--r-- | lib/tools/src/make.erl | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c index b68e109b43..60aefc9fa7 100644 --- a/erts/etc/common/erlexec.c +++ b/erts/etc/common/erlexec.c @@ -715,7 +715,7 @@ int main(int argc, char **argv) * on itself here. We'll avoid doing that. */ if (strcmp(argv[i], "-make") == 0) { - add_args("-noshell", "-noinput", "-s", "make", "all", NULL); + add_args("-noshell", "-noinput", "-s", "make", "all_or_nothing", NULL); add_Eargs("-B"); haltAfterwards = 1; i = argc; /* Skip rest of command line */ diff --git a/lib/tools/src/make.erl b/lib/tools/src/make.erl index c8ef0a04a5..59d02ed648 100644 --- a/lib/tools/src/make.erl +++ b/lib/tools/src/make.erl @@ -24,12 +24,20 @@ %% If Emakefile is missing the current directory is used. -module(make). --export([all/0,all/1,files/1,files/2]). +-export([all_or_nothing/0,all/0,all/1,files/1,files/2]). -include_lib("kernel/include/file.hrl"). -define(MakeOpts,[noexec,load,netload,noload]). +all_or_nothing() -> + case all() of + up_to_date -> + up_to_date; + error -> + halt(1) + end. + all() -> all([]). |