From 2b588340af501825f3ab03f2e76dba0353c98fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 4 Jun 2018 12:59:26 +0200 Subject: Update documentation for Gun 1.0 --- docs/en/erlang.mk/1/guide/app/index.html | 39 ++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'docs/en/erlang.mk/1/guide/app') diff --git a/docs/en/erlang.mk/1/guide/app/index.html b/docs/en/erlang.mk/1/guide/app/index.html index efc60e99..55c2d223 100644 --- a/docs/en/erlang.mk/1/guide/app/index.html +++ b/docs/en/erlang.mk/1/guide/app/index.html @@ -7,8 +7,6 @@ - - Nine Nines: Building @@ -284,6 +282,43 @@ http://www.gnu.org/software/src-highlite --> the next chapter.

+

Application environment

+

The PROJECT_ENV variable is used to set the application +environment:

+
+
+
define PROJECT_ENV
+[
+  {chips, [currysauce,{mushypeas,false}]},
+  {pizza, [{size,large},{toppings,[anchovies]}]}
+]
+endef
+

If you have a large set of environment variables, you may find it +easier to use a separate file. Do this by including the following +in your Makefile:

+
+
+
PROJECT_ENV_FILE = src/env.src
+PROJECT_ENV = $(subst \n,$(newline),$(shell cat $(PROJECT_ENV_FILE) | sed -e 's/$$/\\n/;'))
+ebin/$(PROJECT).app:: $(PROJECT_ENV_FILE)
+

The file has the same contents as the PROJECT_ENV variable:

+
+
+
[
+  {chips, [currysauce,{mushypeas,false}]},
+  {pizza, [{size,large},{toppings,[anchovies]}]}
+]
+
+

Legacy method

The src/$(PROJECT).app.src file is a legacy method of building Erlang applications. It was introduced by the original -- cgit v1.2.3