aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/escript.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-01-08 13:40:43 +0100
committerLoïc Hoguin <[email protected]>2015-01-08 13:40:43 +0100
commitabb11f81f5e23ebda3334f1a8669aa9097a3895d (patch)
tree101774c96c0c89cf0782d7403a978e1ae7a9f89f /plugins/escript.mk
parent2a6499a167354f2a1259b28b2c3105f08db977d1 (diff)
downloaderlang.mk-abb11f81f5e23ebda3334f1a8669aa9097a3895d.tar.gz
erlang.mk-abb11f81f5e23ebda3334f1a8669aa9097a3895d.tar.bz2
erlang.mk-abb11f81f5e23ebda3334f1a8669aa9097a3895d.zip
Speed up "erl" invocations
Use "+A0 -noinput -boot start_clean" as start argument. Use halt/{1,2} to shutdown the VM faster.
Diffstat (limited to 'plugins/escript.mk')
-rw-r--r--plugins/escript.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/escript.mk b/plugins/escript.mk
index 5a6a0dd..534db61 100644
--- a/plugins/escript.mk
+++ b/plugins/escript.mk
@@ -11,7 +11,6 @@ ESCRIPT_COMMENT ?= This is an -*- erlang -*- file
ESCRIPT_BEAMS ?= "ebin/*", "deps/*/ebin/*"
ESCRIPT_SYS_CONFIG ?= "rel/sys.config"
ESCRIPT_EMU_ARGS ?= -pa . \
- -noshell -noinput \
-sasl errlog_type error \
-escript main $(ESCRIPT_NAME)
ESCRIPT_SHEBANG ?= /usr/bin/env escript
@@ -33,6 +32,7 @@ help::
# Modified MIT License, https://github.com/synrc/mad/blob/master/LICENSE :
# Software may only be used for the great good and the true happiness of all
# sentient beings.
+
define ESCRIPT_RAW
'Read = fun(F) -> {ok, B} = file:read_file(filename:absname(F)), B end,'\
'Files = fun(L) -> A = lists:concat([filelib:wildcard(X)||X<- L ]),'\
@@ -51,12 +51,14 @@ define ESCRIPT_RAW
' ]),'\
' file:change_mode(Escript, 8#755)'\
'end,'\
-'Ez("$(ESCRIPT_NAME)").'
+'Ez("$(ESCRIPT_NAME)"),'\
+'halt().'
endef
+
ESCRIPT_COMMAND = $(subst ' ',,$(ESCRIPT_RAW))
escript:: distclean-escript deps app
- $(gen_verbose) erl -noshell -eval $(ESCRIPT_COMMAND) -s init stop
+ $(gen_verbose) $(ERL) -eval $(ESCRIPT_COMMAND)
distclean-escript:
$(gen_verbose) rm -f $(ESCRIPT_NAME)