mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Support plain POSIX make.
Also standardized the new variable names.
This commit is contained in:
parent
a067975f27
commit
322bc46604
32
Makefile
32
Makefile
@ -1,7 +1,7 @@
|
|||||||
CC=clang
|
CC=clang
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
||||||
CCFLAGS=-O3 #-g3 -fsanitize=address
|
CFLAGS=-O3 #-g3 -fsanitize=address
|
||||||
CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
||||||
LDFLAGS=-lpthread -ldl
|
LDFLAGS=-lpthread -ldl
|
||||||
# specifies the name of our exectuable
|
# specifies the name of our exectuable
|
||||||
@ -14,19 +14,19 @@ PROTOCOL_VERSION?=104
|
|||||||
# Windows-specific
|
# Windows-specific
|
||||||
WIN_CC=x86_64-w64-mingw32-gcc
|
WIN_CC=x86_64-w64-mingw32-gcc
|
||||||
WIN_CXX=x86_64-w64-mingw32-g++
|
WIN_CXX=x86_64-w64-mingw32-g++
|
||||||
WIN_CCFLAGS=-O3 #-g3 -fsanitize=address
|
WIN_CFLAGS=-O3 #-g3 -fsanitize=address
|
||||||
WIN_CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
WIN_CXXFLAGS=-Wall -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) #-g3 -fsanitize=address
|
||||||
WIN_LDFLAGS=-static -lws2_32 -lwsock32
|
WIN_LDFLAGS=-static -lws2_32 -lwsock32
|
||||||
WIN_SERVER=bin/winfusion.exe
|
WIN_SERVER=bin/winfusion.exe
|
||||||
|
|
||||||
CC_SRC=\
|
CSRC=\
|
||||||
src/contrib/bcrypt/bcrypt.c\
|
src/contrib/bcrypt/bcrypt.c\
|
||||||
src/contrib/bcrypt/crypt_blowfish.c\
|
src/contrib/bcrypt/crypt_blowfish.c\
|
||||||
src/contrib/bcrypt/crypt_gensalt.c\
|
src/contrib/bcrypt/crypt_gensalt.c\
|
||||||
src/contrib/bcrypt/wrapper.c\
|
src/contrib/bcrypt/wrapper.c\
|
||||||
src/contrib/sqlite/sqlite3.c\
|
src/contrib/sqlite/sqlite3.c\
|
||||||
|
|
||||||
CXX_SRC=\
|
CXXSRC=\
|
||||||
src/contrib/sqlite/sqlite3pp.cpp\
|
src/contrib/sqlite/sqlite3pp.cpp\
|
||||||
src/contrib/sqlite/sqlite3ppext.cpp\
|
src/contrib/sqlite/sqlite3ppext.cpp\
|
||||||
src/ChatManager.cpp\
|
src/ChatManager.cpp\
|
||||||
@ -48,7 +48,7 @@ CXX_SRC=\
|
|||||||
src/settings.cpp\
|
src/settings.cpp\
|
||||||
|
|
||||||
# headers (for timestamp purposes)
|
# headers (for timestamp purposes)
|
||||||
CC_HDR=\
|
CHDR=\
|
||||||
src/contrib/bcrypt/bcrypt.h\
|
src/contrib/bcrypt/bcrypt.h\
|
||||||
src/contrib/bcrypt/crypt_blowfish.h\
|
src/contrib/bcrypt/crypt_blowfish.h\
|
||||||
src/contrib/bcrypt/crypt_gensalt.h\
|
src/contrib/bcrypt/crypt_gensalt.h\
|
||||||
@ -57,7 +57,7 @@ CC_HDR=\
|
|||||||
src/contrib/sqlite/sqlite3.h\
|
src/contrib/sqlite/sqlite3.h\
|
||||||
src/contrib/sqlite/sqlite3ext.h\
|
src/contrib/sqlite/sqlite3ext.h\
|
||||||
|
|
||||||
CXX_HDR=\
|
CXXHDR=\
|
||||||
src/contrib/bcrypt/BCrypt.hpp\
|
src/contrib/bcrypt/BCrypt.hpp\
|
||||||
src/contrib/sqlite/sqlite3pp.h\
|
src/contrib/sqlite/sqlite3pp.h\
|
||||||
src/contrib/sqlite/sqlite3ppext.h\
|
src/contrib/sqlite/sqlite3ppext.h\
|
||||||
@ -82,10 +82,10 @@ CXX_HDR=\
|
|||||||
src/PlayerManager.hpp\
|
src/PlayerManager.hpp\
|
||||||
src/settings.hpp\
|
src/settings.hpp\
|
||||||
|
|
||||||
CC_OBJ=$(CC_SRC:.c=.o)
|
COBJ=$(CSRC:.c=.o)
|
||||||
CXX_OBJ=$(CXX_SRC:.cpp=.o)
|
CXXOBJ=$(CXXSRC:.cpp=.o)
|
||||||
|
|
||||||
OBJ=$(CC_OBJ) $(CXX_OBJ)
|
OBJ=$(COBJ) $(CXXOBJ)
|
||||||
|
|
||||||
all: $(SERVER)
|
all: $(SERVER)
|
||||||
|
|
||||||
@ -94,22 +94,24 @@ windows: $(SERVER)
|
|||||||
# assign Windows-specific values if targeting Windows
|
# assign Windows-specific values if targeting Windows
|
||||||
windows : CC=$(WIN_CC)
|
windows : CC=$(WIN_CC)
|
||||||
windows : CXX=$(WIN_CXX)
|
windows : CXX=$(WIN_CXX)
|
||||||
windows : CCFLAGS=$(WIN_CCFLAGS)
|
windows : CFLAGS=$(WIN_CFLAGS)
|
||||||
windows : CXXFLAGS=$(WIN_CXXFLAGS)
|
windows : CXXFLAGS=$(WIN_CXXFLAGS)
|
||||||
windows : LDFLAGS=$(WIN_LDFLAGS)
|
windows : LDFLAGS=$(WIN_LDFLAGS)
|
||||||
windows : SERVER=$(WIN_SERVER)
|
windows : SERVER=$(WIN_SERVER)
|
||||||
|
|
||||||
$(CC_OBJ): %.o: %.c $(CC_HDR)
|
.SUFFIX: .o .c .cpp .hpp
|
||||||
$(CC) -c $(CCFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
$(CXX_OBJ): %.o: %.cpp $(CXX_HDR)
|
.c.o: $(CHDR)
|
||||||
|
$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
.cpp.o: $(CXXHDR)
|
||||||
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
||||||
|
|
||||||
$(SERVER): $(OBJ) $(CC_HDR) $(CXX_HDR)
|
$(SERVER): $(OBJ) $(CHDR) $(CXXHDR)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
$(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)
|
$(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)
|
||||||
|
|
||||||
.PHONY: all windows clean
|
.PHONY: all windows clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
|
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
|
||||||
|
Loading…
Reference in New Issue
Block a user