@@ -1,42 +1,41 @@
|
|
1 |
-
|
2 |
-
# command to build target
|
3 |
|
4 |
-
all:
|
5 |
|
6 |
-
|
7 |
-
cc -g -Wall -Wextra
|
8 |
|
9 |
-
|
10 |
-
clang -g -Wall -Wextra -fsanitize=address
|
11 |
|
12 |
-
|
13 |
-
clang -g -Wall -Wextra -fsanitize=memory
|
14 |
|
15 |
-
|
16 |
-
clang -g -Wall -Wextra -fsanitize=thread
|
17 |
|
18 |
-
|
19 |
-
clang -g -Wall -Wextra -fsanitize=undefined
|
20 |
|
21 |
.PHONY: memcheck
|
22 |
memcheck:
|
23 |
-
valgrind
|
24 |
|
25 |
.PHONY: helgrind
|
26 |
helgrind:
|
27 |
-
valgrind --tool=helgrind --quiet
|
28 |
|
29 |
.PHONY: rebuild
|
30 |
-
rebuild: clean
|
31 |
|
32 |
.PHONY: lint
|
33 |
lint:
|
34 |
-
cpplint --filter=-readability/casting
|
35 |
|
36 |
.PHONY: gitignore
|
37 |
gitignore:
|
38 |
-
echo
|
39 |
|
40 |
.PHONY: clean
|
41 |
clean:
|
42 |
-
rm -rf
|
1 |
+
EXE=hello_w
|
|
|
2 |
|
3 |
+
all: $(EXE) $(EXE)_asan $(EXE)_msan $(EXE)_tsan $(EXE)_ubsan
|
4 |
|
5 |
+
$(EXE): hello_w.c
|
6 |
+
cc -g -Wall -Wextra hello_w.c -o $(EXE) -pthread
|
7 |
|
8 |
+
$(EXE)_asan: hello_w.c
|
9 |
+
clang -g -Wall -Wextra -fsanitize=address hello_w.c -o $(EXE)_asan -pthread
|
10 |
|
11 |
+
$(EXE)_msan: hello_w.c
|
12 |
+
clang -g -Wall -Wextra -fsanitize=memory hello_w.c -o $(EXE)_msan -pthread
|
13 |
|
14 |
+
$(EXE)_tsan: hello_w.c
|
15 |
+
clang -g -Wall -Wextra -fsanitize=thread hello_w.c -o $(EXE)_tsan -pthread
|
16 |
|
17 |
+
$(EXE)_ubsan: hello_w.c
|
18 |
+
clang -g -Wall -Wextra -fsanitize=undefined hello_w.c -o $(EXE)_ubsan -pthread
|
19 |
|
20 |
.PHONY: memcheck
|
21 |
memcheck:
|
22 |
+
valgrind ./$(EXE)
|
23 |
|
24 |
.PHONY: helgrind
|
25 |
helgrind:
|
26 |
+
valgrind --tool=helgrind --quiet ./$(EXE)
|
27 |
|
28 |
.PHONY: rebuild
|
29 |
+
rebuild: clean $(EXE)
|
30 |
|
31 |
.PHONY: lint
|
32 |
lint:
|
33 |
+
cpplint --filter=-readability/casting hello_w.c
|
34 |
|
35 |
.PHONY: gitignore
|
36 |
gitignore:
|
37 |
+
echo $(EXE) $(EXE)_asan $(EXE)_msan $(EXE)_tsan $(EXE)_ubsan | tr " " "\n" > .gitignore
|
38 |
|
39 |
.PHONY: clean
|
40 |
clean:
|
41 |
+
rm -rf $(EXE) $(EXE)_asan $(EXE)_msan $(EXE)_tsan $(EXE)_ubsan
|