25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

125 lines
3.0 KiB

  1. # -*- coding: utf-8 -*-
  2. # vi:syntax=python
  3. #
  4. # Define these variables from the beginning
  5. #
  6. CLEANFILES =
  7. SUFFIXES =
  8. EXTRA_DIST =
  9. NULL =
  10. #
  11. # Miscellaneous rules
  12. #
  13. lol_recursive_rule = \
  14. @if test -n "$(SUBDIRS)"; then for subdir in $(SUBDIRS); do \
  15. if test "$$subdir" != "."; then \
  16. ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \
  17. fi; done; fi
  18. bench: bench-recursive
  19. bench-recursive:
  20. $(lol_recursive_rule)
  21. lolcheck: lolcheck-recursive
  22. lolcheck-recursive:
  23. $(lol_recursive_rule)
  24. #
  25. # Make tests verbose
  26. # FIXME: this does not seem to work as documented
  27. #
  28. AM_TESTS_FD_REDIRECT = 9>&2
  29. #
  30. # .lolfx build rule
  31. #
  32. lolfx_gen = $(lolfx_gen_$(V))
  33. lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY))
  34. lolfx_gen_0 = @echo " LOLFX " $@;
  35. SUFFIXES += .lolfx
  36. .lolfx.o:
  37. $(lolfx_gen)
  38. $(AM_V_at)(echo "char const *"; \
  39. echo "lolfx_resource_$(basename $(filter %.lolfx, $^))" | $(SED) 's/[^a-zA-Z0-9_]/_/g'; \
  40. echo "="; \
  41. $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
  42. echo ";") \
  43. > $@.lolfx.cpp && \
  44. $(CXXCOMPILE) -xc++ -c $@.lolfx.cpp -o $@ && \
  45. exit=0 || exit=1; rm -f $@.lolfx.cpp ; exit "$$exit"
  46. # Disable on the fly compilation because emscripten doesn't support it
  47. # | $(CXXCOMPILE) -xc++ -c - -o $@
  48. #
  49. # Win32 rules
  50. #
  51. # This is here in case we forget to make clean after a Windows build
  52. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \
  53. $(noinst_PROGRAMS:%$(EXEEXT)=%.exe)
  54. #
  55. # Emscripten rules
  56. #
  57. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.data) \
  58. $(noinst_PROGRAMS:%$(EXEEXT)=%.data)
  59. #
  60. # Android rules
  61. #
  62. all-local: all-local-android
  63. clean-local: clean-local-android
  64. if LOL_USE_ANDROID
  65. all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), .$(p).androidstamp)
  66. .%.androidstamp: %$(EXEEXT)
  67. $(eval p := $(^:%$(EXEEXT)=%))
  68. $(eval d := .$(p).androiddir)
  69. rm -rf "$(d)"
  70. $(MKDIR_P) "$(d)" $(sort $(foreach f, $($(p)_DATA), "$(d)/assets/$(dir $(f))"))
  71. $(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "$(d)/assets/$(f)" &&) true
  72. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml"
  73. $(MKDIR_P) "$(d)/src/net/lolengine"
  74. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java"
  75. $(MKDIR_P) "$(d)/res/values"
  76. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml"
  77. $(MKDIR_P) "$(d)/res/drawable"
  78. cp "$(lol_srcdir)/build/android/icon.png" "$(d)/res/drawable/"
  79. $(MKDIR_P) "$(d)/libs/armeabi"
  80. $(LN_S) "$(abs_builddir)/$(p)$(EXEEXT)" "$(d)/libs/armeabi/lib$(p).so"
  81. android update project -t android-19 -n "$(p)" -p "$(d)"
  82. ant debug -f "$(d)/build.xml"
  83. touch $@
  84. else
  85. all-local-android:
  86. endif
  87. clean-local-android:
  88. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";)
  89. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";)
  90. #
  91. # Additional rules
  92. #
  93. EXTRA_DIST += $(foreach p, $(PROGRAMS), $($(p)_DATA))
  94. .PHONY: bench lolcheck