1LOCAL_PATH:= $(call my-dir)
2
3COMMON_CFLAGS := \
4	-DLOG_TAG=\"libEGL_swiftshader\" \
5	-std=c++11 \
6	-DEGLAPI= \
7	-DEGL_EGLEXT_PROTOTYPES \
8	-Wno-unused-parameter \
9	-Wno-implicit-exception-spec-mismatch \
10	-Wno-overloaded-virtual \
11	-DANDROID_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
12
13ifneq (16,${PLATFORM_SDK_VERSION})
14COMMON_CFLAGS += -Xclang -fuse-init-array
15else
16COMMON_CFLAGS += -D__STDC_INT64__
17endif
18
19COMMON_SRC_FILES := \
20	Config.cpp \
21	Display.cpp \
22	Surface.cpp \
23	libEGL.cpp \
24	main.cpp
25
26COMMON_C_INCLUDES := \
27	bionic \
28	$(LOCAL_PATH)/../../../include \
29	$(LOCAL_PATH)/../ \
30	$(LOCAL_PATH)/../../
31
32COMMON_STATIC_LIBRARIES := \
33	libLLVM_swiftshader \
34	libnativewindow
35
36COMMON_SHARED_LIBRARIES := \
37	libdl \
38	liblog \
39	libcutils \
40	libhardware
41
42# Marshmallow does not have stlport, but comes with libc++ by default
43ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
44COMMON_SHARED_LIBRARIES += libstlport
45COMMON_C_INCLUDES += external/stlport/stlport
46endif
47
48COMMON_LDFLAGS := \
49	-Wl,--version-script=$(LOCAL_PATH)/exports.map \
50	-Wl,--hash-style=sysv
51
52include $(CLEAR_VARS)
53LOCAL_MODULE := libEGL_swiftshader_debug
54ifdef TARGET_2ND_ARCH
55ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
56LOCAL_MULTILIB := first
57LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/egl
58else
59LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/egl
60LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/egl
61endif
62else
63LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/egl
64endif
65LOCAL_MODULE_TAGS := optional
66LOCAL_CLANG := true
67LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
68LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
69LOCAL_STATIC_LIBRARIES += swiftshader_top_debug $(COMMON_STATIC_LIBRARIES)
70LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
71LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
72LOCAL_CFLAGS += $(COMMON_CFLAGS) -UNDEBUG -g -O0
73include $(BUILD_SHARED_LIBRARY)
74
75include $(CLEAR_VARS)
76LOCAL_MODULE := libEGL_swiftshader
77ifdef TARGET_2ND_ARCH
78ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
79LOCAL_MULTILIB := first
80LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/egl
81else
82LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/egl
83LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/egl
84endif
85else
86LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/egl
87endif
88LOCAL_MODULE_TAGS := optional
89LOCAL_CLANG := true
90LOCAL_SRC_FILES := $(COMMON_SRC_FILES)
91LOCAL_C_INCLUDES += $(COMMON_C_INCLUDES)
92LOCAL_STATIC_LIBRARIES += swiftshader_top_release $(COMMON_STATIC_LIBRARIES)
93LOCAL_SHARED_LIBRARIES += $(COMMON_SHARED_LIBRARIES)
94LOCAL_LDFLAGS += $(COMMON_LDFLAGS)
95LOCAL_CFLAGS += $(COMMON_CFLAGS) -DANGLE_DISABLE_TRACE
96include $(BUILD_SHARED_LIBRARY)
97