This repository was archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
93 lines (69 loc) · 2.21 KB
/
makefile
File metadata and controls
93 lines (69 loc) · 2.21 KB
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
G++_COMPILER=g++ # In mac I need to change this to g++-7 , so I made it a variable.
BUILD_DIR=build
DEBUG_DIR=debug
SYNC_DIR=sync
PORT=12345
ARGS_CLIENT=-h localhost -p $(PORT) -f $(DEBUG_DIR) -u user0 -pass password0
ARGS_CLIENT_DEBUG="-h" "localhost" "-p" "$(PORT)" "-f" "$(DEBUG_DIR)" "-u" "user0" "-pass" "password0"
ARGS_SERVER=-s -p $(PORT) -cc 0
ARGS_SERVER_DEBUG="-s" "-p" "$(PORT)" "-cc" "0"
default rebuild:
make clean
make debug
init:
git submodule init
git submodule update
runClient:
./$(DEBUG_DIR)/csync $(ARGS_CLIENT)
runServer:
./$(DEBUG_DIR)/csync $(ARGS_SERVER)
runDebugServer:
gdb --args ./$(DEBUG_DIR)/csync $(ARGS_SERVER_DEBUG)
runDebugClient:
gdb --args ./$(DEBUG_DIR)/csync $(ARGS_CLIENT_DEBUG)
runMassifServer:
valgrind --tool=massif $(DEBUG_DIR)/csync $(ARGS_SERVER_DEBUG)
runMassifClient:
valgrind --tool=massif $(DEBUG_DIR)/csync $(ARGS_CLIENT_DEBUG)
runTests:
./$(DEBUG_DIR)/csync $(ARGS_CLIENT) -t
runDebugTests:
gdb --args ./$(DEBUG_DIR)/csync $(ARGS_SERVER_DEBUG) "-t"
massifClient:
make default
make runMassifClient
massifServer:
make default
make runMassifServer
debugServer:
make default
make runDebugServer
debugClient:
make default
make runDebugClient
client:
make default
make runClient
server:
make default
make runServer
tests:
make default
make runTests
debugTests:
make default
make runDebugTests
debug:
mkdir -p $(DEBUG_DIR)
${G++_COMPILER} -g src/*.cpp src/sec/*.cpp src/net/*.cpp src/test/*.cpp src/lib/hash-library/md5.cpp src/lib/hash-library/crc32.cpp -I src/ -I src/sec/ -I src/test/ -I src/net/ -I src/lib/hash-library/ -o $(DEBUG_DIR)/csync -lstdc++fs -std=c++17 -pthread
release:
make compile
compile:
# Create the build directory if it does not allready exist:
mkdir -p $(BUILD_DIR)
${G++_COMPILER} src/*.cpp src/net/*.cpp src/sec/*.cpp src/test/*.cpp src/lib/hash-library/md5.cpp src/lib/hash-library/crc32.cpp -I src/ -I src/sec/ -I src/net/ -I src/test/ -I src/lib/hash-library/ -o $(BUILD_DIR)/csync -lstdc++fs -std=c++17 -pthread
clean:
# Only remove the build folder if it exists:
if [ -d $(BUILD_DIR) ]; then rm -rf $(BUILD_DIR); fi
if [ -d $(DEBUG_DIR) ]; then rm -rf $(DEBUG_DIR); fi
if [ -d $(SYNC_DIR) ]; then rm -rf $(SYNC_DIR); fi