diff options
author | Enrique Fernandez <[email protected]> | 2014-11-11 09:27:44 +0100 |
---|---|---|
committer | Enrique Fernandez <[email protected]> | 2014-11-18 17:05:54 +0100 |
commit | ffe08666ea9b365512310b3408a1397f87cb766c (patch) | |
tree | 57ae3c776a3455abcaac90c06218199ee9fda5e8 | |
parent | 724f024bbffaa56dadb10ed88130831ed7e81b09 (diff) | |
download | erlang.mk-ffe08666ea9b365512310b3408a1397f87cb766c.tar.gz erlang.mk-ffe08666ea9b365512310b3408a1397f87cb766c.tar.bz2 erlang.mk-ffe08666ea9b365512310b3408a1397f87cb766c.zip |
Add support for excluding erl files
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | core/erlc.mk | 8 | ||||
-rw-r--r-- | erlang.mk | 8 |
3 files changed, 17 insertions, 4 deletions
@@ -215,6 +215,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`. diff --git a/core/erlc.mk b/core/erlc.mk index a7f73f8..c13c714 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -9,13 +9,16 @@ ERLC_OPTS ?= -Werror +debug_info +warn_export_all +warn_export_vars \ +warn_shadow_vars +warn_obsolete_guard # +bin_opt_info +warn_missing_spec COMPILE_FIRST ?= COMPILE_FIRST_PATHS = $(addprefix src/,$(addsuffix .erl,$(COMPILE_FIRST))) +ERLC_EXCLUDE ?= +ERLC_EXCLUDE_PATHS = $(addprefix src/,$(addsuffix .erl,$(ERLC_EXCLUDE))) # Verbosity. appsrc_verbose_0 = @echo " APP " $(PROJECT).app.src; appsrc_verbose = $(appsrc_verbose_$(V)) -erlc_verbose_0 = @echo " ERLC " $(filter %.erl %.core,$(?F)); +erlc_verbose_0 = @echo " ERLC " $(filter-out $(patsubst %,%.erl,$(ERLC_EXCLUDE)),\ + $(filter %.erl %.core,$(?F))); erlc_verbose = $(erlc_verbose_$(V)) xyrl_verbose_0 = @echo " XYRL " $(filter %.xrl %.yrl,$(?F)); @@ -38,7 +41,8 @@ app:: erlc-include ebin/$(PROJECT).app define compile_erl $(erlc_verbose) erlc -v $(ERLC_OPTS) -o ebin/ \ - -pa ebin/ -I include/ $(COMPILE_FIRST_PATHS) $(1) + -pa ebin/ -I include/ $(filter-out $(ERLC_EXCLUDE_PATHS),\ + $(COMPILE_FIRST_PATHS) $(1)) endef define compile_xyrl @@ -198,13 +198,16 @@ ERLC_OPTS ?= -Werror +debug_info +warn_export_all +warn_export_vars \ +warn_shadow_vars +warn_obsolete_guard # +bin_opt_info +warn_missing_spec COMPILE_FIRST ?= COMPILE_FIRST_PATHS = $(addprefix src/,$(addsuffix .erl,$(COMPILE_FIRST))) +ERLC_EXCLUDE ?= +ERLC_EXCLUDE_PATHS = $(addprefix src/,$(addsuffix .erl,$(ERLC_EXCLUDE))) # Verbosity. appsrc_verbose_0 = @echo " APP " $(PROJECT).app.src; appsrc_verbose = $(appsrc_verbose_$(V)) -erlc_verbose_0 = @echo " ERLC " $(filter %.erl %.core,$(?F)); +erlc_verbose_0 = @echo " ERLC " $(filter-out $(patsubst %,%.erl,$(ERLC_EXCLUDE)),\ + $(filter %.erl %.core,$(?F))); erlc_verbose = $(erlc_verbose_$(V)) xyrl_verbose_0 = @echo " XYRL " $(filter %.xrl %.yrl,$(?F)); @@ -227,7 +230,8 @@ app:: erlc-include ebin/$(PROJECT).app define compile_erl $(erlc_verbose) erlc -v $(ERLC_OPTS) -o ebin/ \ - -pa ebin/ -I include/ $(COMPILE_FIRST_PATHS) $(1) + -pa ebin/ -I include/ $(filter-out $(ERLC_EXCLUDE_PATHS),\ + $(COMPILE_FIRST_PATHS) $(1)) endef define compile_xyrl |