CC = ccache g++49
DB_VERSION = $(shell cat ../../__REVISION__)
INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
# LIST_OF_CONSTANTS BEGIN
ENABLE_GCC_AUTODEPEND = 1
# LIST_OF_CONSTANTS END
# Depend Path File
ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
DEPFILE = Depend
endif
# Project Flags
CFLAGS = -m32 -g -Wall -w -O3 -pipe -fno-rtti -fno-exceptions -Wno-long-long -pthread -D_THREAD_SAFE -std=c++11
# Version defines
CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__DB_VERSION__=\"$(DB_VERSION)\"
# Boost
INCDIR += -I../../../Extern/include/boost
# MySQL
INCDIR += -I/usr/local/include/mysql
LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a
# Project Libraries
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
# PROJECT_SRC_FILES BEGIN
CPPFILE = BlockCountry.cpp\
Cache.cpp\
ClientManager.cpp\
ClientManagerBoot.cpp\
ClientManagerEventFlag.cpp\
ClientManagerGuild.cpp\
ClientManagerHorseName.cpp\
ClientManagerLogin.cpp\
ClientManagerParty.cpp\
ClientManagerPlayer.cpp\
Config.cpp\
CsvReader.cpp\
DBManager.cpp\
GuildManager.cpp\
ItemAwardManager.cpp\
ItemIDRangeManager.cpp\
Lock.cpp\
LoginData.cpp\
Main.cpp\
Marriage.cpp\
MoneyLog.cpp\
NetBase.cpp\
Peer.cpp\
PeerBase.cpp\
PrivManager.cpp\
ProtoReader.cpp\
version.cpp
# PROJECT_SRC_FILES END
# PROJECT_OBJ_FILES BEGIN
CPPOBJS = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
CPPDEPS = $(CPPOBJS:%.o=%.d)
endif
# PROJECT_OBJ_FILES END
# Target Paths
MAIN_TARGET = $(BINDIR)/db
default: $(MAIN_TARGET)
$(MAIN_TARGET): $(CPPOBJS)
@echo linking $(MAIN_TARGET)
@$(CC) $(CFLAGS) $(LIBDIR) $(CPPOBJS) $(LIBS) -o $(MAIN_TARGET)
$(OBJDIR)/%.o: %.cpp
@echo compiling $<
@$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
@$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
@sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif
$(OBJDIR):
@mkdir $(OBJDIR)
symlink:
@ln -fs db $(BINDIR)/db_symlink
strip:
@cp $(BINDIR)/db $(BINDIR)/db
@strip $(BINDIR)/db
clean:
@rm -f $(CPPOBJS) $(BINDIR)/db*
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
# AUTO_DEPEND_CHECK BEGIN
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
sinclude $(CPPDEPS)
else
sinclude $(DEPFILE)
endif
# AUTO_DEPEND_CHECK END