1. 1* Search for CPP = name_of_something.cpp\ or how you have in youR server
  2. 2* Add above:
  3. #Offlineshop (0 = DISABLED , 1 = ENABLED)
  4. # ENABLE_OFFLINESHOP = 1
  5. # ifeq ( $(ENABLE_OFFLINESHOP), 1 )
  6. CFLAGS += -D__ENABLE_NEW_OFFLINESHOP__
  7. # endif
  8. 3* Search for:
  9. CPPOBJS = $(CPP:%.cpp=$(OBJDIR)/%.o)
  10. 4* Add above:
  11. # ifeq ( $(ENABLE_OFFLINESHOP), 1 )
  12. CPP += OfflineshopCache.cpp ClientManagerOfflineshop.cpp
  13. # endif
  14. /*************************************************** EXAMPLE OF MY MAKEFILE *******************************************/
  15. CC = ccache c++
  16. INCDIR =
  17. LIBDIR =
  18. BINDIR = ..
  19. OBJDIR = .obj
  20. $(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)
  21. ### CFLAGS
  22. CFLAGS = -w -O3 -ggdb3 -g3 -std=c++14 -pipe -mtune=i386 -fstack-protector -static -m32 -D_THREAD_SAFE -pthread
  23. ### END
  24. ### LIBS FROM ../EXTERN and LOCAL/INCLUDE
  25. # boost (for this, you need to install boost from PuTTY. Example: pkg install boost-libs).
  26. INCDIR += -I/usr/local/include
  27. # cryptopp (if cryptopp doesn't work, you need download src cryptopp 5.6.5 from https://github.com/weidai11/cryptopp/releases/tag/CRYPTOPP_5_6_5 and recompile with your actually compiller (g++/c++).
  28. INCDIR += -I../../../extern/cryptopp/cryptopp
  29. LIBDIR += -L../../../extern/cryptopp/lib
  30. LIBS += -lcryptopp
  31. # mysql
  32. INCDIR += -I../../../extern/mysql/mysql
  33. LIBDIR += -L../../../extern/_library
  34. LIBS += -lmysqlclient -lz -pthread -lm -lssl -lcrypto
  35. ### END
  36. ### LIBS FROM ../SOURCE/LIB
  37. # libgame
  38. INCDIR += -I../../lib/libgame
  39. LIBDIR += -L../../lib/libgame/lib
  40. LIBS += -lgame
  41. # libpoly
  42. INCDIR += -I../../lib/libpoly
  43. LIBDIR += -L../../lib/libpoly/lib
  44. LIBS += -lpoly
  45. # libsql
  46. INCDIR += -I../../lib/libsql
  47. LIBDIR += -L../../lib/libsql/lib
  48. LIBS += -lsql
  49. # libthecore
  50. INCDIR += -I../../lib/libthecore
  51. LIBDIR += -L../../lib/libthecore/lib
  52. LIBS += -lthecore
  53. ### END
  54. #Offlineshop (0 = DISABLED , 1 = ENABLED)
  55. # ENABLE_OFFLINESHOP = 1
  56. # ifeq ( $(ENABLE_OFFLINESHOP), 1 )
  57. CFLAGS += -D__ENABLE_NEW_OFFLINESHOP__
  58. # endif
  59. CPP = Cache.cpp\
  60. ClientManager.cpp\
  61. ClientManagerBoot.cpp\
  62. ClientManagerEventFlag.cpp\
  63. ClientManagerGuild.cpp\
  64. ClientManagerHorseName.cpp\
  65. ClientManagerLogin.cpp\
  66. ClientManagerParty.cpp\
  67. ClientManagerPlayer.cpp\
  68. Config.cpp\
  69. CsvReader.cpp\
  70. DBManager.cpp\
  71. Grid.cpp\
  72. GuildManager.cpp\
  73. ItemAwardManager.cpp\
  74. ItemIDRangeManager.cpp\
  75. Lock.cpp\
  76. LoginData.cpp\
  77. Main.cpp\
  78. Marriage.cpp\
  79. MoneyLog.cpp\
  80. NetBase.cpp\
  81. Peer.cpp\
  82. PeerBase.cpp\
  83. PrivManager.cpp\
  84. ProtoReader.cpp\
  85. # ifeq ( $(ENABLE_OFFLINESHOP), 1 )
  86. CPP += OfflineshopCache.cpp ClientManagerOfflineshop.cpp
  87. # endif
  88. CPPOBJS = $(CPP:%.cpp=$(OBJDIR)/%.o)
  89. DB_TARGET = $(BINDIR)/db
  90. default: $(DB_TARGET)
  91. $(OBJDIR)/%.o: %.cpp
  92. @echo -e "\033[0;32m [OK] \033[0m" $<
  93. @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
  94. $(DB_TARGET): $(CPPOBJS)
  95. @echo linking $(DB_TARGET)
  96. @$(CC) $(CFLAGS) $(LIBDIR) $(CPPOBJS) $(LIBS) -o $(DB_TARGET)
  97. clean:
  98. @rm -f $(CPPOBJS) $(BINDIR)/db*