1LOCAL_PATH:= $(call my-dir) 2 3COMMON_SWIFTSHADER_RELATIVE_PATH := $(if $(BOARD_SWIFTSHADER_RELATIVE_PATH),$(BOARD_SWIFTSHADER_RELATIVE_PATH),egl) 4 5COMMON_CFLAGS := \ 6 -DLOG_TAG=\"libEGL_swiftshader\" \ 7 -std=c++11 \ 8 -DEGLAPI= \ 9 -DEGL_EGLEXT_PROTOTYPES \ 10 -Wall \ 11 -Werror \ 12 -Wno-format \ 13 -Wno-unused-function \ 14 -Wno-unused-parameter \ 15 -Wno-implicit-exception-spec-mismatch \ 16 -Wno-implicit-fallthrough \ 17 -Wno-overloaded-virtual \ 18 -Wno-attributes \ 19 -Wno-unknown-attributes \ 20 -Wno-unknown-warning-option \ 21 -DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \ 22 -DNO_SANITIZE_FUNCTION= 23 24ifneq (16,${PLATFORM_SDK_VERSION}) 25COMMON_CFLAGS += -Xclang -fuse-init-array 26else 27COMMON_CFLAGS += -D__STDC_INT64__ 28endif 29 30COMMON_SRC_FILES := \ 31 Config.cpp \ 32 Display.cpp \ 33 Surface.cpp \ 34 libEGL.cpp \ 35 main.cpp \ 36 ../../Common/SharedLibrary.cpp 37 38COMMON_C_INCLUDES := \ 39 bionic \ 40 $(LOCAL_PATH)/../../../include \ 41 $(LOCAL_PATH)/../ \ 42 $(LOCAL_PATH)/../../ 43 44COMMON_SHARED_LIBRARIES := \ 45 libdl \ 46 liblog \ 47 libcutils \ 48 libhardware 49 50# Project Treble is introduced from Oreo MR1 51ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 27 && echo OreoMR1),OreoMR1) 52COMMON_SHARED_LIBRARIES += libnativewindow 53COMMON_STATIC_LIBRARIES += libarect 54COMMON_HEADER_LIBRARIES += libnativebase_headers 55endif 56 57# gralloc1 is introduced from N MR1 58ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25 && echo NMR1),NMR1) 59COMMON_CFLAGS += -DHAVE_GRALLOC1 60COMMON_SHARED_LIBRARIES += libsync 61endif 62 63# Marshmallow does not have stlport, but comes with libc++ by default 64ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow) 65COMMON_SHARED_LIBRARIES += libstlport 66COMMON_C_INCLUDES += external/stlport/stlport 67endif 68 69COMMON_LDFLAGS := \ 70 -Wl,--version-script=$(LOCAL_PATH)/libEGL.lds \ 71 -Wl,--gc-sections \ 72 -Wl,--hash-style=sysv 73 74include $(CLEAR_VARS) 75LOCAL_MODULE := libEGL_swiftshader_debug 76 77ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) 78LOCAL_MULTILIB := first 79endif 80 81ifeq (HasRelativePath,$(shell test $(PLATFORM_SDK_VERSION) -ge 21 && echo HasRelativePath)) 82LOCAL_MODULE_RELATIVE_PATH := $(COMMON_SWIFTSHADER_RELATIVE_PATH) 83else 84LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(COMMON_SWIFTSHADER_RELATIVE_PATH) 85endif 86 87LOCAL_VENDOR_MODULE := true 88LOCAL_MODULE_TAGS := optional 89LOCAL_CLANG := true 90LOCAL_SRC_FILES := $(COMMON_SRC_FILES) 91LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES) 92LOCAL_STATIC_LIBRARIES += swiftshader_top_debug $(COMMON_STATIC_LIBRARIES) 93LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES) 94LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES) 95LOCAL_LDFLAGS += $(COMMON_LDFLAGS) 96LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0 97include $(BUILD_SHARED_LIBRARY) 98 99include $(CLEAR_VARS) 100LOCAL_MODULE := libEGL_swiftshader 101 102ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) 103LOCAL_MULTILIB := first 104endif 105 106ifeq (HasRelativePath,$(shell test $(PLATFORM_SDK_VERSION) -ge 21 && echo HasRelativePath)) 107LOCAL_MODULE_RELATIVE_PATH := $(COMMON_SWIFTSHADER_RELATIVE_PATH) 108else 109LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(COMMON_SWIFTSHADER_RELATIVE_PATH) 110endif 111 112LOCAL_VENDOR_MODULE := true 113LOCAL_MODULE_TAGS := optional 114LOCAL_CLANG := true 115LOCAL_SRC_FILES := $(COMMON_SRC_FILES) 116LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES) 117LOCAL_STATIC_LIBRARIES += swiftshader_top_release $(COMMON_STATIC_LIBRARIES) 118LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES) 119LOCAL_HEADER_LIBRARIES := $(COMMON_HEADER_LIBRARIES) 120LOCAL_LDFLAGS += $(COMMON_LDFLAGS) 121LOCAL_CFLAGS += $(COMMON_CFLAGS) -DANGLE_DISABLE_TRACE 122include $(BUILD_SHARED_LIBRARY) 123