Makefile.in 3.5 KB

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