aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Flatow <[email protected]>2016-06-07 20:24:22 -0700
committerJared Flatow <[email protected]>2016-06-07 20:24:22 -0700
commit80b02f11155e7949d20b041a760f39c01cf3d2ce (patch)
tree0df70e4271e9e4eb6bd06d50146d8df1d60df321
parentfb1b4f80bb945266e42e6019218cb595f14b4479 (diff)
downloaderlang.mk-80b02f11155e7949d20b041a760f39c01cf3d2ce.tar.gz
erlang.mk-80b02f11155e7949d20b041a760f39c01cf3d2ce.tar.bz2
erlang.mk-80b02f11155e7949d20b041a760f39c01cf3d2ce.zip
Add PROJECT_MOD var to make the app callback module configurable
-rw-r--r--core/core.mk1
-rw-r--r--core/erlc.mk4
-rw-r--r--doc/src/guide/app.asciidoc2
3 files changed, 5 insertions, 2 deletions
diff --git a/core/core.mk b/core/core.mk
index 5733496..8188bc3 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -24,6 +24,7 @@ PROJECT ?= $(notdir $(CURDIR))
PROJECT := $(strip $(PROJECT))
PROJECT_VERSION ?= rolling
+PROJECT_MOD ?= $(PROJECT)_app
# Verbosity.
diff --git a/core/erlc.mk b/core/erlc.mk
index 695cc83..e231cc8 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -59,7 +59,7 @@ app:: clean deps $(PROJECT).d
$(verbose) $(MAKE) --no-print-directory app-build
endif
-ifeq ($(wildcard src/$(PROJECT)_app.erl),)
+ifeq ($(wildcard src/$(PROJECT_MOD).erl),)
define app_file
{application, $(PROJECT), [
{description, "$(PROJECT_DESCRIPTION)"},
@@ -79,7 +79,7 @@ define app_file
{modules, [$(call comma_list,$(2))]},
{registered, [$(call comma_list,$(PROJECT)_sup $(PROJECT_REGISTERED))]},
{applications, [$(call comma_list,kernel stdlib $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS))]},
- {mod, {$(PROJECT)_app, []}}
+ {mod, {$(PROJECT_MOD), []}}
]}.
endef
endif
diff --git a/doc/src/guide/app.asciidoc b/doc/src/guide/app.asciidoc
index 99ff052..eef5d45 100644
--- a/doc/src/guide/app.asciidoc
+++ b/doc/src/guide/app.asciidoc
@@ -126,6 +126,8 @@ your situation.
Short description of the project.
`PROJECT_VERSION`::
Current version of the project.
+`PROJECT_MOD`::
+ The application callback module.
`PROJECT_REGISTERED`::
List of the names of all registered processes.
`LOCAL_DEPS`::