Makefile DB:
Code
- # Makefile edit by: Grzyb.ovh
- # Nie trzeba już ręcznie wprowadzać nazw plików .cpp, ponieważ teraz wszystko jest wykrywane automatycznie!
- # You no longer need to manually enter the names of .cpp files, as everything is now detected automatically!
- # Es ist nicht mehr notwendig, die Namen von .cpp-Dateien manuell einzugeben, da jetzt alles automatisch erkannt wird!
- # Artık .cpp dosya isimlerini manuel olarak girmenize gerek yok, çünkü her şey artık otomatik olarak algılanıyor!
- CC = gcc10
- CXX = g++10
- DB_VERSION = $(shell cat ../../__REVISION__)
- INCDIR =
- LIBDIR =
- BINDIR = ..
- OBJDIR = .obj
- $(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
- ENABLE_GCC_AUTODEPEND = 1
- ENABLE_STATIC = 0
- ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
- DEPFILE = Depend
- endif
- CFLAGS = -m32 -g -Wall -O2 -pipe -fno-rtti -fno-exceptions -Wno-long-long -pthread -D_THREAD_SAFE
- CFLAGS += -Wno-deprecated-declarations -Wno-nonnull-compare -Wno-deprecated-declarations -Wno-array-bounds -Wno-address
- CFLAGS += -Wno-int-in-bool-context -Wno-format-truncation -Wno-class-memaccess
- CXXFLAGS = -std=c++20 -Wl,-rpath=/usr/local/lib/gcc10
- ifeq ($(ENABLE_STATIC), 1)
- CFLAGS += -static
- endif
- CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__DB_VERSION__=\"$(DB_VERSION)\"
- INCDIR += -I../../../Extern/include/boost
- INCDIR += -I/usr/local/include/mysql
- LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a
- INCDIR += -I/usr/local/include
- INCDIR += -I../../../Extern/include
- LIBDIR += -I../../../Extern/lib
- LIBDIR += -L../../libthecore/lib -L../../libsql -L../../libpoly -L../../libgame/lib
- LIBS += -lthecore -lsql -lpoly -lgame -lm
- LIBS += -lssl -lcrypto
- CPPFILE = $(wildcard *.cpp)
- CPPOBJS = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- CPPDEPS = $(CPPOBJS:%.o=%.d)
- endif
- MAIN_TARGET = $(BINDIR)/db_r$(DB_VERSION)
- default: $(MAIN_TARGET)
- $(MAIN_TARGET): $(CPPOBJS)
- @echo linking $(MAIN_TARGET)
- @$(CXX) $(CFLAGS) $(CXXFLAGS) $(LIBDIR) $(CPPOBJS) $(LIBS) -o $(MAIN_TARGET)
- $(OBJDIR)/%.o: %.cpp
- @echo compiling $<
- @$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCDIR) -c $< -o $@
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @$(CXX) -MM -MG -MP $(CFLAGS) $(CXXFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
- @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
- endif
- $(OBJDIR):
- @mkdir $(OBJDIR)
- symlink:
- @ln -fs db_r$(DB_VERSION) $(BINDIR)/db_symlink
- strip:
- @cp $(BINDIR)/db_r$(DB_VERSION) $(BINDIR)/db_r
- @strip $(BINDIR)/db_r
- clean:
- @rm -f $(CPPOBJS) $(BINDIR)/db_r*
- dep:
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @echo "Note: gcc autodepend is autodetected, so target dep skipped"
- else
- makedepend -f $(DEPFILE) $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) 2> /dev/null > $(DEPFILE)
- endif
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- sinclude $(CPPDEPS)
- else
- sinclude $(DEPFILE)
- endif
Makefile GAME:
Code
- # Makefile edit by: Grzyb.ovh
- # Nie trzeba już ręcznie wprowadzać nazw plików .cpp, ponieważ teraz wszystko jest wykrywane automatycznie!
- # You no longer need to manually enter the names of .cpp files, as everything is now detected automatically!
- # Es ist nicht mehr notwendig, die Namen von .cpp-Dateien manuell einzugeben, da jetzt alles automatisch erkannt wird!
- # Artık .cpp dosya isimlerini manuel olarak girmenize gerek yok, çünkü her şey artık otomatik olarak algılanıyor!
- CXX = g++10
- GAME_VERSION := $(shell cat ../../__REVISION__)
- GccMajorVersion := $(shell expr `$(CXX) -dumpversion | cut -f1 -d.`)
- GccMinorVersion := $(shell expr `$(CXX) -dumpversion | cut -f2 -d.`)
- GccMinorEGT8 := $(shell expr $(GccMinorVersion) \>= 8)
- INCDIR =
- LIBDIR =
- BINDIR = ..
- OBJDIR = .obj
- $(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
- ENABLE_GOOGLE_TEST = 0
- ENABLE_LUA_5_VERSION = 0
- ENABLE_GCC_AUTODEPEND = 1
- ENABLE_STATIC = 0
- ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
- DEPFILE = Depend
- endif
- LIBS = -lm -lmd
- CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG
- CFLAGS += -Wno-deprecated-declarations -Wno-nonnull-compare -Wno-deprecated-declarations -Wno-array-bounds -Wno-address
- CFLAGS += -Wno-int-in-bool-context -Wno-format-truncation -Wno-stringop-truncation -Wno-sign-compare -Wno-class-memaccess
- CXXFLAGS = -std=c++20 -Wl,-rpath=/usr/local/lib/gcc10
- ifeq ($(ENABLE_STATIC), 1)
- CFLAGS += -static
- endif
- ifeq ($(GccMinorEGT8), 1)
- CFLAGS += -Wno-unused-local-typedefs
- endif
- CFLAGS += -fstack-protector-all
- CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__GAME_VERSION__=\"$(GAME_VERSION)\"
- INCDIR += -I../../../Extern/include/boost
- INCDIR += -I../../../Extern/include/IL
- LIBS += ../../../Extern/lib/libIL.a\
- ../../../Extern/lib/libjasper.a\
- ../../../Extern/lib/libpng.a\
- ../../../Extern/lib/libtiff.a\
- ../../../Extern/lib/libjbig.a\
- ../../../Extern/lib/libmng.a\
- /usr/lib/liblzma.a\
- ../../../Extern/lib/liblcms.a\
- ../../../Extern/lib/libjpeg.a
- INCDIR += -I/usr/local/include/mysql
- LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a
- LIBS += ../../../Extern/lib/libcryptopp.a
- INCDIR += -I/usr/include
- LIBS += -lssl -lcrypto
- CFLAGS += -DENABLE_LUA_5_VERSION=ENABLE_LUA_5_VERSION
- ifeq ($(ENABLE_LUA_5_VERSION), 2)
- INCDIR += -I../../liblua/5.2/install/include
- LIBDIR += -L../../liblua/5.2/install/lib
- LIBS += ../../liblua/5.2/install/lib/liblua.a
- else
- INCDIR += -I../../liblua/5.0/include
- LIBDIR += -L../../liblua/5.0/lib
- LIBS += ../../liblua/5.0/lib/liblua.a ../../liblua/5.0/lib/liblualib.a
- endif
- INCDIR += -I../../../Extern/include
- INCDIR += -I/usr/local/include
- LIBDIR += -L/usr/local/lib
- LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib
- LIBS += -lthecore -lpoly -lsql -lgame
- MAINCPP = main.cpp
- CFILE = minilzo.cpp
- CPPFILE = $(filter-out main.cpp minilzo.cpp, $(wildcard *.cpp))
- COBJS = $(CFILE:%.cpp=$(OBJDIR)/%.o)
- CPPOBJS = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- CDEPS = $(COBJS:%.o=%.d)
- CPPDEPS = $(CPPOBJS:%.o=%.d)
- endif
- MAINOBJ = $(MAINCPP:%.cpp=$(OBJDIR)/%.o)
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- MAINDEPS = $(MAINOBJ:%.o=%.d)
- endif
- MAIN_TARGET = $(BINDIR)/game_r$(GAME_VERSION)
- default: $(MAIN_TARGET)
- test: $(TEST_TARGET)
- $(OBJDIR)/%.o: %.c
- @echo compiling $<
- @$(CXX) $(CFLAGS) $(INCDIR) -c $< -o $@
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @$(CXX) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
- @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
- endif
- $(OBJDIR)/%.o: %.cpp
- @echo compiling $<
- @$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCDIR) -c $< -o $@
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @$(CXX) -MM -MG -MP $(CFLAGS) $(CXXFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
- @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
- endif
- limit_time:
- @echo update limit time
- @python update_limit_time.py
- $(MAIN_TARGET): $(CPPOBJS) $(COBJS) $(MAINOBJ)
- @echo linking $(MAIN_TARGET)
- @$(CXX) $(CFLAGS) $(CXXFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(MAINOBJ) $(LIBS) -o $(MAIN_TARGET)
- symlink:
- @ln -fs game_r$(GAME_VERSION) $(BINDIR)/game_symlink
- strip:
- @cp $(MAIN_TARGET) $(BINDIR)/game_r
- @strip $(BINDIR)/game_r
- clean:
- @echo cleaning $(MAIN_TARGET) $(OBJDIR)
- @rm -f $(COBJS) $(CPPOBJS) $(MAINOBJ)
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @rm -f $(CDEPS) $(CPPDEPS) $(MAINDEPS)
- endif
- @rm -f $(BINDIR)/game_r* $(BINDIR)/test_r* $(BINDIR)/conv
- dep:
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- @echo "Note: gcc autodepend is autodetected, so target dep skipped"
- else
- makedepend -f $(DEPFILE) $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) $(CFILE) $(MAINCPP) $(TESTCPP) 2> /dev/null > $(DEPFILE)
- endif
- ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
- sinclude $(CDEPS)
- sinclude $(CPPDEPS)
- sinclude $(MAINDEPS)
- else
- sinclude $(DEPFILE)
- endif