-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (25 loc) · 679 Bytes
/
Makefile
File metadata and controls
29 lines (25 loc) · 679 Bytes
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
# Detect OS
ifeq ($(OS),Windows_NT)
PLATFORM = WINDOWS
CXX = g++
CXXFLAGS = -std=c++11 -pthread -D_WIN32
LDFLAGS = -lws2_32
DELETE = del
SERVER_EXE = server.exe
CLIENT_EXE = client.exe
else
PLATFORM = UNIX
CXX = g++
CXXFLAGS = -std=c++11 -pthread
LDFLAGS =
DELETE = rm -f
SERVER_EXE = server
CLIENT_EXE = client
endif
server: main_server.cpp ChatServer.cpp
$(CXX) $(CXXFLAGS) main_server.cpp ChatServer.cpp -o $(SERVER_EXE) $(LDFLAGS)
client: main_client.cpp ChatClient.cpp
$(CXX) $(CXXFLAGS) main_client.cpp ChatClient.cpp -o $(CLIENT_EXE) $(LDFLAGS)
all: server client
clean:
$(DELETE) $(SERVER_EXE) $(CLIENT_EXE)