Builds Erlang apps/deps faster.
Pull request Compare This branch is 83 commits ahead, 61 commits behind fenollp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

#erl-mk • GitHub

Makefile rules for building and testing Erlang applications, supports multiple applications inside the apps folder.

Forked from fenollp/erl-mk, with inspiration from and

App directory structure support

A lot of Erlang projects use a structure of

		dep2 supports these - just put a makefile (the example just below works on its own or makes a great starting point) at the root of the tree. Then the commands listed below would be applied to each application in the apps directory.

Include this in your Makefile:

export ERLCFLAGS = +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard +'{lager_truncation_size, 10240}'

DEPS = gproc cowboy jsx
dep_gproc = git:// master
dep_cowboy = git:// master
dep_jsx = git:// master
	@wget -nv -O $@ '' || rm -f $@


# Your targets after this line.

Now, make or make -j (for parallel running).


You should be all set with make, make clean, make eunit and make ct.

Dependency specification is the same as's.

DEPS = cowboy bullet
dep_cowboy = 0.8.4
dep_bullet = 0.4.1

…but without the packaging stuff. Maybe that'll get added at some point...

Compilation support

Pattern File type
src/*.app.src Application resource
src/*.erl Erlang code
src/*.xrl LEEX code
src/*.yrl YECC code
src/*.S Erlang ASM code
src/*.core Erlang Core code
mibs/*.mib MIB files
templates/*.dtl ErlyDTL templates
test/*_SUITE.erl Common Test tests


make target Action
make all make get-deps app
make get-deps Fetch dependencies and deps of deps, into deps/
make build-deps Fetch & compile dependencies and deps of deps, into deps/
make update-deps Update dependencies and deps of deps, into deps/
make app Compile files from src/
make eunit Compile & EUnit-test files in src/*.erl
make eunit.Mod Compile & EUnit-test code in src/Mod.erl
make ct Compile & EUnit-test files in test/*_SUITE.erl
make ct.Mod Compile & CommonTest-test code in test/Mod_SUITE.erl
make escript Generate a stand-alone escript executable
make docs Generate the app's documentation into doc/
make clean-docs Remove doc/{edoc-info,*.{css,html,png}}
make clean Remove ebin/
make build-base-plt Makes a plt for the standard erl libraries into ~/plts/base.plt
make build-plt Makes a plt for everything in deps/
make dialyzer Runs dialyzer on the current project
make rel Uses relx to build a release package for each app in the apps subdirectory. Each app needs its own relx.config file in the root of that application's directory (e.g. apps/appname/relx.config). The releases are placed in apps/appname/_rel

Restricting actions to specific apps

Basically any of the above commands can have appname. prepended, and they will apply to just that application. So you can also do things like:

make app1.ct		# just run the common test suites for app1
make	# just run the eunit tests in the foo module in app1


  • Lots of stuff! Pull requests most welcome