diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 76 |
1 files changed, 68 insertions, 8 deletions
@@ -5,6 +5,17 @@ Common Makefile rules for building and testing Erlang applications. Also features support for dependencies and a package index. +Why erlang.mk? +-------------- + +A number of reasons might push someone to use erlang.mk instead of +an Erlang-based build tool, including but not limited to the following: + + * You want a very fast compilation and test cycle + * You want the full power of Unix at your disposal when hooking into your build tool + * You want to use the deps mechanism with non-Erlang Makefile-based projects + * Your project will be part of a larger make or automake based environment + Requirements ------------ @@ -215,6 +226,11 @@ variable. It takes the arguments that will then be passed to You can specify a list of modules to be compiled first using the `COMPILE_FIRST` variable. +You can also use the `ERLC_EXCLUDE` variable to prevent some +modules from being compiled by the core compiler. Note that +`ERLC_EXCLUDE` is a list of module names (i.e., no file extension +is required). + If `{id, "git"},` is found in your project's `.app.src`, the extended output of `git describe ...` will replace it. This can be retrieved at runtime via `application:get_key/2`. @@ -252,12 +268,12 @@ templates. `list-templates` lists the available templates. -C compiler plugin ------------------ +C/C++ compiler plugin +--------------------- -This plugin is not included by default. It is meant to -simplify the management of projects that include C source -code, like NIFs. +This plugin is available by default. It is meant to +simplify the management of projects that include C +and/or C++ source code, like NIFs for example. If the file `$(C_SRC_DIR)/Makefile` exists, then the plugin simply calls it when needed. Otherwise it tries to compile @@ -273,9 +289,9 @@ You can override the temporary file containing information about Erlang's environment by setting the `C_SRC_ENV` variable. This file is automatically generated on first run. -Finally you can add extra compiler options using the -`C_SRC_OPTS` variable. You can also override the defaults -`CC` and `CFLAGS` if required. +The `CC`, `CXX`, `CFLAGS`, `CXXFLAGS`, `LDLIBS` and `LDFLAGS` variables +may be modified or replaced with any value of your choosing. +The defaults are system dependent. Common_test plugin ------------------ @@ -360,6 +376,50 @@ subdirectories names in the compiled module name add will be compiled into `a_b_templatename_dtl.beam`. +Escript plugin +-------------- + +This plugin is available by default. It adds the following +target: + +`escript` which creates a shell-executable archive named +the same as your `$(PROJECT)`, containing the following files +from your application and its dependencies: + +* `*.beam` +* contents of `priv/` +* `sys.config` for your application + +There are a number of optional configuration parameters: + +* `ESCRIPT_NAME` if a different output file is required +* `ESCRIPT_COMMENT` to alter the comment line in the escript header +* `ESCRIPT_BEAMS` for the paths searched for `*.beam` files to include +* `ESCRIPT_SYS_CONFIG` defaults to `rel/sys.config` +* `ESCRIPT_EMU_ARGS` for the parameters used to start the VM +* `ESCRIPT_SHEBANG` for the line used by your shell to start `escript` +* `ESCRIPT_STATIC` for non-beam directories to be included as well + +Refer to http://www.erlang.org/doc/man/escript.html for +more information on `escript` functionality in general. + +EUnit plugin +------------ + +This plugin is available by default. It adds the following +target: + +`eunit` which runs all the EUnit tests found in `ebin` and +any of the additional EUnit directories specified in +`EUNIT_DIR`. + +`EUNIT_OPTS` can be used to specify EUnit-specific options +(e.g. `verbose`) that will be used when calling +`eunit:test/2`. This configuration parameter defaults to +`verbose`. Note +that EUnit options are specified as a comma-separated +list of options. + Relx plugin ----------- |