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.

124 righe
3.1 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. # Make tests verbose
  24. # FIXME: this does not seem to work as documented
  25. #
  26. AM_TESTS_FD_REDIRECT = 9>&2
  27. #
  28. # .lolfx build rule
  29. #
  30. lolfx_gen = $(lolfx_gen_$(V))
  31. lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY))
  32. lolfx_gen_0 = @echo " LOLFX " $@;
  33. SUFFIXES += .lolfx
  34. .lolfx.o:
  35. $(lolfx_gen)
  36. $(AM_V_at)(echo "char const *"; \
  37. echo "lolfx_resource_$(basename $(filter %.lolfx, $^))" | $(SED) 's/[^a-zA-Z0-9_]/_/g'; \
  38. echo "="; \
  39. $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
  40. echo ";") \
  41. > $@.lolfx.cpp && \
  42. $(CXXCOMPILE) -xc++ -c $@.lolfx.cpp -o $@ && \
  43. exit=0 || exit=1; rm -f $@.lolfx.cpp ; exit "$$exit"
  44. # Disable on the fly compilation because emscripten doesn't support it
  45. # | $(CXXCOMPILE) -xc++ -c - -o $@
  46. #
  47. # Win32 rules
  48. #
  49. # This is here in case we forget to make clean after a Windows build
  50. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \
  51. $(noinst_PROGRAMS:%$(EXEEXT)=%.exe)
  52. #
  53. # Emscripten rules
  54. #
  55. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.data) \
  56. $(noinst_PROGRAMS:%$(EXEEXT)=%.data)
  57. #
  58. # Android rules
  59. #
  60. all-local: all-local-android
  61. clean-local: clean-local-android
  62. if LOL_USE_ANDROID
  63. all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), .$(p).androidstamp)
  64. .%.androidstamp: %$(EXEEXT)
  65. $(eval p := $(^:%$(EXEEXT)=%))
  66. $(eval d := .$(p).androiddir)
  67. rm -rf "$(d)"
  68. $(MKDIR_P) "$(d)" $(sort $(foreach f, $($(p)_DATA), "$(d)/assets/$(dir $(f))"))
  69. $(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "$(d)/assets/$(f)" &&) true
  70. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml"
  71. $(MKDIR_P) "$(d)/src/net/lolengine"
  72. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java"
  73. $(MKDIR_P) "$(d)/res/values"
  74. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml"
  75. $(MKDIR_P) "$(d)/res/drawable"
  76. cp "$(lol_srcdir)/build/android/icon.png" "$(d)/res/drawable/"
  77. $(MKDIR_P) "$(d)/libs/armeabi"
  78. $(LN_S) "$(abs_builddir)/$(p)$(EXEEXT)" "$(d)/libs/armeabi/lib$(p).so"
  79. $(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "$(d)/libs/armeabi"
  80. android update project -t android-19 -n "$(p)" -p "$(d)"
  81. ant debug -f "$(d)/build.xml"
  82. touch $@
  83. else
  84. all-local-android:
  85. endif
  86. clean-local-android:
  87. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";)
  88. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";)
  89. #
  90. # Additional rules
  91. #
  92. EXTRA_DIST += $(foreach p, $(PROGRAMS), $($(p)_DATA))
  93. .PHONY: bench lolcheck