blob: 8df5a4914e4fc30d1e4deb2506e57252c7dcb424 [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)
16include $(CLEAR_VARS)
17
Elliott Hughes07138192015-04-10 09:40:53 -070018LOCAL_SRC_FILES := \
19 events.cpp \
Elliott Hughes07cfb8f2015-04-10 13:12:05 -070020 graphics.cpp \
Stéphane Marchesin1a92c442015-06-29 20:05:48 -070021 graphics_drm.cpp \
Elliott Hughes07cfb8f2015-04-10 13:12:05 -070022 graphics_fbdev.cpp \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050023 graphics_overlay.cpp \
Ethan Yonkerb386f712017-01-20 14:30:28 -060024 resources.cpp
Ethan Yonkera59da092015-10-13 19:35:05 -050025
26LOCAL_C_INCLUDES := external/libcxx/include external/libpng
Dees Troy62b75ab2014-05-02 13:20:33 +000027
28ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
29 LOCAL_CFLAGS += -DMSM_BSP
Ethan Yonkerb386f712017-01-20 14:30:28 -060030 LOCAL_SRC_FILES += graphics_overlay.cpp
Dees Troy62b75ab2014-05-02 13:20:33 +000031 ifeq ($(TARGET_PREBUILT_KERNEL),)
32 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
33 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
34 else
Kra1o50024e382014-12-17 01:49:00 +010035 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
36 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minui/include
37 else
38 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
39 endif
Dees Troy62b75ab2014-05-02 13:20:33 +000040 endif
41else
Matt Mower55c75ca2014-08-31 11:30:15 -050042 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minui/include
Ethan Yonkera59da092015-10-13 19:35:05 -050043 # The header files required for adf graphics can cause compile errors
44 # with adf graphics.
45 LOCAL_SRC_FILES += graphics_adf.cpp
46 LOCAL_WHOLE_STATIC_LIBRARIES += libadf
Dees Troy62b75ab2014-05-02 13:20:33 +000047endif
48
Kra1o5de50c5f2015-04-23 21:46:36 +020049ifeq ($(TW_NEW_ION_HEAP), true)
50 LOCAL_CFLAGS += -DNEW_ION_HEAP
51endif
52
Trevor Drakefee324f2015-02-26 15:57:58 +000053LOCAL_STATIC_LIBRARIES += libpng
Ethan Yonker8373cfe2017-09-08 06:50:54 -050054LOCAL_WHOLE_STATIC_LIBRARIES += \
55 libdrm
56ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
57 LOCAL_CFLAGS += -DHAS_LIBSYNC
58 LOCAL_WHOLE_STATIC_LIBRARIES += libsync_recovery
59endif
Tao Bao0ecbd762017-01-16 21:16:58 -080060
Tianjie Xu0a599562017-03-28 20:11:15 +000061LOCAL_STATIC_LIBRARIES := \
62 libpng \
63 libbase
64
Andreas Schneider75847da2017-11-02 17:53:47 +010065LOCAL_CFLAGS += -Werror -std=c++14
66LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
Tao Bao0ecbd762017-01-16 21:16:58 -080067LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Greg Hackmann41909dd2014-04-25 10:39:50 -070068
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080069LOCAL_MODULE := libminui
70
Elliott Hughes07138192015-04-10 09:40:53 -070071LOCAL_CLANG := true
Elliott Hughes01a4d082015-03-24 15:21:48 -070072
Doug Zongker9c5efe62012-07-11 13:21:02 -070073# This used to compare against values in double-quotes (which are just
74# ordinary characters in this context). Strip double-quotes from the
75# value so that either will work.
76
Tony Kuofd778e32015-02-05 21:25:56 +080077ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
78 LOCAL_CFLAGS += -DRECOVERY_ABGR
79endif
Kra1o577568592015-10-14 18:09:54 +020080ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBA_8888)
81 LOCAL_CFLAGS += -DRECOVERY_RGBA
82endif
Doug Zongker9c5efe62012-07-11 13:21:02 -070083ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
Michael Ward9d1bcdf2011-06-22 14:30:34 -070084 LOCAL_CFLAGS += -DRECOVERY_RGBX
85endif
Doug Zongker9c5efe62012-07-11 13:21:02 -070086ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
Michael Ward9d1bcdf2011-06-22 14:30:34 -070087 LOCAL_CFLAGS += -DRECOVERY_BGRA
Doug Zongkerbe3e6f12011-01-13 16:43:44 -080088endif
89
Doug Zongkerc560a672012-12-18 16:31:27 -080090ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
91 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
92else
93 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
94endif
95
Matt Mower4a5db2d2014-01-20 16:14:25 -060096ifneq ($(TW_BRIGHTNESS_PATH),)
97 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=\"$(TW_BRIGHTNESS_PATH)\"
98endif
99ifneq ($(TW_MAX_BRIGHTNESS),)
100 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
101else
102 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
103endif
104ifneq ($(TW_NO_SCREEN_BLANK),)
105 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
Ethan Chen0940e412013-10-22 13:48:50 -0700106endif
maxwen39624d42015-12-01 22:02:07 +0100107ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
108 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
109endif
Ethan Yonker39662b22017-05-23 08:34:02 -0500110ifeq ($(wildcard system/core/healthd/animation.h),)
111 TARGET_GLOBAL_CFLAGS += -DTW_NO_MINUI_CUSTOM_FONTS
112 CLANG_TARGET_GLOBAL_CFLAGS += -DTW_NO_MINUI_CUSTOM_FONTS
Ethan Yonker84d61ce2017-05-10 16:11:35 -0500113endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800114include $(BUILD_STATIC_LIBRARY)
Dees Troy62b75ab2014-05-02 13:20:33 +0000115
Ajay Dudani9905f3a2015-02-04 16:49:44 -0800116# Used by OEMs for factory test images.
Dees Troy62b75ab2014-05-02 13:20:33 +0000117include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -0700118LOCAL_CLANG := true
Dees Troy62b75ab2014-05-02 13:20:33 +0000119LOCAL_MODULE := libminui
Ajay Dudani9905f3a2015-02-04 16:49:44 -0800120LOCAL_WHOLE_STATIC_LIBRARIES += libminui
Tianjie Xu0a599562017-03-28 20:11:15 +0000121LOCAL_SHARED_LIBRARIES := \
122 libpng \
123 libbase
124
Tianjie Xu17e316c2016-09-28 11:42:17 -0700125LOCAL_CFLAGS := -Werror
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500126
Tao Bao0ecbd762017-01-16 21:16:58 -0800127LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
128LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Dees Troy62b75ab2014-05-02 13:20:33 +0000129include $(BUILD_SHARED_LIBRARY)
Ethan Yonkera59da092015-10-13 19:35:05 -0500130
131include $(CLEAR_VARS)
132LOCAL_MODULE := minuitest
133LOCAL_MODULE_TAGS := optional
134LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
135LOCAL_SRC_FILES := main.cpp
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500136LOCAL_SHARED_LIBRARIES := libbinder libminui libpng libz libutils libstdc++ libcutils liblog libm libc
Ethan Yonkera59da092015-10-13 19:35:05 -0500137LOCAL_C_INCLUDES := external/libcxx/include external/libpng
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500138ifneq ($(TARGET_ARCH), arm64)
139 ifneq ($(TARGET_ARCH), x86_64)
140 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker
141 else
142 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
143 endif
144else
145 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
146endif
Ethan Yonkera59da092015-10-13 19:35:05 -0500147include $(BUILD_EXECUTABLE)