-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (47 loc) · 1.08 KB
/
Makefile
File metadata and controls
58 lines (47 loc) · 1.08 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
.PHONY: all test benchmark tools examples clean
export DEBUG
export DEBUG_VERBOSE
export AUTH
all: test benchmark tools examples
test:
make -C test
benchmark:
make -C benchmark
tools:
make -C tools
examples:
make -C examples
SCAN_DIR = ./scan_out
scan_result_check:
@err=$$(grep -h -o 'error: .*' ./$(SCAN_DIR)/*.log | wc -l); \
if [ -z "$$err" ]; then \
err=0; \
fi; \
wrn=$$(grep -h -o '^[0-9]\+ warnings\? generated' ./$(SCAN_DIR)/*.log | grep -o '^[0-9]\+' | awk '{s+=$$1} END {print s}');\
if [ -z "$$wrn" ]; then \
wrn=0; \
fi; \
if [ $$err -eq 0 -a $$wrn -eq 0 ]; then \
echo "no errors or warnings found";\
exit 0; \
else\
echo "scan-build detected $$err errors and $$wrn warnings";\
for f in $(SCAN_DIR)/*.log; do \
echo "---- $$f ----"; \
cat $$f; \
echo ""; \
done; \
exit 1; \
fi;
scan:
@echo "Running scan-build static analysis"
@rm -rf $(SCAN_DIR)
@mkdir -p $(SCAN_DIR)
@make clean
-@make -j SCAN=1 -C test scan
@$(MAKE) scan_result_check
clean:
make -C test clean
make -C benchmark clean
make -C tools clean
make -C examples clean