blob: aa959c90941c99904cab80aee06dbb15246afbd6 [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 Bao9e309972018-05-11 15:13:10 -0700130 libminui \
131 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -0700132 libotautil \
Tao Baofd0ace82017-10-11 20:25:36 -0700133 $(health_hal_static_libraries) \
Tao Bao6cd81682018-05-03 21:53:11 -0700134 libasyncio \
Josh Gao073164f2016-08-05 15:59:05 -0700135 libcrypto_utils \
136 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -0700137 libext4_utils \
138 libfs_mgr \
139 libpng \
140 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -0700141 libvintf_recovery \
142 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800143 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700144 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -0700145 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700146 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -0800147 libutils \
Yifan Honge8e4c402017-11-08 14:56:03 -0800148 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -0700149 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700150 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -0700151 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -0700152
Tao Baofd0ace82017-10-11 20:25:36 -0700153# librecovery (static library)
154# ===============================
155include $(CLEAR_VARS)
156
157LOCAL_SRC_FILES := \
158 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -0700159 fsck_unshare_blocks.cpp \
Tao Baofd0ace82017-10-11 20:25:36 -0700160 fuse_sdcard_provider.cpp \
161 install.cpp \
162 recovery.cpp \
163 roots.cpp \
164
165LOCAL_C_INCLUDES := \
166 system/vold \
167
168LOCAL_CFLAGS := $(recovery_common_cflags)
169
Tao Baofd0ace82017-10-11 20:25:36 -0700170LOCAL_MODULE := librecovery
171
Tao Bao4fd4f892018-08-06 16:16:14 -0700172LOCAL_SHARED_LIBRARIES := \
173 libminadbd_services \
174
Tao Baofd0ace82017-10-11 20:25:36 -0700175LOCAL_STATIC_LIBRARIES := \
176 $(librecovery_static_libraries)
177
178include $(BUILD_STATIC_LIBRARY)
179
180# recovery (static executable)
181# ===============================
182include $(CLEAR_VARS)
183
184LOCAL_SRC_FILES := \
185 logging.cpp \
186 recovery_main.cpp \
187
188LOCAL_MODULE := recovery
189
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700190LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Baofd0ace82017-10-11 20:25:36 -0700191
192# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
193# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
194LOCAL_USE_CLANG_LLD := false
195
196LOCAL_CFLAGS := $(recovery_common_cflags)
197
198LOCAL_STATIC_LIBRARIES := \
199 librecovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700200 librecovery_ui_default \
Tao Baofd0ace82017-10-11 20:25:36 -0700201 $(librecovery_static_libraries)
202
Tao Bao42c45e22018-07-31 09:37:12 -0700203LOCAL_SHARED_LIBRARIES := \
Tao Bao4fd4f892018-08-06 16:16:14 -0700204 libminadbd_services \
Tao Bao42c45e22018-07-31 09:37:12 -0700205 librecovery_ui \
206
Yabin Cui53e7a062016-02-17 12:21:52 -0800207LOCAL_HAL_STATIC_LIBRARIES := libhealthd
208
Tao Bao9e309972018-05-11 15:13:10 -0700209LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900210 e2fsdroid.recovery \
211 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700212 mke2fs.conf
213
214ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
215ifeq ($(HOST_OS),linux)
216LOCAL_REQUIRED_MODULES += \
217 sload.f2fs \
218 mkfs.f2fs
219endif
220endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800221
David Andersonedee8362018-05-16 13:43:22 -0700222# e2fsck is needed for adb remount -R.
223ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
224ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
225LOCAL_REQUIRED_MODULES += e2fsck_static
226endif
227endif
228
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800229ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700230LOCAL_REQUIRED_MODULES += \
231 recovery-persist \
232 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800233endif
234
Tao Bao42c45e22018-07-31 09:37:12 -0700235LOCAL_REQUIRED_MODULES += \
236 librecovery_ui_ext
237
238# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
239# module is built with Soong (with `recovery: true` flag).
240LOCAL_REQUIRED_MODULES += \
241 libbase.recovery \
Tao Bao4fd4f892018-08-06 16:16:14 -0700242 libcrypto.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700243 liblog.recovery \
Tao Bao4fd4f892018-08-06 16:16:14 -0700244 libminadbd_services.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700245 libpng.recovery \
246 libz.recovery \
247
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800248include $(BUILD_EXECUTABLE)
249
Yabin Cui2f272c02016-06-24 18:22:02 -0700250include \
Alex Deymofb00d822016-11-08 15:46:07 -0800251 $(LOCAL_PATH)/boot_control/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700252 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700253 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700254 $(LOCAL_PATH)/updater_sample/Android.mk \