makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ## --------------------------------------------------------------------
  2. ## file name: makefile
  3. ## comment: server project manage
  4. ## create date:
  5. ## author:
  6. ## copywrite: sininm game
  7. ## --------------------------------------------------------------------
  8. MAKE_DIRS :=
  9. MAKE_DIRS += bgshm
  10. MAKE_DIRS += testallshm
  11. MAKE_DIRS += testshmdll
  12. MAKE_DIRS += testshmexe
  13. CUR_DIR := $(shell pwd)
  14. server : release
  15. release :
  16. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  17. cd $$d && $(MAKE) NODEP=1; \
  18. cd $(CUR_DIR); \
  19. done
  20. release_debug :
  21. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  22. cd $$d && $(MAKE) RELEASE_DEBUG=1; \
  23. cd $(CUR_DIR); \
  24. done
  25. release_debug_asan :
  26. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  27. cd $$d && $(MAKE) RELEASE_DEBUG=1 USE_ASAN=1; \
  28. cd $(CUR_DIR); \
  29. done
  30. debug :
  31. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  32. cd $$d && $(MAKE) DEBUG=1; \
  33. cd $(CUR_DIR); \
  34. done
  35. debug_no_use_pool : make_all
  36. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  37. cd $$d && $(MAKE) DEBUG=1 NO_USE_MEMPOOL=1; \
  38. cd $(CUR_DIR); \
  39. done
  40. clean :
  41. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  42. cd $$d && $(MAKE) clean; \
  43. cd $(CUR_DIR); \
  44. done
  45. clean_debug :
  46. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  47. cd $$d && $(MAKE) clean DEBUG=1; \
  48. cd $(CUR_DIR); \
  49. done
  50. clean_release_debug : make_clean_all
  51. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  52. cd $$d && $(MAKE) clean RELEASE_DEBUG=1; \
  53. cd $(CUR_DIR); \
  54. done
  55. clean_release_debug_asan : make_clean_all
  56. for d in $(foreach d, $(MAKE_DIRS), $(d)); do \
  57. cd $$d && $(MAKE) clean RELEASE_DEBUG=1 USE_ASAN=1; \
  58. cd $(CUR_DIR); \
  59. done
  60. help:
  61. @echo 'Makefile for Leji Game Programs'
  62. @echo 'Copyright (C) 2013, 2014 sininm game'
  63. @echo 'Usage: make [TARGET]'
  64. @echo 'TARGETS:'
  65. @echo ' NODEP=1 make without generating dependencies.'
  66. @echo ' release (=make) compile and link release version.'
  67. @echo ' debug compile and link debug version.'
  68. @echo ' debug_no_use_pool compile and link debug version not use memory pool.'
  69. @echo ' release_debug compile and link release_debug version.'
  70. @echo ' clean clean release version objects and the executable file.'
  71. @echo ' clean_debug clean clean_debug version objects and the executable file.'
  72. @echo ' clean_release_debug clean clean_release_debug version objects and the executable file.'
  73. @echo ' help print this message.'
  74. @echo
  75. @echo 'Report bugs to Andrew.'