-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 973 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
.PHONY: test analysis fuzz dist format tags coverage full-coverage fuzz-coverage fuzz-full-coverage
TARGET=./bin
LIB=./lib
TEST=./test
SRC=./src
src: prepare
@ cd $(SRC) && $(MAKE)
prepare:
@ mkdir -p $(LIB)
@ mkdir -p $(TARGET)
clean:
@ rm -rf $(TARGET) $(LIB)
@ cd $(SRC) && $(MAKE) $@
@ cd $(TEST) && $(MAKE) $@
# run clang-analyzer
analysis: clean
@ scan-build $(MAKE)
test: clean
@ cd $(SRC) && $(MAKE) CC=clang CFLAGS='-Wall -Werror -fsanitize=undefined -fsanitize-coverage=trace-cmp,trace-pc-guard -fprofile-instr-generate -fcoverage-mapping -std=c11 -ggdb'
@ cd $(TEST) && $(MAKE) test
fuzz: src
@ cd $(TEST) && $(MAKE) $@
coverage:
cd $(TEST) && $(MAKE) $@
full-coverage:
cd $(TEST) && $(MAKE) $@
fuzz-coverage:
cd $(TEST) && $(MAKE) $@
fuzz-full-coverage:
cd $(TEST) && $(MAKE) $@
format:
@ find $(SRC) -name \*.h -o -name \*.c | xargs clang-format -i
@ find $(TEST) -name \*.h -o -name \*.c | xargs clang-format -i
tags:
@ ctags -R