summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-02-27 10:30:21 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-02-27 10:30:21 +0100 |
commit | be9a65dd6d24ca8e7006c0b8825a3fa46419e201 (patch) | |
tree | d11e8541fa7d22aae225d6a3574cde1b93a97507 /Makefile | |
parent | a7cb1de44bdbf4375fdfd459e9f92dca8bd2e3c5 (diff) |
Adds a way to statically analyse the code.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -8,9 +8,13 @@ UNUSED_WWW_DIR ?= www YAWS_CONF ?= $(CONF_DIR)/yaws.conf YAWS_API_HEADER ?= /my/src/yaws/include/yaws_api.hrl +DIALYZER_PLT_FILE ?= tacticians-server.plt + ## Binaries YAWS ?= yaws ERLC ?= erlc +ERLC_OPTS ?= +DIALYZER ?= dialyzer ################################################################################ REQUIRED_HEADERS = $(INCLUDE_DIR)/yaws_api.hrl @@ -28,6 +32,15 @@ all: $(MAKE) build SRC_DIR=$$subdir || exit 1;\ done +debug: $(DIALYZER_PLT_FILE) + $(MAKE) build_debug + $(DIALYZER) --check_plt --plt $(DIALYZER_PLT_FILE) + $(DIALYZER) --get_warnings -r $(BIN_DIR) --plt $(DIALYZER_PLT_FILE) + +build_debug: + $(MAKE) clean + $(MAKE) ERLC_OPTS=+debug_info + build: $(BIN_DIR) $(REQUIRED_HEADERS) $(BIN_FILES) run: all $(UNUSED_WWW_DIR) @@ -36,6 +49,10 @@ run: all $(UNUSED_WWW_DIR) clean: rm -rf $(BIN_DIR)/* +$(DIALYZER_PLT_FILE): + $(DIALYZER) --build_plt --apps erts kernel stdlib jiffy --output_plt $@ + $(MAKE) build_debug + $(DIALYZER) --add_to_plt --plt $@ -r $(BIN_DIR) $(INCLUDE_DIR)/yaws_api.hrl: $(YAWS_API_HEADER) $(INCLUDE_DIR) cp $< $@ @@ -51,4 +68,4 @@ $(INCLUDE_DIR): .SECONDEXPANSION: $(BIN_FILES): $(BIN_DIR)/%.beam : $(SRC_DIR)/%.erl $$(wildcard $$(SRC_DIR)/%/.) - $(ERLC) -o $(BIN_DIR) $< + $(ERLC) $(ERLC_OPTS) -o $(BIN_DIR) $< |