1# This is the top-level build file for the Android HW OpenGL ES emulation
2# in Android.
3#
4# You must define BUILD_EMULATOR_HOST_OPENGL to 'true' in your environment to
5# build the following files.
6#
7ifeq (true,$(BUILD_EMULATOR_HOST_OPENGL))
8
9# Top-level for all modules
10EMUGL_PATH := $(call my-dir)
11
12# Directory containing common headers used by several modules
13# This is always set to a module's LOCAL_C_INCLUDES
14# See the definition of emugl-begin-module in common.mk
15#
16EMUGL_COMMON_INCLUDES := \
17    $(EMUGL_PATH)/host/include/libOpenglRender \
18    $(EMUGL_PATH)/shared
19
20ifeq ($(BUILD_STANDALONE_EMULATOR),true)
21EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/libs/Translator/include
22endif
23
24ifeq ($(BUILD_STANDALONE_EMULATOR),true)
25EMUGL_BUILD_64BITS := $(strip $(EMULATOR_BUILD_64BITS))
26else
27EMUGL_BUILD_64BITS := true
28endif
29
30# common cflags used by several modules
31# This is always set to a module's LOCAL_CFLAGS
32# See the definition of emugl-begin-module in common.mk
33#
34EMUGL_COMMON_CFLAGS := -DWITH_GLES2
35
36# Define EMUGL_BUILD_DEBUG=1 in your environment to build a
37# debug version of the EmuGL host binaries.
38ifneq (,$(strip $(EMUGL_BUILD_DEBUG)))
39EMUGL_COMMON_CFLAGS += -O0 -g -DEMUGL_DEBUG=1
40endif
41
42# Uncomment the following line if you want to enable debug traces
43# in the GLES emulation libraries.
44# EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1
45
46# Include common definitions used by all the modules included later
47# in this build file. This contains the definition of all useful
48# emugl-xxxx functions.
49#
50include $(EMUGL_PATH)/common.mk
51
52# IMPORTANT: ORDER IS CRUCIAL HERE
53#
54# For the import/export feature to work properly, you must include
55# modules below in correct order. That is, if module B depends on
56# module A, then it must be included after module A below.
57#
58# This ensures that anything exported by module A will be correctly
59# be imported by module B when it is declared.
60#
61# Note that the build system will complain if you try to import a
62# module that hasn't been declared yet anyway.
63#
64
65# First, build the emugen host source-generation tool
66#
67# It will be used by other modules to generate wire protocol encode/decoder
68# source files (see all emugl-gen-decoder/encoder in common.mk)
69#
70include $(EMUGL_PATH)/host/tools/emugen/Android.mk
71
72# Required by our units test.
73include $(EMUGL_PATH)/googletest.mk
74
75include $(EMUGL_PATH)/shared/emugl/common/Android.mk
76include $(EMUGL_PATH)/shared/OpenglOsUtils/Android.mk
77include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk
78
79# Host static libraries
80include $(EMUGL_PATH)/host/libs/GLESv1_dec/Android.mk
81include $(EMUGL_PATH)/host/libs/GLESv2_dec/Android.mk
82include $(EMUGL_PATH)/host/libs/renderControl_dec/Android.mk
83include $(EMUGL_PATH)/tests/ut_rendercontrol_dec/Android.mk
84include $(EMUGL_PATH)/host/libs/Translator/GLcommon/Android.mk
85include $(EMUGL_PATH)/host/libs/Translator/GLES_CM/Android.mk
86include $(EMUGL_PATH)/host/libs/Translator/GLES_V2/Android.mk
87include $(EMUGL_PATH)/host/libs/Translator/EGL/Android.mk
88
89# Required to declare SDL-related flags for some host tests.
90include $(EMUGL_PATH)/sdl.mk
91
92# Host shared libraries
93include $(EMUGL_PATH)/host/libs/libOpenglRender/Android.mk
94
95# Host executables
96include $(EMUGL_PATH)/host/renderer/Android.mk
97
98# Host unit-test for the renderer.
99
100include $(EMUGL_PATH)/tests/translator_tests/MacCommon/Android.mk
101include $(EMUGL_PATH)/tests/translator_tests/GLES_CM/Android.mk
102include $(EMUGL_PATH)/tests/translator_tests/GLES_V2/Android.mk
103
104endif # BUILD_EMULATOR_HOST_OPENGL == true
105