Makefile.in 3.5 KB

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