2020-08-20 17:03:15 +00:00
|
|
|
CXX=clang++
|
|
|
|
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
|
|
|
CXXFLAGS=-std=c++17 -O3 #-g3 -fsanitize=address
|
|
|
|
LDFLAGS=-lpthread
|
|
|
|
# specifies the name of our exectuable
|
|
|
|
SERVER=bin/fusion
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
# Windows-specific
|
|
|
|
WIN_CXX=x86_64-w64-mingw32-g++
|
2020-08-20 18:18:43 +00:00
|
|
|
WIN_CXXFLAGS=-std=c++17 -O3 #-g3 -fsanitize=address
|
2020-08-20 17:03:15 +00:00
|
|
|
WIN_LDFLAGS=-lws2_32 -lwsock32
|
|
|
|
WIN_SERVER=bin/winfusion.exe
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
# source files
|
|
|
|
SRC=\
|
|
|
|
src/ChatManager.cpp\
|
|
|
|
src/CNLoginServer.cpp\
|
|
|
|
src/CNProtocol.cpp\
|
|
|
|
src/CNShardServer.cpp\
|
|
|
|
src/CNShared.cpp\
|
|
|
|
src/CNStructs.cpp\
|
|
|
|
src/main.cpp\
|
|
|
|
src/NanoManager.cpp\
|
|
|
|
src/NPCManager.cpp\
|
|
|
|
src/Player.cpp\
|
|
|
|
src/PlayerManager.cpp\
|
|
|
|
src/settings.cpp\
|
|
|
|
|
|
|
|
# headers (for timestamp purposes)
|
|
|
|
HDR=\
|
|
|
|
src/ChatManager.hpp\
|
|
|
|
src/CNLoginServer.hpp\
|
|
|
|
src/CNProtocol.hpp\
|
|
|
|
src/CNShardServer.hpp\
|
|
|
|
src/CNShared.hpp\
|
|
|
|
src/CNStructs.hpp\
|
|
|
|
src/INIReader.hpp\
|
|
|
|
src/NanoManager.hpp\
|
|
|
|
src/NPCManager.hpp\
|
|
|
|
src/Player.hpp\
|
|
|
|
src/PlayerManager.hpp\
|
|
|
|
src/settings.hpp\
|
|
|
|
|
|
|
|
OBJ=$(SRC:.cpp=.o)
|
|
|
|
|
|
|
|
all: $(SERVER)
|
|
|
|
|
|
|
|
windows: $(SERVER)
|
|
|
|
|
|
|
|
# Assign Windows-specific values if targeting Windows
|
|
|
|
windows : CXX=$(WIN_CXX)
|
|
|
|
windows : CXXFLAGS=$(WIN_CXXFLAGS)
|
|
|
|
windows : LDFLAGS=$(WIN_LDFLAGS)
|
|
|
|
windows : SERVER=$(WIN_SERVER)
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
%.o: %.cpp $(HDR)
|
|
|
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
$(SERVER): $(OBJ) $(HDR)
|
|
|
|
mkdir -p bin
|
|
|
|
$(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
.PHONY: all windows clean
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 17:03:15 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
|