Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

117 righe
3.0 KiB

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