diff options
author | Derek Brown <[email protected]> | 2014-08-05 11:04:00 -0400 |
---|---|---|
committer | Derek Brown <[email protected]> | 2014-08-15 09:44:42 -0400 |
commit | b6f383a24884f9a8b9cef71f019b1184bc9494f2 (patch) | |
tree | d6c3641f5000a71ada0539a23e8ddeec2375dd71 | |
parent | be51eb962063def3b5d793458aa813e10f43ae8c (diff) | |
download | erlang.mk-b6f383a24884f9a8b9cef71f019b1184bc9494f2.tar.gz erlang.mk-b6f383a24884f9a8b9cef71f019b1184bc9494f2.tar.bz2 erlang.mk-b6f383a24884f9a8b9cef71f019b1184bc9494f2.zip |
Fail if no empty modules entry in .app.src
An empty list is required for the modules tuple, as in
{modules, []}
so a sed call could populate the list. This is mentioned in README, but
can be overlooked.
If the empty tuple is not present, relx will fail on missing dependency
errors. Therefore, fail make if the empty tuple isn't found, to
help the user diagnose the problem.
-rw-r--r-- | core/erlc.mk | 4 | ||||
-rw-r--r-- | erlang.mk | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/erlc.mk b/core/erlc.mk index 87d10d8..1225eb8 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -26,6 +26,10 @@ xyrl_verbose = $(xyrl_verbose_$(V)) app:: ebin/$(PROJECT).app $(eval MODULES := $(shell find ebin -type f -name \*.beam \ | sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//')) + @if [ -z "$$(grep -E '^[^%]*{modules,[[:space:]]*\[\]}' src/$(PROJECT).app.src)" ]; then \ + echo "Empty modules entry not found in $(PROJECT).app.src. Please consult the erlang.mk README for instructions." >&2; \ + exit 1; \ + fi $(appsrc_verbose) cat src/$(PROJECT).app.src \ | sed "s/{modules,[[:space:]]*\[\]}/{modules, \[$(MODULES)\]}/" \ > ebin/$(PROJECT).app @@ -204,6 +204,10 @@ xyrl_verbose = $(xyrl_verbose_$(V)) app:: ebin/$(PROJECT).app $(eval MODULES := $(shell find ebin -type f -name \*.beam \ | sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//')) + @if [ -z "$$(grep -E '^[^%]*{modules,[[:space:]]*\[\]}' src/$(PROJECT).app.src)" ]; then \ + echo "Empty modules entry not found in $(PROJECT).app.src. Please consult the erlang.mk README for instructions." >&2; \ + exit 1; \ + fi $(appsrc_verbose) cat src/$(PROJECT).app.src \ | sed "s/{modules,[[:space:]]*\[\]}/{modules, \[$(MODULES)\]}/" \ > ebin/$(PROJECT).app |