-
Notifications
You must be signed in to change notification settings - Fork 0
/
.old_Makefile
executable file
·46 lines (37 loc) · 2.01 KB
/
.old_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
COMPILE_FLAGS=-std=c++2a -Wall -Wextra -g -fPIC
OPTIONS=-DOPENSSL_PIC -DDEFAULT_PORT=4242 -DDEV_MODE -fno-exceptions
INCLUDES=-I include/ -I /usr/include/openssl
LINK_LIBS=/usr/local/lib64/libcrypto.a -lm -pthread -lncurses -ldl -lstdc++ -lssl -lcrypto -lz
OBJECT_FILES=lib/logger.o lib/encryption.o lib/client_management.o lib/client_chat.o
all: io_lib encryption_lib communication_lib razan_server razan_client
.PHONY: all
clean:
@echo "Cleaning bin/ directory"
@rm bin/* 2>/dev/null || true
@echo "Cleaning lib/ directory"
@rm lib/* 2>/dev/null || true
@echo "Build cleaned"
rebuild: clean all
io_lib:
@echo "Building I/O libraries: src/logger.cc"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/logger.cc -o lib/logger.o
encryption_lib:
@echo "Building encryption functionality: src/encryption.cc"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/encryption.cc -o lib/encryption.o
communication_lib:
@echo "Building communication libraries: src/client_management.cc src/client_chat.cc"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/client_management.cc -o lib/client_management.o
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/client_chat.cc -o lib/client_chat.o
razan_server: io_lib encryption_lib communication_lib
@echo "Building razan_server executable: src/razan_server.cc"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/razan_server.cc -o lib/razan_server.o
@echo "Linking razan_server"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) $(OBJECT_FILES) lib/razan_server.o $(LINK_LIBS) -o bin/razan_server # server, to be run on one machine only
razan_client: io_lib encryption_lib communication_lib
@echo "Building razan_client executable: src/razan_client.cc"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) -c src/razan_client.cc -o lib/razan_client.o
@echo "Linking razan_client"
@cc $(COMPILE_FLAGS) $(OPTIONS) $(INCLUDES) $(OBJECT_FILES) lib/razan_client.o $(LINK_LIBS) -o bin/razan # client application, copy for everyone to use
install: all
@echo "Copying contents of bin/ to /usr/bin"
@cp /bin/* /usr/bin