summaryrefslogtreecommitdiff
blob: a4cccd7d50f6df8fa1ff9d0cb558be6b73ab0c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
################################################################################
## CONFIG ######################################################################
################################################################################
DIALYZER_PLT_FILE ?= tacticians-server.plt
DIALYZER ?= dialyzer

################################################################################
## MAKEFILE MAGIC ##############################################################
################################################################################
SRC_FILES ?= $(wildcard $(SRC_DIR)/*.erl $(SRC_DIR)/*/*.erl)

################################################################################
## SANITY CHECKS ###############################################################
################################################################################

################################################################################
## TARGET RULES ################################################################
################################################################################
DEBUG_RESULT = $(DIALYZER_PLT_FILE)

debug_rebuild:
	$(MAKE) clean
	$(MAKE) ERLC_OPTS=+debug_info

################################################################################
## INTERNAL RULES ##############################################################
################################################################################
ifeq ($(wildcard $(DIALYZER_PLT_FILE)),)
debug_run:
	$(DIALYZER) --build_plt --apps erts kernel stdlib jiffy --output_plt $(DIALYZER_PLT_FILE)
	$(MAKE) debug_rebuild
	$(DIALYZER) --add_to_plt --plt $@ -r $(BIN_DIR)
else
debug_run:
	$(MAKE) debug_rebuild
	$(DIALYZER) --check_plt --plt $(DIALYZER_PLT_FILE)
	$(DIALYZER) --get_warnings $(SRC_DIR)/*.erl $(SRC_DIR)/*/*.erl \
		--src --plt $(DIALYZER_PLT_FILE)
endif