-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (49 loc) · 1.87 KB
/
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
57
58
CC := gcc
CCFLAGS := -Wall -Werror -pthread -g
B_TARGETS := test_trie_single_threaded test_trie_s_lock test_trie_rw_lock test_trie_hoh_lock
R_TARGETS := single_threaded s_lock rw_lock hoh_lock
ST_TARGETS := single_threaded
MT_TARGETS := s_lock rw_lock hoh_lock
test_all: $(R_TARGETS)
test_trie_rw_lock.c: test_trie_s_lock.c
@tail -n +2 $< > $@
@echo Updated $@
test_trie_hoh_lock.c: test_trie_s_lock.c
@tail -n +3 $< > $@
@echo Updated $@
$(B_TARGETS): % : %.c
@echo Building
$(CC) -o $@ $^ $(CCFLAGS)
$(ST_TARGETS): % : test_trie_%
@rm -f -r ./.testout
@mkdir .testout
@echo "\n-------------------------------------------"
@echo "Program Output($<):"
@echo "-------------------------------------------"
@-valgrind --leak-check=full --show-leak-kinds=all --log-file="./.testout/memtest_out_$<" ./$<
@echo "\n-------------------------------------------"
@echo "Valgrind Output($<):"
@echo "-------------------------------------------"
@cat ./.testout/memtest_out_$<
$(MT_TARGETS): % : test_trie_%
@rm -f -r ./.testout
@mkdir .testout
@echo "\n-------------------------------------------"
@echo "Program Output($<):"
@echo "-------------------------------------------"
@-valgrind --leak-check=full --show-leak-kinds=all --log-file="./.testout/memtest_out_$<" ./$<
@echo "\n-------------------------------------------"
@echo "Valgrind Memcheck Output($<):"
@echo "-------------------------------------------"
@cat ./.testout/memtest_out_$<
@-valgrind --tool=helgrind --log-file="./.testout/heltest_out_$<" ./$< > /dev/null
@echo "\n-------------------------------------------"
@echo "Valgrind Helgrind Output($<):"
@echo "-------------------------------------------"
@cat ./.testout/heltest_out_$<
clean:
rm -f $(B_TARGETS)
rm -f -r ./.testout
rm -f -r ./test_trie_rw_lock.c
rm -f -r ./test_trie_hoh_lock.c
# Add your rules after this point. Don't edit the things above: