keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 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_OPENGL to 'true' in your environment to |
| 5 | # build the following files. |
| 6 | # |
| 7 | # Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc |
| 8 | # stuff as well. |
| 9 | # |
| 10 | ifeq (true,$(BUILD_EMULATOR_OPENGL)) |
| 11 | |
| 12 | # Top-level for all modules |
| 13 | EMUGL_PATH := $(call my-dir) |
| 14 | |
| 15 | # Directory containing common headers used by several modules |
| 16 | # This is always set to a module's LOCAL_C_INCLUDES |
| 17 | # See the definition of emugl-begin-module in common.mk |
| 18 | # |
Yahan Zhou | d906928 | 2016-06-17 17:40:14 -0700 | [diff] [blame] | 19 | EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender $(EMUGL_PATH)/system/include |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 20 | |
| 21 | # common cflags used by several modules |
| 22 | # This is always set to a module's LOCAL_CFLAGS |
| 23 | # See the definition of emugl-begin-module in common.mk |
| 24 | # |
Yahan Zhou | d906928 | 2016-06-17 17:40:14 -0700 | [diff] [blame] | 25 | EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 26 | |
Lingfeng Yang | 5a8161c | 2017-05-06 01:00:03 -0700 | [diff] [blame] | 27 | ifeq (O, $(PLATFORM_VERSION_CODENAME)) |
Lingfeng Yang | 256462a | 2017-06-05 11:50:17 -0700 | [diff] [blame] | 28 | EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC |
| 29 | endif |
| 30 | |
| 31 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25 && echo isApi26OrHigher),isApi26OrHigher) |
| 32 | EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC |
Lingfeng Yang | 5a8161c | 2017-05-06 01:00:03 -0700 | [diff] [blame] | 33 | endif |
| 34 | |
Yifan Hong | 22dd0fe | 2017-06-08 17:17:17 -0700 | [diff] [blame] | 35 | ifdef IS_AT_LEAST_OPD1 |
bohu | 8b0bfc7 | 2017-05-11 02:11:51 -0700 | [diff] [blame] | 36 | EMUGL_COMMON_CFLAGS += -DEMULATOR_OPENGL_POST_O=1 |
| 37 | endif |
| 38 | |
Yahan Zhou | 52dd9f0 | 2016-07-20 14:31:33 -0700 | [diff] [blame] | 39 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 18 && echo PreJellyBeanMr2),PreJellyBeanMr2) |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 40 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 41 | EMUGL_COMMON_CFLAGS += -DHAVE_ARM_TLS_REGISTER |
| 42 | endif |
Yahan Zhou | b795a34 | 2016-07-20 16:12:02 -0700 | [diff] [blame] | 43 | endif |
| 44 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 16 && echo PreJellyBean),PreJellyBean) |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 45 | EMUGL_COMMON_CFLAGS += -DALOG_ASSERT=LOG_ASSERT |
| 46 | EMUGL_COMMON_CFLAGS += -DALOGE=LOGE |
| 47 | EMUGL_COMMON_CFLAGS += -DALOGW=LOGW |
| 48 | EMUGL_COMMON_CFLAGS += -DALOGD=LOGD |
Lingfeng Yang | e591337 | 2016-11-29 14:23:14 -0800 | [diff] [blame] | 49 | EMUGL_COMMON_CFLAGS += -DALOGV=LOGV |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 50 | endif |
| 51 | |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 52 | # Uncomment the following line if you want to enable debug traces |
| 53 | # in the GLES emulation libraries. |
| 54 | # EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1 |
| 55 | |
| 56 | # Include common definitions used by all the modules included later |
| 57 | # in this build file. This contains the definition of all useful |
| 58 | # emugl-xxxx functions. |
| 59 | # |
| 60 | include $(EMUGL_PATH)/common.mk |
| 61 | |
| 62 | # IMPORTANT: ORDER IS CRUCIAL HERE |
| 63 | # |
| 64 | # For the import/export feature to work properly, you must include |
| 65 | # modules below in correct order. That is, if module B depends on |
| 66 | # module A, then it must be included after module A below. |
| 67 | # |
| 68 | # This ensures that anything exported by module A will be correctly |
| 69 | # be imported by module B when it is declared. |
| 70 | # |
| 71 | # Note that the build system will complain if you try to import a |
| 72 | # module that hasn't been declared yet anyway. |
| 73 | # |
| 74 | |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 75 | include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk |
| 76 | |
| 77 | # System static libraries |
| 78 | include $(EMUGL_PATH)/system/GLESv1_enc/Android.mk |
| 79 | include $(EMUGL_PATH)/system/GLESv2_enc/Android.mk |
| 80 | include $(EMUGL_PATH)/system/renderControl_enc/Android.mk |
| 81 | include $(EMUGL_PATH)/system/OpenglSystemCommon/Android.mk |
| 82 | |
| 83 | # System shared libraries |
| 84 | include $(EMUGL_PATH)/system/GLESv1/Android.mk |
| 85 | include $(EMUGL_PATH)/system/GLESv2/Android.mk |
| 86 | |
| 87 | include $(EMUGL_PATH)/system/gralloc/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 88 | include $(EMUGL_PATH)/system/egl/Android.mk |
| 89 | |
| 90 | endif # BUILD_EMULATOR_OPENGL == true |