forked from seraogianluca/secure-messaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (36 loc) · 1.24 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
CURRENT_DIR = $(shell pwd)
OS = $(shell uname)
TEST_PATH = test/
CLIENT_PATH = src/client/
CRYPTO_PATH = src/crypto/
SERVER_PATH = src/server/
SOCKET_PATH = src/socket/
ifeq ($(OS), Darwin)
$(info "================= Compiling for mac ======================")
TARGET = clean server_main.out client_main.out
CC = clang++
LINKFLAG = ${LDFLAGS} -lcrypto -lpthread -lc++
CFLAGS = ${CPPFLAGS} -Wall -std=c++20
endif
ifeq ($(OS), Linux)
$(info "============== Compiling for linux ======================")
TARGET = server_main.out client_main.out clean
CC = g++
LINKFLAG = -lssl -lcrypto
CFLAGS = -Wall -std=c++2a -pthread
endif
all: $(TARGET)
server_main.out: socket.o crypto.o server_main.o
$(CC) crypto.o socket.o server_main.o -o server_main.out -I$(CURRENT_DIR) $(CFLAGS) $(LINKFLAG)
client_main.out: socket.o crypto.o client_main.o
$(CC) socket.o crypto.o client_main.o -o client_main.out -I$(CURRENT_DIR) $(CFLAGS) $(LINKFLAG)
crypto.o:
$(CC) -c $(CRYPTO_PATH)crypto.cpp -I$(CURRENT_DIR) $(CFLAGS)
socket.o:
$(CC) -c $(SOCKET_PATH)socket.cpp -I$(CURRENT_DIR) $(CFLAGS)
server_main.o:
$(CC) -c $(SERVER_PATH)server_main.cpp -I$(CURRENT_DIR) $(CFLAGS)
client_main.o:
$(CC) -c $(CLIENT_PATH)client_main.cpp -I$(CURRENT_DIR) $(CFLAGS)
clean:
rm -rf *.o