-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.58 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
compile = g++ -std=c++11 -g -Wno-pointer-arith -Wall -Werror
o = objects
src = src
app = application
client-dependencies = ${o}/client/
server-dependencies = ${o}/server/
with-client-dependencies = ${o}/client/*.o
with-server-dependencies = ${o}/server/*.o
multi-thread = -pthread
move-all-to = mv *.o
as = -o
file = -c
all: clean dir-gen client server
${compile} ${as} server ${app}/ServerApplication.cpp ${with-server-dependencies} ${multi-thread}
${compile} ${as} client ${app}/ClientApplication.cpp ${with-client-dependencies} ${multi-thread}
client:
${compile} ${file} ${src}/Notifier.cpp
${compile} ${file} ${src}/InputHandler.cpp
${compile} ${file} ${src}/ClientFileHandler.cpp
${compile} ${file} ${src}/AddressGetter.cpp
${compile} ${file} ${src}/SocketWrapper.cpp
${compile} ${file} ${src}/ServerSocketWrapper.cpp
${compile} ${file} ${src}/ClientSocketWrapper.cpp
${move-all-to} ${client-dependencies}
server:
${compile} ${file} ${src}/AddressGetter.cpp
${compile} ${file} ${src}/SocketWrapper.cpp
${compile} ${file} ${src}/ServerSocketWrapper.cpp
${compile} ${file} ${src}/ClientSocketWrapper.cpp
${compile} ${file} ${src}/ConnectionHandler.cpp
${compile} ${file} ${src}/ClientFileHandler.cpp
${compile} ${file} ${src}/ServerFileHandler.cpp
${compile} ${file} ${src}/ElectionHelper.cpp
${compile} ${file} ${src}/ReplicationHelper.cpp
${move-all-to} ${server-dependencies}
dir-gen:
mkdir -p ${client-dependencies}
mkdir -p ${server-dependencies}
mkdir -p downloads
clean:
rm -f ${client-dependencies}/*.o
rm -f ${client-dependencies}/*.o
rm -f client
rm -f server