Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 2 | |
Greg Hartman | d5411c8 | 2018-08-29 18:58:40 -0700 | [diff] [blame] | 3 | COMMON_SWIFTSHADER_RELATIVE_PATH := $(if $(BOARD_SWIFTSHADER_RELATIVE_PATH),$(BOARD_SWIFTSHADER_RELATIVE_PATH),egl) |
| 4 | |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 5 | COMMON_CFLAGS := \ |
| 6 | -DLOG_TAG=\"libGLES_CM_swiftshader\" \ |
| 7 | -std=c++11 \ |
| 8 | -fno-operator-names \ |
| 9 | -msse2 \ |
| 10 | -D__STDC_CONSTANT_MACROS \ |
| 11 | -D__STDC_LIMIT_MACROS \ |
| 12 | -DEGLAPI= \ |
| 13 | -DGL_API= \ |
| 14 | -DGL_APICALL= \ |
Greg Hartman | 84c9cf0 | 2015-05-15 11:44:11 -0700 | [diff] [blame] | 15 | -DGL_GLEXT_PROTOTYPES \ |
Chih-Hung Hsieh | 4be9171 | 2017-10-11 14:23:57 -0700 | [diff] [blame] | 16 | -Wall \ |
| 17 | -Werror \ |
| 18 | -Wno-format \ |
| 19 | -Wno-format-extra-args \ |
Greg Hartman | 850c946 | 2015-06-11 16:24:48 -0700 | [diff] [blame] | 20 | -Wno-unused-parameter \ |
Chih-Hung Hsieh | 4be9171 | 2017-10-11 14:23:57 -0700 | [diff] [blame] | 21 | -Wno-unused-variable \ |
Greg Hartman | 850c946 | 2015-06-11 16:24:48 -0700 | [diff] [blame] | 22 | -Wno-implicit-exception-spec-mismatch \ |
Nicolas Capens | 7cfb50c | 2018-12-08 12:35:32 -0800 | [diff] [blame] | 23 | -Wno-implicit-fallthrough \ |
Greg Hartman | 10b57d4 | 2017-03-14 15:23:41 -0700 | [diff] [blame] | 24 | -Wno-overloaded-virtual \ |
Nicolas Capens | dc20933 | 2017-08-04 09:40:46 -0400 | [diff] [blame] | 25 | -Wno-attributes \ |
| 26 | -Wno-unknown-attributes \ |
| 27 | -Wno-unknown-warning-option \ |
Greg Hartman | 10b57d4 | 2017-03-14 15:23:41 -0700 | [diff] [blame] | 28 | -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
Greg Hartman | 3b876b9 | 2015-12-01 20:07:21 -0800 | [diff] [blame] | 29 | |
| 30 | ifneq (16,${PLATFORM_SDK_VERSION}) |
| 31 | COMMON_CFLAGS += -Xclang -fuse-init-array |
| 32 | else |
| 33 | COMMON_CFLAGS += -D__STDC_INT64__ |
| 34 | endif |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 35 | |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 36 | COMMON_SRC_FILES := \ |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 37 | Buffer.cpp \ |
| 38 | Context.cpp \ |
| 39 | Device.cpp \ |
| 40 | Framebuffer.cpp \ |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 41 | IndexDataManager.cpp \ |
| 42 | libGLES_CM.cpp \ |
| 43 | main.cpp \ |
| 44 | Renderbuffer.cpp \ |
| 45 | ResourceManager.cpp \ |
| 46 | Texture.cpp \ |
| 47 | utilities.cpp \ |
Alexis Hetu | 0ab9f3b | 2018-11-26 17:25:23 -0500 | [diff] [blame] | 48 | VertexDataManager.cpp \ |
| 49 | ../../Common/SharedLibrary.cpp |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 50 | |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 51 | COMMON_C_INCLUDES := \ |
Greg Hartman | 127fac3 | 2015-05-27 22:16:36 -0700 | [diff] [blame] | 52 | bionic \ |
Nicolas Capens | b7510aa | 2016-05-16 13:16:32 -0400 | [diff] [blame] | 53 | $(LOCAL_PATH)/../../../include \ |
Nicolas Capens | 9c025c0 | 2015-12-07 20:58:40 -0500 | [diff] [blame] | 54 | $(LOCAL_PATH)/../ \ |
| 55 | $(LOCAL_PATH)/../../ \ |
Nicolas Capens | 9c025c0 | 2015-12-07 20:58:40 -0500 | [diff] [blame] | 56 | $(LOCAL_PATH)/../../Renderer/ \ |
| 57 | $(LOCAL_PATH)/../../Common/ \ |
| 58 | $(LOCAL_PATH)/../../Shader/ \ |
| 59 | $(LOCAL_PATH)/../../Main/ |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 60 | |
Logan Chien | 6c9fb0e | 2019-02-26 13:39:52 +0800 | [diff] [blame] | 61 | ifeq ($(REACTOR_USE_SUBZERO),true) |
Nicolas Capens | 1ba2611 | 2017-05-02 11:57:06 -0400 | [diff] [blame] | 62 | COMMON_STATIC_LIBRARIES := libsubzero |
| 63 | else |
Ben Clayton | d632e6d | 2019-04-12 16:51:47 -0400 | [diff] [blame] | 64 | COMMON_STATIC_LIBRARIES := libLLVM7_swiftshader |
Nicolas Capens | 1ba2611 | 2017-05-02 11:57:06 -0400 | [diff] [blame] | 65 | endif |
Greg Hartman | c363dab | 2015-03-20 13:04:51 -0700 | [diff] [blame] | 66 | |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 67 | COMMON_SHARED_LIBRARIES := \ |
| 68 | libdl \ |
| 69 | liblog \ |
| 70 | libcutils \ |
Greg Hartman | d2cde9c | 2016-02-23 20:08:48 -0800 | [diff] [blame] | 71 | libhardware |
Nicolas Capens | 9c025c0 | 2015-12-07 20:58:40 -0500 | [diff] [blame] | 72 | |
Greg Hartman | 7e45f6d | 2018-03-16 00:02:23 -0700 | [diff] [blame] | 73 | # Project Treble is introduced from Oreo MR1 |
| 74 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27 && echo OreoMR1),OreoMR1) |
Nicolas Capens | c33b473 | 2017-08-03 15:53:25 -0400 | [diff] [blame] | 75 | COMMON_SHARED_LIBRARIES += libnativewindow |
Jiyong Park | a114ed5 | 2017-08-18 19:07:26 +0900 | [diff] [blame] | 76 | COMMON_STATIC_LIBRARIES += libarect |
| 77 | COMMON_HEADER_LIBRARIES := libnativebase_headers |
Nicolas Capens | c33b473 | 2017-08-03 15:53:25 -0400 | [diff] [blame] | 78 | endif |
| 79 | |
Jaesung Chung | fccddfe | 2017-06-22 20:02:09 +0900 | [diff] [blame] | 80 | # gralloc1 is introduced from N MR1 |
| 81 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1) |
| 82 | COMMON_CFLAGS += -DHAVE_GRALLOC1 |
| 83 | COMMON_SHARED_LIBRARIES += libsync |
| 84 | endif |
| 85 | |
Nicolas Capens | 9c025c0 | 2015-12-07 20:58:40 -0500 | [diff] [blame] | 86 | # Marshmallow does not have stlport, but comes with libc++ by default |
| 87 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow) |
| 88 | COMMON_SHARED_LIBRARIES += libstlport |
| 89 | COMMON_C_INCLUDES += external/stlport/stlport |
| 90 | endif |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 91 | |
| 92 | COMMON_LDFLAGS := \ |
Nicolas Capens | e75d334 | 2017-10-06 11:24:13 -0400 | [diff] [blame] | 93 | -Wl,--version-script=$(LOCAL_PATH)/libGLES_CM.lds \ |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 94 | -Wl,--gc-sections \ |
Greg Hartman | 394b707 | 2015-04-30 15:44:11 -0700 | [diff] [blame] | 95 | -Wl,--hash-style=sysv |
| 96 | |
| 97 | include $(CLEAR_VARS) |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 98 | LOCAL_MODULE := libGLESv1_CM_swiftshader_debug |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 99 | |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 100 | ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) |
| 101 | LOCAL_MULTILIB := first |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 102 | endif |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 103 | |
| 104 | ifeq (HasRelativePath,$(shell test $(PLATFORM_SDK_VERSION) -ge 21 && echo HasRelativePath)) |
Greg Hartman | d5411c8 | 2018-08-29 18:58:40 -0700 | [diff] [blame] | 105 | LOCAL_MODULE_RELATIVE_PATH := $(COMMON_SWIFTSHADER_RELATIVE_PATH) |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 106 | else |
Greg Hartman | d5411c8 | 2018-08-29 18:58:40 -0700 | [diff] [blame] | 107 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(COMMON_SWIFTSHADER_RELATIVE_PATH) |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 108 | endif |
| 109 | |
Tomasz Wiszkowski | 8507f32 | 2018-02-12 09:05:31 -0800 | [diff] [blame] | 110 | LOCAL_VENDOR_MODULE := true |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 111 | LOCAL_MODULE_TAGS := optional |
| 112 | LOCAL_CLANG := true |
| 113 | LOCAL_SRC_FILES += $(COMMON_SRC_FILES) |
| 114 | LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES) |
| 115 | LOCAL_STATIC_LIBRARIES += swiftshader_top_debug $(COMMON_STATIC_LIBRARIES) |
| 116 | LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES) |
Jiyong Park | a114ed5 | 2017-08-18 19:07:26 +0900 | [diff] [blame] | 117 | LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES) |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 118 | LOCAL_LDFLAGS += $(COMMON_LDFLAGS) |
| 119 | LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0 |
| 120 | include $(BUILD_SHARED_LIBRARY) |
| 121 | |
| 122 | include $(CLEAR_VARS) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 123 | LOCAL_MODULE := libGLESv1_CM_swiftshader |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 124 | |
Victor Khimenko | 6817e15 | 2016-09-30 21:31:01 +0200 | [diff] [blame] | 125 | ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) |
| 126 | LOCAL_MULTILIB := first |
Victor Khimenko | 6817e15 | 2016-09-30 21:31:01 +0200 | [diff] [blame] | 127 | endif |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 128 | |
| 129 | ifeq (HasRelativePath,$(shell test $(PLATFORM_SDK_VERSION) -ge 21 && echo HasRelativePath)) |
Greg Hartman | d5411c8 | 2018-08-29 18:58:40 -0700 | [diff] [blame] | 130 | LOCAL_MODULE_RELATIVE_PATH := $(COMMON_SWIFTSHADER_RELATIVE_PATH) |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 131 | else |
Greg Hartman | d5411c8 | 2018-08-29 18:58:40 -0700 | [diff] [blame] | 132 | LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(COMMON_SWIFTSHADER_RELATIVE_PATH) |
Greg Hartman | f7a3ff0 | 2018-03-16 11:50:19 -0700 | [diff] [blame] | 133 | endif |
| 134 | |
Tomasz Wiszkowski | 8507f32 | 2018-02-12 09:05:31 -0800 | [diff] [blame] | 135 | LOCAL_VENDOR_MODULE := true |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 136 | LOCAL_MODULE_TAGS := optional |
| 137 | LOCAL_CLANG := true |
| 138 | LOCAL_SRC_FILES += $(COMMON_SRC_FILES) |
| 139 | LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES) |
Greg Hartman | cd4fe6a | 2017-02-08 10:55:05 -0800 | [diff] [blame] | 140 | LOCAL_STATIC_LIBRARIES += swiftshader_top_release $(COMMON_STATIC_LIBRARIES) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 141 | LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES) |
Jiyong Park | a114ed5 | 2017-08-18 19:07:26 +0900 | [diff] [blame] | 142 | LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 143 | LOCAL_LDFLAGS += $(COMMON_LDFLAGS) |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 144 | LOCAL_CFLAGS += \ |
| 145 | $(COMMON_CFLAGS) \ |
| 146 | -fomit-frame-pointer \ |
| 147 | -ffunction-sections \ |
| 148 | -fdata-sections \ |
| 149 | -DANGLE_DISABLE_TRACE |
Greg Hartman | 8527e47 | 2015-11-02 13:08:12 -0800 | [diff] [blame] | 150 | include $(BUILD_SHARED_LIBRARY) |