-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
120 lines (86 loc) · 2.51 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
COMPILER=g++
OPTIONS=-std=c++17 -pedantic -Wall -Werror -g
COMPILE=$(COMPILER) $(OPTIONS)
card=../Card.cpp
pack=../Pack.cpp
player=../Player.cpp
team=../Team.cpp
game=../Game.cpp
test_framework=catch_amalgamated.cpp
test: test_card.exe test_pack.exe test_player.exe test_team.exe #test_game.exe
./test_card.exe
./test_pack.exe
./test_player.exe
./test_team.exe
#./test_game.exe
test_valgrind: test_card.exe test_pack.exe test_player.exe test_team.exe #test_game.exe
valgrind ./test_card.exe
valgrind ./test_pack.exe
valgrind ./test_player.exe
valgrind ./test_team.exe
#valgrind ./test_game.exe
# Test individual files without valgrind
test_card: test_card.exe
./test_card.exe
test_pack: test_pack.exe
./test_pack.exe
test_player: test_player.exe
./test_player.exe
test_team: test_team.exe
./test_team.exe
test_game: test_game.exe
./test_game.exe
run_game_example: run_game.exe
./run_game.exe Kim Human Hope Human Danielle Human Flor Human
# Test individual files with valgrind
test_card_valgrind: test_card.exe
valgrind ./test_card.exe
test_pack_valgrind: test_pack.exe
valgrind ./test_pack.exe
test_player_valgrind: test_player.exe
valgrind ./test_player.exe
test_team_valgrind: test_team.exe
valgrind ./test_team.exe
test_game_valgrind: test_game.exe
valgrind ./test_game.exe
# Object files
Card.o: $(card)
$(COMPILE) -c $^
Pack.o: $(pack)
$(COMPILE) -c $^
Player.o: $(player)
$(COMPILE) -c $^
Team.o: $(team)
$(COMPILE) -c $^
Game.o: $(game)
$(COMPILE) -c $^
catch_amalgamated.o: catch_amalgamated.cpp
$(COMPILE) -c $^
test_card.o: test_card.cpp
$(COMPILE) -c $^
test_pack.o: test_pack.cpp
$(COMPILE) -c $^
test_player.o: test_player.cpp
$(COMPILE) -c $^
test_team.o: test_team.cpp
$(COMPILE) -c $^
test_game.o: test_game.cpp
$(COMPILE) -c $^
main.o: ../main.cpp
$(COMPILE) -c $^
# Executables
test_card.exe: Card.o catch_amalgamated.o test_card.o
$(COMPILE) -o $@ $^
test_pack.exe: Card.o Pack.o catch_amalgamated.o test_pack.o
$(COMPILE) -o $@ $^
test_player.exe: Card.o Player.o catch_amalgamated.o test_player.o
$(COMPILE) -o $@ $^
test_team.exe: Card.o Player.o Team.o catch_amalgamated.o test_team.o
$(COMPILE) -o $@ $^
test_game.exe: Card.o Pack.o Player.o Team.o Game.o catch_amalgamated.o test_game.o
$(COMPILE) -o $@ $^
run_game.exe: Card.o Pack.o Player.o Team.o Game.o main.o
$(COMPILE) -o $@ $^
.PHONY: clean
clean:
rm -rvf *.out *.exe *.dSYM *.stackdump *.o