Makefile.in 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @SET_MAKE@
  2. HAVE_MYSQL=@HAVE_MYSQL@
  3. ifeq ($(HAVE_MYSQL),yes)
  4. ALL_DEPENDS=sql tools
  5. SQL_DEPENDS=common_sql login_sql char_sql map_sql import
  6. COMMON_SQL_DEPENDS=mt19937ar libconfig
  7. LOGIN_SQL_DEPENDS=mt19937ar libconfig common_sql
  8. CHAR_SQL_DEPENDS=mt19937ar libconfig common_sql
  9. MAP_SQL_DEPENDS=mt19937ar libconfig common_sql
  10. else
  11. ALL_DEPENDS=needs_mysql
  12. SQL_DEPENDS=needs_mysql
  13. COMMON_SQL_DEPENDS=needs_mysql
  14. LOGIN_SQL_DEPENDS=needs_mysql
  15. CHAR_SQL_DEPENDS=needs_mysql
  16. MAP_SQL_DEPENDS=needs_mysql
  17. endif
  18. #####################################################################
  19. .PHONY: all sql \
  20. common_sql \
  21. mt19937ar \
  22. login_sql \
  23. char_sql \
  24. map_sql \
  25. tools \
  26. import \
  27. test \
  28. clean help \
  29. install uninstall bin-clean \
  30. all: $(ALL_DEPENDS)
  31. sql: $(SQL_DEPENDS)
  32. common_sql: $(COMMON_SQL_DEPENDS)
  33. @$(MAKE) -C src/common sql
  34. login_sql: $(LOGIN_SQL_DEPENDS)
  35. @$(MAKE) -C src/login sql
  36. char_sql: $(CHAR_SQL_DEPENDS)
  37. @$(MAKE) -C src/char
  38. map_sql: $(MAP_SQL_DEPENDS)
  39. @$(MAKE) -C src/map sql
  40. mt19937ar:
  41. @$(MAKE) -C 3rdparty/mt19937ar
  42. libconfig:
  43. @$(MAKE) -C 3rdparty/libconfig
  44. tools:
  45. @$(MAKE) -C src/tool
  46. test:
  47. @$(MAKE) -C src/test
  48. import:
  49. # 1) create conf/import folder
  50. # 2) add missing files
  51. # 3) remove remaining .svn folder
  52. @echo "building conf/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. clean:
  57. @$(MAKE) -C src/common $@
  58. @$(MAKE) -C 3rdparty/mt19937ar $@
  59. @$(MAKE) -C 3rdparty/libconfig $@
  60. @$(MAKE) -C src/login $@
  61. @$(MAKE) -C src/char $@
  62. @$(MAKE) -C src/map $@
  63. @$(MAKE) -C src/tool $@
  64. @$(MAKE) -C src/test $@
  65. help:
  66. @echo "most common targets are 'all' 'sql' 'conf' 'clean' 'help'"
  67. @echo "possible targets are:"
  68. @echo "'common_sql' - builds object files used in SQL servers"
  69. @echo "'mt19937ar' - builds object file of Mersenne Twister MT19937"
  70. @echo "'libconfig' - builds object files of libconfig"
  71. @echo "'login_sql' - builds login server (SQL version)"
  72. @echo "'char_sql' - builds char server (SQL version)"
  73. @echo "'map_sql' - builds map server (SQL version)"
  74. @echo "'tools' - builds all the tools in src/tools"
  75. @echo "'import' - builds conf/import folder from the template conf/import-tmpl"
  76. @echo "'all' - builds all the above targets"
  77. @echo "'sql' - builds sql servers (targets 'common_sql' 'login_sql' 'char_sql'"
  78. @echo " 'map_sql' and 'import')"
  79. @echo "'test' - builds tests"
  80. @echo "'clean' - cleans builds and objects"
  81. @echo "'install' - run installer wich setup rathena in /opt/"
  82. @echo "'bin-clean' - delete binary installed"
  83. @echo "'uninstall' - run uninstaller wich erase all install change"
  84. @echo "'help' - outputs this message"
  85. needs_mysql:
  86. @echo "MySQL not found or disabled by the configure script"
  87. @exit 1
  88. install:
  89. @sh ./install.sh
  90. bin-clean:
  91. @sh ./uninstall.sh bin
  92. uninstall:
  93. @sh ./uninstall.sh all
  94. #####################################################################