blob: b25c1f07aa74087f454214af497405f793b790f5 [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 Baof7e80122018-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
Tao Bao42c45e22018-07-31 09:37:12 -070031# librecovery_ui_ext (shared library)
32# ===================================
33include $(CLEAR_VARS)
34
35LOCAL_MODULE := librecovery_ui_ext
36
37# LOCAL_MODULE_PATH for shared libraries is unsupported in multiarch builds.
38LOCAL_MULTILIB := first
39
40ifeq ($(TARGET_IS_64_BIT),true)
41LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib64
42else
43LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib
44endif
45
46LOCAL_WHOLE_STATIC_LIBRARIES := \
47 $(TARGET_RECOVERY_UI_LIB)
48
49LOCAL_SHARED_LIBRARIES := \
50 libbase \
51 liblog \
52 librecovery_ui
53
54include $(BUILD_SHARED_LIBRARY)
55
56# librecovery_ui (shared library)
57# ===============================
58include $(CLEAR_VARS)
59LOCAL_SRC_FILES := \
60 device.cpp \
61 screen_ui.cpp \
62 ui.cpp \
63 vr_ui.cpp \
64 wear_ui.cpp
65
66LOCAL_MODULE := librecovery_ui
67
68LOCAL_CFLAGS := $(recovery_common_cflags)
69
70LOCAL_MULTILIB := first
71
72ifeq ($(TARGET_IS_64_BIT),true)
73LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib64
74else
75LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib
76endif
77
78LOCAL_STATIC_LIBRARIES := \
79 libminui \
80 libotautil \
81
82LOCAL_SHARED_LIBRARIES := \
83 libbase \
84 libpng \
85 libz \
86
87include $(BUILD_SHARED_LIBRARY)
88
Tianjie Xuba0460c2018-03-20 16:07:39 -070089# librecovery_ui (static library)
Tao Baod80a9982016-03-03 11:43:47 -080090# ===============================
Doug Zongker18a78e02014-07-10 07:31:46 -070091include $(CLEAR_VARS)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080092LOCAL_SRC_FILES := \
Tao Bao6a542dc2018-03-26 15:45:54 -070093 device.cpp \
Elliott Hughes9e7ae8a2015-04-09 13:40:31 -070094 screen_ui.cpp \
95 ui.cpp \
Luke Songe2bd8762017-06-12 16:08:33 -070096 vr_ui.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -070097 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080098
Tianjie Xuba0460c2018-03-20 16:07:39 -070099LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -0700100
Tao Bao42c45e22018-07-31 09:37:12 -0700101LOCAL_CFLAGS := $(recovery_common_cflags)
102
Tianjie Xuba0460c2018-03-20 16:07:39 -0700103LOCAL_STATIC_LIBRARIES := \
104 libminui \
Tao Bao2c526392018-05-03 23:01:13 -0700105 libotautil \
Doug Zongkerfb2e3af2009-06-17 17:29:40 -0700106
Tao Bao42c45e22018-07-31 09:37:12 -0700107LOCAL_SHARED_LIBRARIES := \
108 libbase \
109 libpng \
110 libz \
Tao Bao6a542dc2018-03-26 15:45:54 -0700111
Tianjie Xuba0460c2018-03-20 16:07:39 -0700112include $(BUILD_STATIC_LIBRARY)
113
Yifan Honge8e4c402017-11-08 14:56:03 -0800114# Health HAL dependency
Tao Baofd0ace82017-10-11 20:25:36 -0700115health_hal_static_libraries := \
Yifan Honge8e4c402017-11-08 14:56:03 -0800116 android.hardware.health@2.0-impl \
117 android.hardware.health@2.0 \
118 android.hardware.health@1.0 \
119 android.hardware.health@1.0-convert \
Hridya Valsarajubd84bd42018-01-10 16:18:42 -0800120 libhealthstoragedefault \
Yifan Honge8e4c402017-11-08 14:56:03 -0800121 libhidltransport \
122 libhidlbase \
Pirama Arumuga Nainar2ca4a402018-04-09 10:38:24 -0700123 libhwbinder_noltopgo \
Yifan Honge8e4c402017-11-08 14:56:03 -0800124 libvndksupport \
125 libbatterymonitor
126
Tao Baofd0ace82017-10-11 20:25:36 -0700127librecovery_static_libraries := \
Tao Bao6cd81682018-05-03 21:53:11 -0700128 libbootloader_message \
129 libfusesideload \
Tao Baoc70446c2018-08-07 20:11:44 -0700130 libminadbd \
Tao Bao9e309972018-05-11 15:13:10 -0700131 libminui \
132 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -0700133 libotautil \
Tao Baofd0ace82017-10-11 20:25:36 -0700134 $(health_hal_static_libraries) \
Tao Bao6cd81682018-05-03 21:53:11 -0700135 libasyncio \
Josh Gao073164f2016-08-05 15:59:05 -0700136 libcrypto_utils \
137 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -0700138 libext4_utils \
139 libfs_mgr \
140 libpng \
141 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -0700142 libvintf_recovery \
143 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800144 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700145 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -0700146 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700147 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -0800148 libutils \
Yifan Honge8e4c402017-11-08 14:56:03 -0800149 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -0700150 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700151 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -0700152 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -0700153
Tao Baofd0ace82017-10-11 20:25:36 -0700154# librecovery (static library)
155# ===============================
156include $(CLEAR_VARS)
157
158LOCAL_SRC_FILES := \
159 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -0700160 fsck_unshare_blocks.cpp \
Tao Baofd0ace82017-10-11 20:25:36 -0700161 fuse_sdcard_provider.cpp \
162 install.cpp \
163 recovery.cpp \
164 roots.cpp \
165
166LOCAL_C_INCLUDES := \
167 system/vold \
168
169LOCAL_CFLAGS := $(recovery_common_cflags)
170
Tao Baofd0ace82017-10-11 20:25:36 -0700171LOCAL_MODULE := librecovery
172
173LOCAL_STATIC_LIBRARIES := \
174 $(librecovery_static_libraries)
175
176include $(BUILD_STATIC_LIBRARY)
177
178# recovery (static executable)
179# ===============================
180include $(CLEAR_VARS)
181
182LOCAL_SRC_FILES := \
183 logging.cpp \
184 recovery_main.cpp \
185
186LOCAL_MODULE := recovery
187
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700188LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Baofd0ace82017-10-11 20:25:36 -0700189
190# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
191# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
192LOCAL_USE_CLANG_LLD := false
193
194LOCAL_CFLAGS := $(recovery_common_cflags)
195
196LOCAL_STATIC_LIBRARIES := \
197 librecovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700198 librecovery_ui_default \
Tao Baofd0ace82017-10-11 20:25:36 -0700199 $(librecovery_static_libraries)
200
Tao Bao42c45e22018-07-31 09:37:12 -0700201LOCAL_SHARED_LIBRARIES := \
202 librecovery_ui \
203
Yabin Cui53e7a062016-02-17 12:21:52 -0800204LOCAL_HAL_STATIC_LIBRARIES := libhealthd
205
Tao Bao9e309972018-05-11 15:13:10 -0700206LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900207 e2fsdroid.recovery \
208 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700209 mke2fs.conf
210
211ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
212ifeq ($(HOST_OS),linux)
213LOCAL_REQUIRED_MODULES += \
214 sload.f2fs \
215 mkfs.f2fs
216endif
217endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800218
David Andersonedee8362018-05-16 13:43:22 -0700219# e2fsck is needed for adb remount -R.
220ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
221ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
222LOCAL_REQUIRED_MODULES += e2fsck_static
223endif
224endif
225
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800226ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700227LOCAL_REQUIRED_MODULES += \
228 recovery-persist \
229 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800230endif
231
Tao Bao42c45e22018-07-31 09:37:12 -0700232LOCAL_REQUIRED_MODULES += \
233 librecovery_ui_ext
234
235# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
236# module is built with Soong (with `recovery: true` flag).
237LOCAL_REQUIRED_MODULES += \
238 libbase.recovery \
239 liblog.recovery \
240 libpng.recovery \
241 libz.recovery \
242
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800243include $(BUILD_EXECUTABLE)
244
Yabin Cui2f272c02016-06-24 18:22:02 -0700245include \
Alex Deymofb00d822016-11-08 15:46:07 -0800246 $(LOCAL_PATH)/boot_control/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700247 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700248 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700249 $(LOCAL_PATH)/updater_sample/Android.mk \