-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (39 loc) · 1.49 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
##
# @author Sargis S Yonan
# @date 29 September 2018
# @brief used for compiling and linking Mancala
exec_name = mancala
# using g++ for c++
cpp = g++
# for compiling c code
cc = gcc
# turn on debugging symbols
debugger = -g
# going to compile using the C++ 2011 Standard
cpp_options = -std=c++11
# cant live with/without them...
cc_options = -Wall -Wextra
# a list of my compiled objects -- not wildcarding anything here
# to avoid any surprises
objects = main.o game.o server.o client.o game_server.o
all: build
run: build $(exec_name)
./$(exec_name)
build: $(objects)
$(cpp) $(cc_options) $(objects) -o $(exec_name)
main.o: main.cc game.o game_server.o
$(cpp) $(debugger) $(cpp_options) $(cc_options) -c -I board -I game -I server main.cc
game.o: game/game.cc game/game.h board/board.h board/hole.h
$(cpp) $(debugger) $(cpp_options) $(cc_options) -c -I board -I game game/game.cc
game_server.o: server.o client.o server/game_server.cc server/game_server.h
$(cpp) $(debugger) $(cpp_options) $(cc_options) -c -I board -I server server/game_server.cc
server.o: server/server.h server/server.c
$(cc) $(debugger) $(cc_options) $(cc_options) -c -I server server/server.c
client.o: server/client.h server/client.c
$(cc) $(debugger) $(cc_options) -c -I server server/client.c
gdb: build $(exec_name)
sudo gdb ./$(exec_name)
valgrind: build $(exec_name)
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./$(exec_name) $(test_filename)
clean:
rm -rf $(objects) $(exec_name)*