diff options
Diffstat (limited to 'core/erlc.mk')
-rw-r--r-- | core/erlc.mk | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/erlc.mk b/core/erlc.mk index 2ca7040..c75c656 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -22,12 +22,14 @@ xyrl_verbose_0 = @echo " XYRL " $(filter %.xrl %.yrl,$(?F)); xyrl_verbose = $(xyrl_verbose_$(V)) # Core targets. -erlc-include: - -@find include/ src/ -type f -name \*.hrl -newer ebin -exec touch $(shell find src/ -type f -name "*.erl") \; app:: erlc-include ebin/$(PROJECT).app $(eval MODULES := $(shell find ebin -type f -name \*.beam \ | sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//')) + @if [ -z "$$(grep -E '^[^%]*{modules,' 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 @@ -60,5 +62,10 @@ clean:: clean-app # Extra targets. +erlc-include: + -@if [ -d ebin/ ]; then \ + find include/ src/ -type f -name \*.hrl -newer ebin -exec touch $(shell find src/ -type f -name "*.erl") \; ; \ + fi + clean-app: $(gen_verbose) rm -rf ebin/ |