Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Android.gen.mk 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # Mesa 3-D graphics library
  2. #
  3. # Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
  4. # Copyright (C) 2010-2011 LunarG Inc.
  5. #
  6. # Permission is hereby granted, free of charge, to any person obtaining a
  7. # copy of this software and associated documentation files (the "Software"),
  8. # to deal in the Software without restriction, including without limitation
  9. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. # and/or sell copies of the Software, and to permit persons to whom the
  11. # Software is furnished to do so, subject to the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be included
  14. # in all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  22. # DEALINGS IN THE SOFTWARE.
  23. # included by core mesa Android.mk for source generation
  24. ifeq ($(LOCAL_MODULE_CLASS),)
  25. LOCAL_MODULE_CLASS := STATIC_LIBRARIES
  26. endif
  27. intermediates := $(call local-generated-sources-dir)
  28. # This is the list of auto-generated files: sources and headers
  29. sources := \
  30. main/enums.c \
  31. main/api_exec.c \
  32. main/dispatch.h \
  33. main/format_pack.c \
  34. main/format_unpack.c \
  35. main/format_info.h \
  36. main/remap_helper.h \
  37. main/get_hash.h
  38. LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
  39. LOCAL_C_INCLUDES += $(intermediates)/main
  40. ifeq ($(strip $(MESA_ENABLE_ASM)),true)
  41. ifeq ($(TARGET_ARCH),x86)
  42. sources += x86/matypes.h
  43. LOCAL_C_INCLUDES += $(intermediates)/x86
  44. endif
  45. endif
  46. sources += main/git_sha1.h
  47. sources := $(addprefix $(intermediates)/, $(sources))
  48. LOCAL_GENERATED_SOURCES += $(sources)
  49. glapi := $(MESA_TOP)/src/mapi/glapi/gen
  50. dispatch_deps := \
  51. $(wildcard $(glapi)/*.py) \
  52. $(wildcard $(glapi)/*.xml)
  53. define es-gen
  54. @mkdir -p $(dir $@)
  55. @echo "Gen ES: $(PRIVATE_MODULE) <= $(notdir $(@))"
  56. $(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
  57. endef
  58. $(intermediates)/main/git_sha1.h:
  59. @mkdir -p $(dir $@)
  60. @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
  61. $(hide) touch $@
  62. $(hide) if which git > /dev/null; then \
  63. git --git-dir $(PRIVATE_PATH)/../../.git log -n 1 --oneline | \
  64. sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
  65. > $@; \
  66. fi
  67. matypes_deps := \
  68. $(BUILD_OUT_EXECUTABLES)/mesa_gen_matypes$(BUILD_EXECUTABLE_SUFFIX) \
  69. $(LOCAL_PATH)/main/mtypes.h \
  70. $(LOCAL_PATH)/tnl/t_context.h
  71. $(intermediates)/x86/matypes.h: $(matypes_deps)
  72. @mkdir -p $(dir $@)
  73. @echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
  74. $(hide) $< > $@
  75. $(intermediates)/main/dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
  76. $(intermediates)/main/dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
  77. $(intermediates)/main/dispatch.h: $(dispatch_deps)
  78. $(call es-gen, $* -m remap_table)
  79. $(intermediates)/main/remap_helper.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/remap_helper.py
  80. $(intermediates)/main/remap_helper.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
  81. $(intermediates)/main/remap_helper.h: $(dispatch_deps)
  82. $(call es-gen, $*)
  83. $(intermediates)/main/enums.c: PRIVATE_SCRIPT :=$(MESA_PYTHON2) $(glapi)/gl_enums.py
  84. $(intermediates)/main/enums.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
  85. $(intermediates)/main/enums.c: $(dispatch_deps)
  86. $(call es-gen)
  87. $(intermediates)/main/api_exec.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_genexec.py
  88. $(intermediates)/main/api_exec.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
  89. $(intermediates)/main/api_exec.c: $(dispatch_deps)
  90. $(call es-gen)
  91. GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py
  92. $(intermediates)/main/get_hash.h: $(glapi)/gl_and_es_API.xml \
  93. $(LOCAL_PATH)/main/get_hash_params.py $(GET_HASH_GEN)
  94. @$(MESA_PYTHON2) $(GET_HASH_GEN) -f $< > $@
  95. FORMAT_INFO := $(LOCAL_PATH)/main/format_info.py
  96. format_info_deps := \
  97. $(LOCAL_PATH)/main/formats.csv \
  98. $(LOCAL_PATH)/main/format_parser.py \
  99. $(FORMAT_INFO)
  100. $(intermediates)/main/format_info.h: $(format_info_deps)
  101. @$(MESA_PYTHON2) $(FORMAT_INFO) $< > $@
  102. FORMAT_PACK := $(LOCAL_PATH)/main/format_pack.py
  103. format_pack_deps := \
  104. $(LOCAL_PATH)/main/formats.csv \
  105. $(LOCAL_PATH)/main/format_parser.py \
  106. $(FORMAT_PACK)
  107. $(intermediates)/main/format_pack.c: $(format_pack_deps)
  108. $(hide) $(MESA_PYTHON2) $(FORMAT_PACK) $< > $@
  109. FORMAT_UNPACK := $(LOCAL_PATH)/main/format_unpack.py
  110. format_unpack_deps := \
  111. $(LOCAL_PATH)/main/formats.csv \
  112. $(LOCAL_PATH)/main/format_parser.py \
  113. $(FORMAT_UNPACK)
  114. $(intermediates)/main/format_unpack.c: $(format_unpack_deps)
  115. $(hide) $(MESA_PYTHON2) $(FORMAT_UNPACK) $< > $@