Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

150 linhas
4.2 KiB

  1. #
  2. # Define these variables from the beginning
  3. #
  4. CLEANFILES =
  5. SUFFIXES =
  6. EXTRA_DIST =
  7. #
  8. # Miscellaneous rules
  9. #
  10. lol_recursive_rule = \
  11. @if test -n "$(SUBDIRS)"; then for subdir in $(SUBDIRS); do \
  12. ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \
  13. done; fi
  14. bench: bench-recursive
  15. bench-recursive:
  16. $(lol_recursive_rule)
  17. lolcheck: lolcheck-recursive
  18. lolcheck-recursive:
  19. $(lol_recursive_rule)
  20. #
  21. # Flex and Bison files build rule
  22. #
  23. generated: generated-recursive
  24. generated-recursive:
  25. $(lol_recursive_rule)
  26. @if test -n "$(filter %-scanner.l, $(EXTRA_DIST))"; then \
  27. echo $(MKDIR_P) generated; \
  28. $(MKDIR_P) generated; \
  29. rm -f generated/[a-zA-Z]*; \
  30. for scanner in $(patsubst %-scanner.l, %, $(filter %-scanner.l, $(EXTRA_DIST))); do \
  31. b="`basename $$scanner`"; \
  32. echo flex -v -o "generated/$$b-scanner.cpp" "$$scanner-scanner.l"; \
  33. flex -v -o "generated/$$b-scanner.cpp" "$$scanner-scanner.l" || exit 1; \
  34. done; \
  35. for parser in $(patsubst %-parser.y, %, $(filter %-parser.y, $(EXTRA_DIST))); do \
  36. b="`basename $$parser`"; \
  37. echo bison -o "generated/$$b-parser.cpp" --defines="generated/$$b-parser.h" -d -b "generated/$$b" "$$parser-parser.y"; \
  38. bison -o "generated/$$b-parser.cpp" --defines="generated/$$b-parser.h" -d -b "generated/$$b" "$$parser-parser.y" || exit 1; \
  39. done; \
  40. fi
  41. #
  42. # .lolfx build rule
  43. #
  44. lolfx_gen = $(lolfx_gen_$(V))
  45. lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY))
  46. lolfx_gen_0 = @echo " LOLFX " $@;
  47. SUFFIXES += .lolfx
  48. .lolfx.o:
  49. $(lolfx_gen)
  50. $(AM_V_at)(echo "char const *"; \
  51. echo "lolfx_resource_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
  52. $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
  53. echo ";") \
  54. | $(CXXCOMPILE) -xc++ -c - -o $@
  55. #
  56. # PS3 fself support rules
  57. #
  58. fself_gen = $(fself_gen_$(V))
  59. fself_gen_ = $(fself_gen_$(AM_DEFAULT_VERBOSITY))
  60. fself_gen_0 = echo " FSELF " $${x}.self;
  61. fself_gen_1 = echo make_fself $${x}$(EXEEXT) $${x}.self;
  62. all-local: all-local-ps3
  63. all-local-ps3: $(PROGRAMS) $(noinst_PROGRAMS)
  64. @if test -n "$^"; then for x in $(^:%$(EXEEXT)=%); do \
  65. if test x$(MAKE_FSELF) != xno; then \
  66. $(fself_gen) \
  67. make_fself $${x}$(EXEEXT) $${x}.self; \
  68. fi; \
  69. done; fi
  70. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.self) \
  71. $(PROGRAMS:%$(EXEEXT)=%.elf) \
  72. $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \
  73. $(noinst_PROGRAMS:%$(EXEEXT)=%.elf)
  74. #
  75. # Win32 rules
  76. #
  77. # This is here in case we forget to make clean after a Windows build
  78. CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \
  79. $(noinst_PROGRAMS:%$(EXEEXT)=%.exe)
  80. #
  81. # Android rules
  82. #
  83. all-local: all-local-android
  84. clean-local: clean-local-android
  85. if USE_ANDROID
  86. all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), .$(p).androidstamp)
  87. .%.androidstamp: %$(EXEEXT)
  88. $(eval p := $(^:%$(EXEEXT)=%))
  89. $(eval d := .$(p).androiddir)
  90. rm -rf "$(d)"
  91. $(MKDIR_P) "$(d)" $(sort $(foreach f, $($(p)_DATA), "$(d)/assets/$(dir $(f))"))
  92. $(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "$(d)/assets/$(f)" &&) true
  93. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(top_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml"
  94. $(MKDIR_P) "$(d)/src/net/lolengine"
  95. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(top_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java"
  96. $(MKDIR_P) "$(d)/res/values"
  97. $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(top_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml"
  98. $(MKDIR_P) "$(d)/res/drawable"
  99. cp "$(top_srcdir)/build/android/icon.png" "$(d)/res/drawable/"
  100. $(MKDIR_P) "$(d)/libs/armeabi"
  101. $(LN_S) "$(abs_builddir)/$(p)$(EXEEXT)" "$(d)/libs/armeabi/lib$(p).so"
  102. $(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "$(d)/libs/armeabi"
  103. android update project -t android-9 -n "$(p)" -p "$(d)"
  104. ant debug -f "$(d)/build.xml"
  105. touch $@
  106. else
  107. all-local-android:
  108. endif
  109. clean-local-android:
  110. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";)
  111. $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";)
  112. #
  113. # Additional rules
  114. #
  115. EXTRA_DIST += $(foreach p, $(PROGRAMS), $($(p)_DATA))
  116. .PHONY: bench lolcheck generated