Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 2.34 KB
/
Copy pathMakefile
File metadata and controls
63 lines (48 loc) · 2.34 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Top-level convenience targets. The analyzer build lives in analyzer/Makefile.
#
# make build # build the analyzer; default LLVM
# # auto-selected by scripts/select_llvm.sh (>= 21)
# make build LLVM_MAJOR=23 # ... against LLVM 23
# make test # run the full test suite
# make matrix # LLVM 21/22/23(+) compatibility matrix
# make clean
# Default LLVM major: the newest installed llvm-config-N with N >= 21, or an
# unversioned llvm-config when no supported versioned executable exists.
# Override with e.g. `make build LLVM_MAJOR=21`.
LLVM_MAJOR ?= $(shell bash $(CURDIR)/scripts/select_llvm.sh)
LLVM_CONFIG ?= $(shell bash $(CURDIR)/scripts/select_llvm.sh --config $(LLVM_MAJOR))
GOBIN := $(shell go env GOPATH 2>/dev/null)/bin
PY := $(CURDIR)/.venv/bin/python
ANALYZER := $(CURDIR)/analyzer/build/reachability-analyzer
.PHONY: help venv build test matrix ci compdb cppcheck scan-build static-analysis clean
help:
@grep -E '^[a-z-]+:.*##' $(MAKEFILE_LIST) | sed 's/:.*##/\t/'
@printf 'The following commands are for debugging fuzz-reachability itself:\n'
@printf 'compdb\t\tgenerate compile_commands.json for clangd\n'
@printf 'cppcheck\trun cppcheck on the analyzer\n'
@printf 'scan-build\trun Clang Static Analyzer on the analyzer\n'
@printf 'static-analysis\trun all analyzer static checks\n'
venv: ## create the Python venv (.venv) with the driver + test deps
bash scripts/setup_venv.sh
# Order-only prereq: create the venv if it doesn't exist yet.
$(PY):
bash scripts/setup_venv.sh
build: ## build the analyzer
$(MAKE) -C analyzer LLVM_CONFIG=$(LLVM_CONFIG)
test: build | $(PY) ## run the full test suite
cd driver && PATH="$(GOBIN):$$PATH" \
REACHABILITY_ANALYZER="$(ANALYZER)" \
"$(PY)" -m pytest tests/ -q
matrix: | $(PY) ## build + test against every installed llvm-config-NN (NN >= 21)
bash scripts/test_matrix.sh
ci: ## run this repo's suite + cov-analysis's suite (cross-repo key contract)
bash scripts/ci_cross_repo.sh
compdb:
$(MAKE) -C analyzer LLVM_CONFIG=$(LLVM_CONFIG) compdb
cppcheck:
$(MAKE) -C analyzer LLVM_CONFIG=$(LLVM_CONFIG) cppcheck
scan-build:
$(MAKE) -C analyzer LLVM_CONFIG=$(LLVM_CONFIG) scan-build
static-analysis: cppcheck scan-build
clean: ## remove analyzer build outputs
$(MAKE) -C analyzer clean BUILD=build