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 | # |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 10 | # Top-level for all modules |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 11 | GOLDFISH_OPENGL_PATH := $(call my-dir) |
| 12 | |
| 13 | # There are two kinds of builds for goldfish-opengl: |
| 14 | # 1. The standard guest build, denoted by BUILD_EMULATOR_OPENGL |
| 15 | # 2. The host-side build, denoted by GOLDFISH_OPENGL_BUILD_FOR_HOST |
| 16 | # |
| 17 | # Variable controlling whether the build for goldfish-opengl |
| 18 | # libraries (including their Android.mk's) should be triggered. |
| 19 | GOLDFISH_OPENGL_SHOULD_BUILD := false |
| 20 | |
| 21 | # In the host build, some libraries have name collisions with |
| 22 | # other libraries, so we have this variable here to control |
| 23 | # adding a suffix to the names of libraries. Should be blank |
| 24 | # for the guest build. |
| 25 | GOLDFISH_OPENGL_LIB_SUFFIX := |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 26 | |
| 27 | # Directory containing common headers used by several modules |
| 28 | # This is always set to a module's LOCAL_C_INCLUDES |
| 29 | # See the definition of emugl-begin-module in common.mk |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 30 | EMUGL_COMMON_INCLUDES := $(GOLDFISH_OPENGL_PATH)/host/include/libOpenglRender $(GOLDFISH_OPENGL_PATH)/system/include |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 31 | |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 32 | # This is always set to a module's LOCAL_CFLAGS |
| 33 | # See the definition of emugl-begin-module in common.mk |
Gurchetan Singh | cb79088 | 2021-12-06 09:42:42 -0800 | [diff] [blame] | 34 | EMUGL_COMMON_CFLAGS := |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 35 | |
Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 36 | # Whether or not to build the Vulkan library. |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 37 | GFXSTREAM := false |
Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 38 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 39 | # Host build |
| 40 | ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST)) |
| 41 | |
| 42 | GOLDFISH_OPENGL_SHOULD_BUILD := true |
| 43 | GOLDFISH_OPENGL_LIB_SUFFIX := _host |
| 44 | |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 45 | GFXSTREAM := true |
Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 46 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 47 | # Set modern defaults for the codename, version, etc. |
| 48 | PLATFORM_VERSION_CODENAME:=Q |
| 49 | PLATFORM_SDK_VERSION:=29 |
| 50 | IS_AT_LEAST_OPD1:=true |
| 51 | |
| 52 | # The host-side Android framework implementation |
| 53 | HOST_EMUGL_PATH := $(GOLDFISH_OPENGL_PATH)/../../../external/qemu/android/android-emugl |
| 54 | EMUGL_COMMON_INCLUDES += $(HOST_EMUGL_PATH)/guest |
| 55 | |
| 56 | EMUGL_COMMON_CFLAGS += \ |
| 57 | -DPLATFORM_SDK_VERSION=29 \ |
| 58 | -DGOLDFISH_HIDL_GRALLOC \ |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 59 | -DHOST_BUILD \ |
| 60 | -DANDROID \ |
| 61 | -DGL_GLEXT_PROTOTYPES \ |
Lingfeng Yang | e38d15c | 2018-09-24 16:24:01 -0700 | [diff] [blame] | 62 | -fvisibility=default \ |
Lingfeng Yang | 2ed17d4 | 2018-09-27 08:04:08 -0700 | [diff] [blame] | 63 | -DPAGE_SIZE=4096 \ |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 64 | -DGFXSTREAM \ |
Aurimas Liutikas | acc4874 | 2018-12-20 15:06:46 -0800 | [diff] [blame] | 65 | -Wno-unused-parameter |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 66 | |
| 67 | endif # GOLDFISH_OPENGL_BUILD_FOR_HOST |
| 68 | |
| 69 | ifeq (true,$(BUILD_EMULATOR_OPENGL)) # Guest build |
| 70 | |
| 71 | GOLDFISH_OPENGL_SHOULD_BUILD := true |
| 72 | |
| 73 | EMUGL_COMMON_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 74 | |
Lingfeng Yang | 5a8161c | 2017-05-06 01:00:03 -0700 | [diff] [blame] | 75 | ifeq (O, $(PLATFORM_VERSION_CODENAME)) |
Lingfeng Yang | 256462a | 2017-06-05 11:50:17 -0700 | [diff] [blame] | 76 | EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC |
| 77 | endif |
| 78 | |
| 79 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25 && echo isApi26OrHigher),isApi26OrHigher) |
| 80 | EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC |
Lingfeng Yang | 5a8161c | 2017-05-06 01:00:03 -0700 | [diff] [blame] | 81 | endif |
| 82 | |
Yahan Zhou | 52dd9f0 | 2016-07-20 14:31:33 -0700 | [diff] [blame] | 83 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 18 && echo PreJellyBeanMr2),PreJellyBeanMr2) |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 84 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 85 | EMUGL_COMMON_CFLAGS += -DHAVE_ARM_TLS_REGISTER |
| 86 | endif |
Yahan Zhou | b795a34 | 2016-07-20 16:12:02 -0700 | [diff] [blame] | 87 | endif |
| 88 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 16 && echo PreJellyBean),PreJellyBean) |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 89 | EMUGL_COMMON_CFLAGS += -DALOG_ASSERT=LOG_ASSERT |
| 90 | EMUGL_COMMON_CFLAGS += -DALOGE=LOGE |
| 91 | EMUGL_COMMON_CFLAGS += -DALOGW=LOGW |
| 92 | EMUGL_COMMON_CFLAGS += -DALOGD=LOGD |
Lingfeng Yang | e591337 | 2016-11-29 14:23:14 -0800 | [diff] [blame] | 93 | EMUGL_COMMON_CFLAGS += -DALOGV=LOGV |
Yahan Zhou | da1c76d | 2016-06-23 13:58:09 -0700 | [diff] [blame] | 94 | endif |
| 95 | |
Lingfeng Yang | a408541 | 2018-11-01 20:19:46 -0700 | [diff] [blame] | 96 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27 && echo isApi28OrHigher),isApi28OrHigher) |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 97 | GFXSTREAM := true |
| 98 | EMUGL_COMMON_CFLAGS += -DGFXSTREAM |
Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 99 | endif |
| 100 | |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 101 | # Include common definitions used by all the modules included later |
| 102 | # in this build file. This contains the definition of all useful |
| 103 | # emugl-xxxx functions. |
| 104 | # |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 105 | include $(GOLDFISH_OPENGL_PATH)/common.mk |
| 106 | |
| 107 | endif # BUILD_EMULATOR_OPENGL (guest build) |
| 108 | |
| 109 | ifeq (true,$(GOLDFISH_OPENGL_SHOULD_BUILD)) |
| 110 | |
| 111 | # Uncomment the following line if you want to enable debug traces |
| 112 | # in the GLES emulation libraries. |
| 113 | # EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1 |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 114 | |
| 115 | # IMPORTANT: ORDER IS CRUCIAL HERE |
| 116 | # |
| 117 | # For the import/export feature to work properly, you must include |
| 118 | # modules below in correct order. That is, if module B depends on |
| 119 | # module A, then it must be included after module A below. |
| 120 | # |
| 121 | # This ensures that anything exported by module A will be correctly |
| 122 | # be imported by module B when it is declared. |
| 123 | # |
| 124 | # Note that the build system will complain if you try to import a |
| 125 | # module that hasn't been declared yet anyway. |
| 126 | # |
Roman Kiryanov | b488e62 | 2020-05-19 18:07:23 -0700 | [diff] [blame] | 127 | include $(GOLDFISH_OPENGL_PATH)/shared/qemupipe/Android.mk |
| 128 | include $(GOLDFISH_OPENGL_PATH)/shared/gralloc_cb/Android.mk |
Roman Kiryanov | 1ef59e4 | 2020-05-11 15:50:11 -0700 | [diff] [blame] | 129 | include $(GOLDFISH_OPENGL_PATH)/shared/GoldfishAddressSpace/Android.mk |
Lingfeng Yang | ed069c5 | 2020-09-03 19:11:02 -0700 | [diff] [blame] | 130 | |
| 131 | ifeq (true,$(GFXSTREAM)) # android-emu |
| 132 | include $(GOLDFISH_OPENGL_PATH)/android-emu/Android.mk |
| 133 | endif |
| 134 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 135 | include $(GOLDFISH_OPENGL_PATH)/shared/OpenglCodecCommon/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 136 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 137 | # Encoder shared libraries |
| 138 | include $(GOLDFISH_OPENGL_PATH)/system/GLESv1_enc/Android.mk |
| 139 | include $(GOLDFISH_OPENGL_PATH)/system/GLESv2_enc/Android.mk |
| 140 | include $(GOLDFISH_OPENGL_PATH)/system/renderControl_enc/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 141 | |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 142 | ifeq (true,$(GFXSTREAM)) # Vulkan libs |
Lingfeng Yang | 6a28367 | 2018-11-01 13:37:56 -0700 | [diff] [blame] | 143 | include $(GOLDFISH_OPENGL_PATH)/system/vulkan_enc/Android.mk |
| 144 | endif |
| 145 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 146 | include $(GOLDFISH_OPENGL_PATH)/system/OpenglSystemCommon/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 147 | |
Yahan Zhou | 4719ae9 | 2021-06-24 13:30:56 -0700 | [diff] [blame] | 148 | # Profiler library |
| 149 | include $(GOLDFISH_OPENGL_PATH)/system/profiler/Android.mk |
| 150 | |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 151 | # System shared libraries |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 152 | include $(GOLDFISH_OPENGL_PATH)/system/GLESv1/Android.mk |
| 153 | include $(GOLDFISH_OPENGL_PATH)/system/GLESv2/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 154 | |
Lingfeng Yang | 2ed17d4 | 2018-09-27 08:04:08 -0700 | [diff] [blame] | 155 | include $(GOLDFISH_OPENGL_PATH)/system/gralloc/Android.mk |
Lingfeng Yang | b65946f | 2020-02-04 10:49:07 -0800 | [diff] [blame] | 156 | |
| 157 | ifneq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST)) |
Roman Kiryanov | efb1058 | 2020-01-29 16:28:15 -0800 | [diff] [blame] | 158 | include $(GOLDFISH_OPENGL_PATH)/system/hals/Android.mk |
Lingfeng Yang | b65946f | 2020-02-04 10:49:07 -0800 | [diff] [blame] | 159 | endif |
| 160 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 161 | include $(GOLDFISH_OPENGL_PATH)/system/egl/Android.mk |
keunyoung | b85b275 | 2013-03-08 12:28:03 -0800 | [diff] [blame] | 162 | |
Lingfeng Yang | 6f9871b | 2020-08-17 15:46:53 -0700 | [diff] [blame] | 163 | ifeq (true,$(GFXSTREAM)) # Vulkan libs |
Lingfeng Yang | d744704 | 2018-10-25 11:09:18 -0700 | [diff] [blame] | 164 | include $(GOLDFISH_OPENGL_PATH)/system/vulkan/Android.mk |
| 165 | endif |
Lingfeng Yang | a89af50 | 2018-10-18 13:46:20 -0700 | [diff] [blame] | 166 | |
huans | d96d5bd | 2018-10-15 14:32:46 -0700 | [diff] [blame] | 167 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 28 -o $(IS_AT_LEAST_QPR1) = true && echo isApi29OrHigher),isApi29OrHigher) |
| 168 | # HWC2 enabled after P |
| 169 | include $(GOLDFISH_OPENGL_PATH)/system/hwc2/Android.mk |
Roman Kiryanov | f0ae38e | 2020-05-19 17:25:11 +0000 | [diff] [blame] | 170 | # hardware codecs enabled after P |
| 171 | include $(GOLDFISH_OPENGL_PATH)/system/codecs/omx/common/Android.mk |
| 172 | include $(GOLDFISH_OPENGL_PATH)/system/codecs/omx/plugin/Android.mk |
| 173 | include $(GOLDFISH_OPENGL_PATH)/system/codecs/omx/avcdec/Android.mk |
| 174 | include $(GOLDFISH_OPENGL_PATH)/system/codecs/omx/vpxdec/Android.mk |
huans | d96d5bd | 2018-10-15 14:32:46 -0700 | [diff] [blame] | 175 | endif |
| 176 | |
Lingfeng Yang | 4fa970a | 2018-09-24 07:53:40 -0700 | [diff] [blame] | 177 | endif |