Makefile.in 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @SET_MAKE@
  2. HAVE_MYSQL=@HAVE_MYSQL@
  3. OMAP=@OMAP@
  4. ifeq ($(HAVE_MYSQL),yes)
  5. ALL_DEPENDS=server tools
  6. SERVER_DEPENDS=common login char map import
  7. COMMON_DEPENDS=libconfig yaml-cpp
  8. LOGIN_DEPENDS=libconfig common
  9. CHAR_DEPENDS=libconfig common yaml-cpp
  10. MAP_DEPENDS=libconfig common yaml-cpp
  11. else
  12. ALL_DEPENDS=needs_mysql
  13. SERVER_DEPENDS=needs_mysql
  14. COMMON_DEPENDS=needs_mysql
  15. LOGIN_DEPENDS=needs_mysql
  16. CHAR_DEPENDS=needs_mysql
  17. MAP_DEPENDS=needs_mysql
  18. endif
  19. #####################################################################
  20. .PHONY: all server sql \
  21. common \
  22. login \
  23. char \
  24. map \
  25. tools \
  26. import \
  27. clean help \
  28. install uninstall bin-clean \
  29. all: $(ALL_DEPENDS)
  30. sql: $(SERVER_DEPENDS)
  31. @echo "-!- 'make sql' is now deprecated. Please run 'make server' to continue. -!-"
  32. server: $(SERVER_DEPENDS)
  33. common: $(COMMON_DEPENDS)
  34. @$(MAKE) -C src/common server
  35. login: $(LOGIN_DEPENDS)
  36. @$(MAKE) -C src/login server
  37. char: $(CHAR_DEPENDS)
  38. @$(MAKE) -C src/char
  39. map: $(MAP_DEPENDS)
  40. @$(MAKE) -C src/map server
  41. libconfig:
  42. @$(MAKE) -C 3rdparty/libconfig
  43. tools:
  44. @$(MAKE) -C src/tool
  45. yaml-cpp:
  46. @$(MAKE) -C 3rdparty/yaml-cpp
  47. import:
  48. # 1) create conf/import folder
  49. # 2) add missing files
  50. # 3) remove remaining .svn folder
  51. @echo "building conf/import, conf/msg_conf/import and db/import folder..."
  52. @if test ! -d conf/import ; then mkdir conf/import ; fi
  53. @for f in $$(ls conf/import-tmpl) ; do if test ! -e conf/import/$$f ; then cp conf/import-tmpl/$$f conf/import ; fi ; done
  54. @rm -rf conf/import/.svn
  55. @if test ! -d conf/msg_conf/import ; then mkdir conf/msg_conf/import ; fi
  56. @for f in $$(ls conf/msg_conf/import-tmpl) ; do if test ! -e conf/msg_conf/import/$$f ; then cp conf/msg_conf/import-tmpl/$$f conf/msg_conf/import ; fi ; done
  57. @rm -rf conf/msg_conf/import/.svn
  58. @if test ! -d db/import ; then mkdir db/import ; fi
  59. @for f in $$(ls db/import-tmpl) ; do if test ! -e db/import/$$f ; then cp db/import-tmpl/$$f db/import ; fi ; done
  60. @rm -rf db/import/.svn
  61. clean:
  62. @$(MAKE) -C src/common $@
  63. @$(MAKE) -C 3rdparty/libconfig $@
  64. @$(MAKE) -C 3rdparty/yaml-cpp $@
  65. @$(MAKE) -C src/login $@
  66. @$(MAKE) -C src/char $@
  67. @$(MAKE) -C src/map $@
  68. @$(MAKE) -C src/tool $@
  69. help:
  70. @echo "most common targets are 'all' 'server' 'conf' 'clean' 'help'"
  71. @echo "possible targets are:"
  72. @echo "'common' - builds object files used for the three servers"
  73. @echo "'libconfig' - builds object files of libconfig"
  74. @echo "'yaml-cpp' - builds object files of yaml-cpp"
  75. @echo "'login' - builds login server"
  76. @echo "'char' - builds char server"
  77. @echo "'map' - builds map server"
  78. @echo "'tools' - builds all the tools in src/tools"
  79. @echo "'import' - builds conf/import, conf/msg_conf/import and db/import folders from their template folders (x-tmpl)"
  80. @echo "'all' - builds all the above targets"
  81. @echo "'server' - builds servers (targets 'common' 'login' 'char' 'map' and 'import')"
  82. @echo "'clean' - cleans builds and objects"
  83. @echo "'install' - run installer which sets up rathena in /opt/"
  84. @echo "'bin-clean' - deletes installed binaries"
  85. @echo "'uninstall' - run uninstaller which erases all installation changes"
  86. @echo "'help' - outputs this message"
  87. needs_mysql:
  88. @echo "MySQL not found or disabled by the configure script"
  89. @exit 1
  90. install:
  91. @sh ./install.sh
  92. bin-clean:
  93. @sh ./uninstall.sh bin
  94. uninstall:
  95. @sh ./uninstall.sh all
  96. #####################################################################