diff options
author | Egor Tensin <egor@tensin.name> | 2024-04-25 05:11:39 +0200 |
---|---|---|
committer | Egor Tensin <egor@tensin.name> | 2024-04-25 05:43:13 +0200 |
commit | 8e652dd2cb69928ea1596aa3e59845fef6854e2c (patch) | |
tree | 62c827fde628593192dec56fbaeb2bb243d96414 /Makefile | |
parent | Makefile: separate shortcuts for debug & release builds (diff) | |
download | cimple-master.tar.gz cimple-master.zip |
Diffstat (limited to '')
-rw-r--r-- | Makefile | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -1,16 +1,18 @@ include prelude.mk -COMPILER ?= clang -CONFIGURATION ?= debug -DEFAULT_HOST ?= 127.0.0.1 -DEFAULT_PORT ?= 5556 -COVERAGE ?= +COMPILER ?= clang +CONFIGURATION ?= debug +DEFAULT_HOST ?= 127.0.0.1 +DEFAULT_PORT ?= 5556 +COVERAGE ?= +STATIC_ANALYZER ?= $(eval $(call noexpand,COMPILER)) $(eval $(call noexpand,CONFIGURATION)) $(eval $(call noexpand,DEFAULT_HOST)) $(eval $(call noexpand,DEFAULT_PORT)) $(eval $(call noexpand,COVERAGE)) +$(eval $(call noexpand,STATIC_ANALYZER)) src_dir := $(abspath .) build_dir := $(src_dir)/build @@ -40,6 +42,7 @@ build: -D 'DEFAULT_PORT=$(call escape,$(DEFAULT_PORT))' \ -D 'TEST_REPORT_DIR=$(call escape,$(build_dir)/test_report)' \ -D 'COVERAGE=$(call escape,$(COVERAGE))' \ + -D 'STATIC_ANALYZER=$(call escape,$(STATIC_ANALYZER))' \ -D 'FLAME_GRAPHS_DIR=$(call escape,$(build_dir)/flame_graphs)' \ -S '$(call escape,$(src_dir))' \ -B '$(call escape,$(build_dir)/cmake)' @@ -71,6 +74,16 @@ ifndef CI xdg-open '$(call escape,$(build_dir))/html/index.html' &> /dev/null endif +# This a separate target, because CMake is kinda dumb; if you run `make debug` +# and then `make debug COMPILER=gcc STATIC_ANALYZER=1`, it'll run a rebuild, +# but won't include the -fanalyzer option for some reason. +.PHONY: analyzer +analyzer analyzer/%: CONFIGURATION := debug +analyzer analyzer/%: COMPILER := gcc +analyzer analyzer/%: STATIC_ANALYZER := 1 +analyzer analyzer/%: build_dir := $(build_dir)/analyzer +analyzer: build + %/install: % DO cmake --install '$(call escape,$(build_dir))/cmake' |