-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 978 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
objects = host.o game.o board.o defs.o
comp_tags = -c -g -O0 -std=c++17
# General Commands
.PHONY: all
all: board player host
clean:
rm *.o board player host
# Compile Commands
defs.o: defs.cpp defs.hpp
clang++ $(comp_tags) defs.cpp
board.o: board.cpp board.hpp
clang++ $(comp_tags) board.cpp
game.o: game.cpp game.hpp
clang++ $(comp_tags) game.cpp
player.o: player.cpp player.hpp
clang++ $(comp_tags) player.cpp
host.o: host.cpp host.hpp
clang++ $(comp_tags) host.cpp
# Link Commands
board: board.o defs.o
clang++ -g -o board board.o defs.o
player: player.o
clang++ -g -o player player.o
host: $(objects)
clang++ -Wall -g -o host $(objects)
# Run Commands
.PHONY: run-board
run-board: board
./board
PLAYER_ARGS = arg1 arg2
.PHONY: run-player # Pass In (port, hostAddress – 127.0.0.1 || IP)
run-player: player
./player $(PLAYER_ARGS)
HOST_ARGS = arg1
.PHONY: run-host # Pass In (port, hostAddress – 127.0.0.1 || IP)
run-host: host
./host $(HOST_ARGS)