mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-12 13:40:04 +00:00
Tried to manually merge kamilprzyb and main repo's code (#45)
* Merge kamilprzyb and main repo's code * Update Makefile by FunnHornhoover * Update Makefile by FinnHornhoover * Add flag to Makefile by FinnHornhoover * Remove extra line from makefile * Remove lbcrypt from Makefile * Fix flag to Makefile by FinnHornhoover * Reimplement potential fix for tutorial blackscreen by Dongresources * Update CMakeLists.txt * Update CMakeLists.txt * Reinsert Jade's changes * Cosmetic Changes to Databases .h & .cpp * Remove CMakeSettings.json * Update Makefile by Finn Hornhoover * More cosmetic changes to Databases.cpp * More cosmetic changes to Databases.cpp * Remove unnecessary line (CMakeSettings.json) * Fix CNLoginServer.cpp * More cosmetic Changes to Database.hpp, edit Database.cpp to use JSON library onstead of json11 library, and delete json11 library files * Delete json11 library files * Delete JSON library to reupload * Reupload JSON library from main repo * Reupload JSON library from main repo * Fix syntax error * Fix Makefile * Remove commented line of code to be like master Co-authored-by: CPunch <sethtstubbs@gmail.com>
This commit is contained in:
52
Makefile
52
Makefile
@@ -1,7 +1,9 @@
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
||||
CCFLAGS=-O3 #-g3 -fsanitize=address
|
||||
CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
||||
LDFLAGS=-lpthread
|
||||
LDFLAGS=-lpthread -ldl
|
||||
# specifies the name of our exectuable
|
||||
SERVER=bin/fusion
|
||||
|
||||
@@ -10,19 +12,30 @@ SERVER=bin/fusion
|
||||
PROTOCOL_VERSION?=104
|
||||
|
||||
# Windows-specific
|
||||
WIN_CC=x86_64-w64-mingw32-gcc
|
||||
WIN_CXX=x86_64-w64-mingw32-g++
|
||||
WIN_CCFLAGS=-O3 #-g3 -fsanitize=address
|
||||
WIN_CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
||||
WIN_LDFLAGS=-static -lws2_32 -lwsock32
|
||||
WIN_SERVER=bin/winfusion.exe
|
||||
|
||||
# source files
|
||||
SRC=\
|
||||
CC_SRC=\
|
||||
src/contrib/bcrypt/bcrypt.c\
|
||||
src/contrib/bcrypt/crypt_blowfish.c\
|
||||
src/contrib/bcrypt/crypt_gensalt.c\
|
||||
src/contrib/bcrypt/wrapper.c\
|
||||
src/contrib/sqlite/sqlite3.c\
|
||||
|
||||
CXX_SRC=\
|
||||
src/contrib/sqlite/sqlite3pp.cpp\
|
||||
src/contrib/sqlite/sqlite3ppext.cpp\
|
||||
src/ChatManager.cpp\
|
||||
src/CNLoginServer.cpp\
|
||||
src/CNProtocol.cpp\
|
||||
src/CNShardServer.cpp\
|
||||
src/CNShared.cpp\
|
||||
src/CNStructs.cpp\
|
||||
src/Database.cpp\
|
||||
src/Defines.cpp\
|
||||
src/main.cpp\
|
||||
src/MissionManager.cpp\
|
||||
@@ -34,13 +47,28 @@ SRC=\
|
||||
src/settings.cpp\
|
||||
|
||||
# headers (for timestamp purposes)
|
||||
HDR=\
|
||||
CC_HDR=\
|
||||
src/contrib/bcrypt/bcrypt.h\
|
||||
src/contrib/bcrypt/crypt_blowfish.h\
|
||||
src/contrib/bcrypt/crypt_gensalt.h\
|
||||
src/contrib/bcrypt/ow-crypt.h\
|
||||
src/contrib/bcrypt/winbcrypt.h\
|
||||
src/contrib/sqlite/sqlite3.h\
|
||||
src/contrib/sqlite/sqlite3ext.h\
|
||||
|
||||
CXX_HDR=\
|
||||
src/contrib/bcrypt/BCrypt.hpp\
|
||||
src/contrib/sqlite/sqlite3pp.h\
|
||||
src/contrib/sqlite/sqlite3ppext.h\
|
||||
src/contrib/INIReader.hpp\
|
||||
src/contrib/JSON.hpp\
|
||||
src/ChatManager.hpp\
|
||||
src/CNLoginServer.hpp\
|
||||
src/CNProtocol.hpp\
|
||||
src/CNShardServer.hpp\
|
||||
src/CNShared.hpp\
|
||||
src/CNStructs.hpp\
|
||||
src/Database.hpp\
|
||||
src/Defines.hpp\
|
||||
src/contrib/INIReader.hpp\
|
||||
src/contrib/JSON.hpp\
|
||||
@@ -52,26 +80,34 @@ HDR=\
|
||||
src/PlayerManager.hpp\
|
||||
src/settings.hpp\
|
||||
|
||||
OBJ=$(SRC:.cpp=.o)
|
||||
CC_OBJ=$(CC_SRC:.c=.o)
|
||||
CXX_OBJ=$(CXX_SRC:.cpp=.o)
|
||||
|
||||
OBJ=$(CC_OBJ) $(CXX_OBJ)
|
||||
|
||||
all: $(SERVER)
|
||||
|
||||
windows: $(SERVER)
|
||||
|
||||
# assign Windows-specific values if targeting Windows
|
||||
windows : CC=$(WIN_CC)
|
||||
windows : CXX=$(WIN_CXX)
|
||||
windows : CCFLAGS=$(WIN_CCFLAGS)
|
||||
windows : CXXFLAGS=$(WIN_CXXFLAGS)
|
||||
windows : LDFLAGS=$(WIN_LDFLAGS)
|
||||
windows : SERVER=$(WIN_SERVER)
|
||||
|
||||
%.o: %.cpp $(HDR)
|
||||
$(CC_OBJ): %.o: %.c $(CC_HDR)
|
||||
$(CC) -c $(CCFLAGS) -o $@ $<
|
||||
|
||||
$(CXX_OBJ): %.o: %.cpp $(CXX_HDR)
|
||||
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
||||
|
||||
$(SERVER): $(OBJ) $(HDR)
|
||||
$(SERVER): $(OBJ) $(CC_HDR) $(CXX_HDR)
|
||||
mkdir -p bin
|
||||
$(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)
|
||||
|
||||
.PHONY: all windows clean
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
|
||||
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
|
||||
Reference in New Issue
Block a user