Makefile.in 3.5 KB

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