blob: ddec62bf9d79fb04cf5292f77834ad47491f4d23 [file] [log] [blame]
Tao Bao0ecbd762017-01-16 21:16:58 -08001# Copyright (C) 2007 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080015LOCAL_PATH := $(call my-dir)
Tao Bao99f0d9e2016-10-13 12:46:38 -070016
17# libminui (static library)
18# ===============================
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080019include $(CLEAR_VARS)
20
Elliott Hughes07138192015-04-10 09:40:53 -070021LOCAL_SRC_FILES := \
22 events.cpp \
Elliott Hughes07cfb8f2015-04-10 13:12:05 -070023 graphics.cpp \
Stéphane Marchesin1a92c442015-06-29 20:05:48 -070024 graphics_drm.cpp \
Elliott Hughes07cfb8f2015-04-10 13:12:05 -070025 graphics_fbdev.cpp \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050026 graphics_overlay.cpp \
Ethan Yonkerb386f712017-01-20 14:30:28 -060027 resources.cpp
Ethan Yonkera59da092015-10-13 19:35:05 -050028
29LOCAL_C_INCLUDES := external/libcxx/include external/libpng
Dees Troy62b75ab2014-05-02 13:20:33 +000030
31ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
32 LOCAL_CFLAGS += -DMSM_BSP
Ethan Yonkerb386f712017-01-20 14:30:28 -060033 LOCAL_SRC_FILES += graphics_overlay.cpp
Dees Troy62b75ab2014-05-02 13:20:33 +000034 ifeq ($(TARGET_PREBUILT_KERNEL),)
35 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
36 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
37 else
Kra1o50024e382014-12-17 01:49:00 +010038 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
Ethan Yonker58f21322018-08-24 11:17:36 -050039 LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
Kra1o50024e382014-12-17 01:49:00 +010040 else
41 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
42 endif
Dees Troy62b75ab2014-05-02 13:20:33 +000043 endif
44else
Ethan Yonker58f21322018-08-24 11:17:36 -050045 LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
Ethan Yonkera59da092015-10-13 19:35:05 -050046 # The header files required for adf graphics can cause compile errors
47 # with adf graphics.
48 LOCAL_SRC_FILES += graphics_adf.cpp
49 LOCAL_WHOLE_STATIC_LIBRARIES += libadf
Dees Troy62b75ab2014-05-02 13:20:33 +000050endif
51
Kra1o5de50c5f2015-04-23 21:46:36 +020052ifeq ($(TW_NEW_ION_HEAP), true)
53 LOCAL_CFLAGS += -DNEW_ION_HEAP
54endif
55
Ethan Yonker58f21322018-08-24 11:17:36 -050056LOCAL_STATIC_LIBRARIES += libpng libbase
Ethan Yonkerecbd3e82017-12-14 14:43:59 -060057ifneq ($(wildcard external/libdrm/Android.common.mk),)
58LOCAL_WHOLE_STATIC_LIBRARIES += libdrm_platform
59else
60LOCAL_WHOLE_STATIC_LIBRARIES += libdrm
61endif
Ethan Yonker8373cfe2017-09-08 06:50:54 -050062ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
63 LOCAL_CFLAGS += -DHAS_LIBSYNC
64 LOCAL_WHOLE_STATIC_LIBRARIES += libsync_recovery
65endif
Tao Bao0ecbd762017-01-16 21:16:58 -080066
Ethan Yonker58f21322018-08-24 11:17:36 -050067LOCAL_CFLAGS += -Wall -Werror -std=c++14 -Wno-unused-private-field
Andreas Schneider75847da2017-11-02 17:53:47 +010068LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
Tao Bao0ecbd762017-01-16 21:16:58 -080069LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Greg Hackmann41909dd2014-04-25 10:39:50 -070070
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080071LOCAL_MODULE := libminui
72
Elliott Hughes07138192015-04-10 09:40:53 -070073LOCAL_CLANG := true
Elliott Hughes01a4d082015-03-24 15:21:48 -070074
Doug Zongker9c5efe62012-07-11 13:21:02 -070075# This used to compare against values in double-quotes (which are just
76# ordinary characters in this context). Strip double-quotes from the
77# value so that either will work.
78
Tony Kuofd778e32015-02-05 21:25:56 +080079ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
80 LOCAL_CFLAGS += -DRECOVERY_ABGR
81endif
Kra1o577568592015-10-14 18:09:54 +020082ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBA_8888)
83 LOCAL_CFLAGS += -DRECOVERY_RGBA
84endif
Doug Zongker9c5efe62012-07-11 13:21:02 -070085ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
Michael Ward9d1bcdf2011-06-22 14:30:34 -070086 LOCAL_CFLAGS += -DRECOVERY_RGBX
87endif
Doug Zongker9c5efe62012-07-11 13:21:02 -070088ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
Michael Ward9d1bcdf2011-06-22 14:30:34 -070089 LOCAL_CFLAGS += -DRECOVERY_BGRA
Doug Zongkerbe3e6f12011-01-13 16:43:44 -080090endif
91
Doug Zongkerc560a672012-12-18 16:31:27 -080092ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
93 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
94else
95 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
96endif
97
Matt Mower4a5db2d2014-01-20 16:14:25 -060098ifneq ($(TW_BRIGHTNESS_PATH),)
99 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=\"$(TW_BRIGHTNESS_PATH)\"
100endif
101ifneq ($(TW_MAX_BRIGHTNESS),)
102 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
103else
104 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
105endif
106ifneq ($(TW_NO_SCREEN_BLANK),)
107 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
Ethan Chen0940e412013-10-22 13:48:50 -0700108endif
maxwen39624d42015-12-01 22:02:07 +0100109ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
110 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
111endif
Ethan Yonker39662b22017-05-23 08:34:02 -0500112ifeq ($(wildcard system/core/healthd/animation.h),)
113 TARGET_GLOBAL_CFLAGS += -DTW_NO_MINUI_CUSTOM_FONTS
114 CLANG_TARGET_GLOBAL_CFLAGS += -DTW_NO_MINUI_CUSTOM_FONTS
Ethan Yonker84d61ce2017-05-10 16:11:35 -0500115endif
Luke Song846012f2017-09-13 15:56:16 -0700116ifneq ($(TARGET_RECOVERY_DEFAULT_ROTATION),)
117 LOCAL_CFLAGS += -DDEFAULT_ROTATION=$(TARGET_RECOVERY_DEFAULT_ROTATION)
118else
119 LOCAL_CFLAGS += -DDEFAULT_ROTATION=ROTATION_NONE
120endif
121
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800122include $(BUILD_STATIC_LIBRARY)
Dees Troy62b75ab2014-05-02 13:20:33 +0000123
Tao Bao99f0d9e2016-10-13 12:46:38 -0700124# libminui (shared library)
125# ===============================
Ajay Dudani9905f3a2015-02-04 16:49:44 -0800126# Used by OEMs for factory test images.
Dees Troy62b75ab2014-05-02 13:20:33 +0000127include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -0700128LOCAL_CLANG := true
Dees Troy62b75ab2014-05-02 13:20:33 +0000129LOCAL_MODULE := libminui
Ajay Dudani9905f3a2015-02-04 16:49:44 -0800130LOCAL_WHOLE_STATIC_LIBRARIES += libminui
Tianjie Xu0a599562017-03-28 20:11:15 +0000131LOCAL_SHARED_LIBRARIES := \
132 libpng \
133 libbase
134
Ethan Yonker58f21322018-08-24 11:17:36 -0500135LOCAL_CFLAGS := -Wall -Werror -std=c++14 -Wno-unused-private-field
Tao Bao0ecbd762017-01-16 21:16:58 -0800136LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
137LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dees Troy62b75ab2014-05-02 13:20:33 +0000138include $(BUILD_SHARED_LIBRARY)
Ethan Yonkera59da092015-10-13 19:35:05 -0500139
140include $(CLEAR_VARS)
141LOCAL_MODULE := minuitest
142LOCAL_MODULE_TAGS := optional
143LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
144LOCAL_SRC_FILES := main.cpp
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500145LOCAL_SHARED_LIBRARIES := libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc
Ethan Yonkera59da092015-10-13 19:35:05 -0500146LOCAL_C_INCLUDES := external/libcxx/include external/libpng
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500147ifneq ($(TARGET_ARCH), arm64)
148 ifneq ($(TARGET_ARCH), x86_64)
149 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker
150 else
151 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
152 endif
153else
154 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
155endif
Ethan Yonkera59da092015-10-13 19:35:05 -0500156include $(BUILD_EXECUTABLE)