ninenines/erlang.mk — pull request #159 by Cloven (2014-11-07 22:33:51+00:00)
Title: Adding a convenience variable (EXTRA_ERLC_OPTS) for appending compiler flags to known-good set

This adds EXTRA_ERLC_OPTS as another user-settable Makefile variable.

Redefining ERLC_OPTS is fine, but for those that simply agree with Loïc's sensible best-practice defaults and want to merely append to them, this variable gives them an opportunity to do so in a relatively clean and straightforward way.

Example Makefile fragment:

EXTRA_ERLC_OPTS = +'{parse_transform, lager_transform}'

as opposed to having to include:

ERLC_OPTS = -Werror +debug_info +warn_export_all +warn_export_vars +warn_shadow_vars +warn_obsolete_guard ERLC_OPTS += +'{parse_transform, lager_transform}'
TEST_ERLC_OPTS = +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard
TEST_ERLC_OPTS += -DTEST=1 -DEXTRA=1 +'{parse_transform, eunit_autoexport}' +'{parse_transform, lager_transform}'