blob: 214d028da78d8cb8b15ccccdc1ee0f40fe24049a [file] [log] [blame]
Joe Onorato6396e702012-05-31 23:21:46 -07001# 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.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080014
Joe Onorato6396e702012-05-31 23:21:46 -070015LOCAL_PATH := $(call my-dir)
16
Tao Bao1d866052017-04-10 16:55:57 -070017# Needed by build/make/core/Makefile.
18RECOVERY_API_VERSION := 3
19RECOVERY_FSTAB_VERSION := 2
20
Tao Baof6d25962018-03-23 22:01:43 -070021# TARGET_RECOVERY_UI_LIB should be one of librecovery_ui_{default,wear,vr} or a device-specific
22# module that defines make_device() and the exact RecoveryUI class for the target. It defaults to
23# librecovery_ui_default, which uses ScreenRecoveryUI.
24TARGET_RECOVERY_UI_LIB ?= librecovery_ui_default
25
Tao Bao6a542dc2018-03-26 15:45:54 -070026recovery_common_cflags := \
27 -Wall \
28 -Werror \
29 -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
30
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070031# librecovery_ui (static library)
Tao Baod80a9982016-03-03 11:43:47 -080032# ===============================
Doug Zongker18a78e02014-07-10 07:31:46 -070033include $(CLEAR_VARS)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080034LOCAL_SRC_FILES := \
Tao Bao6a542dc2018-03-26 15:45:54 -070035 device.cpp \
Elliott Hughes9e7ae8a2015-04-09 13:40:31 -070036 screen_ui.cpp \
37 ui.cpp \
Luke Songe2bd8762017-06-12 16:08:33 -070038 vr_ui.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070039 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070041LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -070042
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070043LOCAL_STATIC_LIBRARIES := \
44 libminui \
Tao Bao2c526392018-05-03 23:01:13 -070045 libotautil \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070046 libbase
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070047
Tao Bao6a542dc2018-03-26 15:45:54 -070048LOCAL_CFLAGS := $(recovery_common_cflags)
49
Tao Bao4521b702017-06-20 18:11:21 -070050ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
51LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
52else
53LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=0
54endif
55
56ifneq ($(TARGET_RECOVERY_UI_MARGIN_WIDTH),)
57LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=$(TARGET_RECOVERY_UI_MARGIN_WIDTH)
58else
59LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=0
60endif
61
Tao Bao5f8dd992017-07-28 00:05:40 -070062ifneq ($(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD),)
63LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD)
64else
65LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=50
66endif
67
68ifneq ($(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD),)
69LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD)
70else
71LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90
72endif
73
Tao Bao0470cee2017-08-02 17:11:04 -070074ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),)
75LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE)
76else
77LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259
78endif
79
80ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),)
81LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS)
82else
83LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
84endif
85
Tao Baoeea3af32017-08-11 13:50:24 -070086ifneq ($(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS),)
87LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=$(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS)
88else
89LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=9
90endif
91
Luke Song9d4839c2017-06-23 14:33:46 -070092ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
93LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
94else
95LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0
96endif
97
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070098include $(BUILD_STATIC_LIBRARY)
99
Tao Bao9e309972018-05-11 15:13:10 -0700100# librecovery (static library)
101# ===============================
102include $(CLEAR_VARS)
103
104LOCAL_SRC_FILES := \
105 install.cpp
106
107LOCAL_CFLAGS := $(recovery_common_cflags)
108
109ifeq ($(AB_OTA_UPDATER),true)
110 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
111endif
112
113LOCAL_MODULE := librecovery
114
115LOCAL_STATIC_LIBRARIES := \
116 libminui \
117 libotautil \
118 libvintf_recovery \
119 libcrypto_utils \
120 libcrypto \
121 libbase \
122 libziparchive \
123
124include $(BUILD_STATIC_LIBRARY)
125
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700126# recovery (static executable)
127# ===============================
128include $(CLEAR_VARS)
129
130LOCAL_SRC_FILES := \
131 adb_install.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700132 fuse_sdcard_provider.cpp \
Jerry Zhang152933a2018-05-02 16:56:00 -0700133 logging.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700134 recovery.cpp \
Tao Bao6d99d4b2018-04-25 16:47:04 -0700135 recovery_main.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700136 roots.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700137
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700138LOCAL_MODULE := recovery
139
140LOCAL_FORCE_STATIC_EXECUTABLE := true
141
Tao Bao9e309972018-05-11 15:13:10 -0700142LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
143
Chih-Hung Hsieh83847e62018-03-07 21:59:52 -0800144# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
145# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
146LOCAL_USE_CLANG_LLD := false
147
Tao Bao6a542dc2018-03-26 15:45:54 -0700148LOCAL_CFLAGS := $(recovery_common_cflags)
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700149
Dan Albert1ddd3502015-02-18 15:58:15 -0800150LOCAL_C_INCLUDES += \
151 system/vold \
Adrien Grassein3cd669f2014-11-06 14:53:50 +0100152
Tao Baof6d25962018-03-23 22:01:43 -0700153LOCAL_STATIC_LIBRARIES := \
154 librecovery \
155 $(TARGET_RECOVERY_UI_LIB) \
Tao Bao6cd81682018-05-03 21:53:11 -0700156 libbootloader_message \
157 libfusesideload \
158 libminadbd \
Tao Bao9e309972018-05-11 15:13:10 -0700159 librecovery_ui \
160 libminui \
161 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -0700162 libotautil \
163 libasyncio \
164 libbatterymonitor \
Josh Gao073164f2016-08-05 15:59:05 -0700165 libcrypto_utils \
166 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -0700167 libext4_utils \
168 libfs_mgr \
169 libpng \
170 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -0700171 libvintf_recovery \
172 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800173 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700174 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -0700175 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700176 libbase \
Joe Onorato6396e702012-05-31 23:21:46 -0700177 libcutils \
Yabin Cui53e7a062016-02-17 12:21:52 -0800178 libutils \
Ying Wang4e214822013-04-09 21:41:29 -0700179 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700180 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -0700181 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -0700182
Yabin Cui53e7a062016-02-17 12:21:52 -0800183LOCAL_HAL_STATIC_LIBRARIES := libhealthd
184
Tao Bao9e309972018-05-11 15:13:10 -0700185LOCAL_REQUIRED_MODULES := \
186 e2fsdroid_static \
187 mke2fs_static \
188 mke2fs.conf
189
190ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
191ifeq ($(HOST_OS),linux)
192LOCAL_REQUIRED_MODULES += \
193 sload.f2fs \
194 mkfs.f2fs
195endif
196endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800197
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800198ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700199LOCAL_REQUIRED_MODULES += \
200 recovery-persist \
201 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800202endif
203
204include $(BUILD_EXECUTABLE)
205
Yabin Cui2f272c02016-06-24 18:22:02 -0700206include \
Alex Deymofb00d822016-11-08 15:46:07 -0800207 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700208 $(LOCAL_PATH)/minui/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700209 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700210 $(LOCAL_PATH)/tools/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700211 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700212 $(LOCAL_PATH)/updater_sample/Android.mk \