-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
56 lines (45 loc) · 1015 Bytes
/
Makefile
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
.PHONY: lib
lib:
$(MAKE) -C lib $@
.PHONY: test
test: lib
$(MAKE) -C test $@
.PHONY: clean
clean:
$(MAKE) -C lib clean
$(MAKE) -C bin clean
$(MAKE) -C test clean
rm -f coverage*.html */*.gcda */*.gcno */*.gcov
.PHONY: install
install:
$(MAKE) -C lib $@
$(MAKE) -C bin $@
.PHONY: uninstall
uninstall:
$(MAKE) -C bin $@
$(MAKE) -C lib $@
.PHONY: valgrind
valgrind: lib
$(MAKE) -C test valgrind
.PHONY: analyze
analyze:
$(MAKE) -C lib clean
CFLAGS="--analyze $(CFLAGS)" $(MAKE) -C lib compile
.PHONY: sanitize
sanitize: FLAGS = -fsanitize=undefined -fsanitize=address
sanitize: test_with_flags
.PHONY: coverage
coverage: FLAGS = -coverage
coverage: test_with_flags
gcovr -r . --exclude=test --branch --html --html-details -o coverage.html
open coverage.html
.PHONY: test_with_flags
test_with_flags:
$(MAKE) -C lib clean
$(MAKE) -C test clean
CFLAGS="$(CFLAGS) $(FLAGS)" LDFLAGS="$(LDFLAGS) $(FLAGS)" $(MAKE) test
.PHONY: format
format:
clang-format -i */*.{c,h}
.PHONY: check
check: test