Makefile: Set TEST_ERLC_OPTS

This commit is contained in:
Jean-Sébastien Pédron 2015-08-14 12:21:42 +02:00 committed by Jean-Sébastien Pédron
parent 2b0d50730d
commit 8466f2e40b
1 changed files with 14 additions and 6 deletions

View File

@ -11,16 +11,16 @@ COMPILE_FIRST = $(basename \
$(notdir \
$(shell grep -lw '^behaviour_info' src/*.erl)))
ERLC_OPTS += -I $(DEPS_DIR)/rabbitmq_common/include
RMQ_ERLC_OPTS += -I $(DEPS_DIR)/rabbitmq_common/include
ifdef INSTRUMENT_FOR_QC
ERLC_OPTS += -DINSTR_MOD=gm_qc
RMQ_ERLC_OPTS += -DINSTR_MOD=gm_qc
else
ERLC_OPTS += -DINSTR_MOD=gm
RMQ_ERLC_OPTS += -DINSTR_MOD=gm
endif
ifdef CREDIT_FLOW_TRACING
ERLC_OPTS += -DCREDIT_FLOW_TRACING=true
RMQ_ERLC_OPTS += -DCREDIT_FLOW_TRACING=true
endif
# Our type specs rely on dict:dict/0 etc, which are only available in
@ -44,16 +44,18 @@ endef
ERTS_VER = $(shell erl -version 2>&1 | sed -E 's/.* version //')
USE_SPECS_MIN_ERTS_VER = 5.11
ifeq ($(call compare_version,$(ERTS_VER),$(USE_SPECS_MIN_ERTS_VER),>=),true)
ERLC_OPTS += -Duse_specs
RMQ_ERLC_OPTS += -Duse_specs
endif
ifndef USE_PROPER_QC
# PropEr needs to be installed for property checking
# http://proper.softlab.ntua.gr/
USE_PROPER_QC = $(shell $(ERL) -eval 'io:format({module, proper} =:= code:ensure_loaded(proper)), halt().')
ERLC_OPTS += $(if $(filter true,$(USE_PROPER_QC)),-Duse_proper_qc)
RMQ_ERLC_OPTS += $(if $(filter true,$(USE_PROPER_QC)),-Duse_proper_qc)
endif
ERLC_OPTS += $(RMQ_ERLC_OPTS)
ebin/$(PROJECT).app:: $(USAGES_ERL)
clean:: clean-generated
@ -61,6 +63,12 @@ clean:: clean-generated
clean-generated:
$(gen_verbose) rm -f $(USAGES_ERL)
# --------------------------------------------------------------------
# Tests.
# --------------------------------------------------------------------
TEST_ERLC_OPTS += $(RMQ_ERLC_OPTS)
# --------------------------------------------------------------------
# Documentation.
# --------------------------------------------------------------------