blob: 9542080cace8a073f052ab11d7274e341f1f61f3 [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
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 Xu5fe5eb62018-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 Xu5fe5eb62018-03-20 16:07:39 -070097 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080098
Tianjie Xu5fe5eb62018-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 Xu5fe5eb62018-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 Xu5fe5eb62018-03-20 16:07:39 -0700112include $(BUILD_STATIC_LIBRARY)
113
Tao Bao371fe6e2017-10-11 20:25:36 -0700114librecovery_static_libraries := \
Tao Bao6cd81682018-05-03 21:53:11 -0700115 libbootloader_message \
116 libfusesideload \
117 libminadbd \
Tao Bao9e309972018-05-11 15:13:10 -0700118 libminui \
119 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -0700120 libotautil \
121 libasyncio \
122 libbatterymonitor \
Josh Gao073164f2016-08-05 15:59:05 -0700123 libcrypto_utils \
124 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -0700125 libext4_utils \
126 libfs_mgr \
127 libpng \
128 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -0700129 libvintf_recovery \
130 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800131 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700132 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -0700133 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700134 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -0800135 libutils \
Tao Bao371fe6e2017-10-11 20:25:36 -0700136 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -0700137 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700138 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -0700139 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -0700140
Tao Bao371fe6e2017-10-11 20:25:36 -0700141# librecovery (static library)
142# ===============================
143include $(CLEAR_VARS)
144
145LOCAL_SRC_FILES := \
146 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -0700147 fsck_unshare_blocks.cpp \
Tao Bao371fe6e2017-10-11 20:25:36 -0700148 fuse_sdcard_provider.cpp \
149 install.cpp \
150 recovery.cpp \
151 roots.cpp \
152
153LOCAL_C_INCLUDES := \
154 system/vold \
155
156LOCAL_CFLAGS := $(recovery_common_cflags)
157
Tao Bao371fe6e2017-10-11 20:25:36 -0700158LOCAL_MODULE := librecovery
159
160LOCAL_STATIC_LIBRARIES := \
161 $(librecovery_static_libraries)
162
163include $(BUILD_STATIC_LIBRARY)
164
165# recovery (static executable)
166# ===============================
167include $(CLEAR_VARS)
168
169LOCAL_SRC_FILES := \
170 logging.cpp \
171 recovery_main.cpp \
172
173LOCAL_MODULE := recovery
174
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700175LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Bao371fe6e2017-10-11 20:25:36 -0700176
177# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
178# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
179LOCAL_USE_CLANG_LLD := false
180
181LOCAL_CFLAGS := $(recovery_common_cflags)
182
183LOCAL_STATIC_LIBRARIES := \
184 librecovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700185 librecovery_ui_default \
Tao Bao371fe6e2017-10-11 20:25:36 -0700186 $(librecovery_static_libraries)
187
Tao Bao42c45e22018-07-31 09:37:12 -0700188LOCAL_SHARED_LIBRARIES := \
189 librecovery_ui \
190
Yabin Cui53e7a062016-02-17 12:21:52 -0800191LOCAL_HAL_STATIC_LIBRARIES := libhealthd
192
Tao Bao9e309972018-05-11 15:13:10 -0700193LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900194 e2fsdroid.recovery \
195 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700196 mke2fs.conf
197
198ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
199ifeq ($(HOST_OS),linux)
200LOCAL_REQUIRED_MODULES += \
201 sload.f2fs \
202 mkfs.f2fs
203endif
204endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800205
David Andersonedee8362018-05-16 13:43:22 -0700206# e2fsck is needed for adb remount -R.
207ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
208ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
209LOCAL_REQUIRED_MODULES += e2fsck_static
210endif
211endif
212
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800213ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700214LOCAL_REQUIRED_MODULES += \
215 recovery-persist \
216 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800217endif
218
Tao Bao42c45e22018-07-31 09:37:12 -0700219LOCAL_REQUIRED_MODULES += \
220 librecovery_ui_ext
221
222# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
223# module is built with Soong (with `recovery: true` flag).
224LOCAL_REQUIRED_MODULES += \
225 libbase.recovery \
226 liblog.recovery \
227 libpng.recovery \
228 libz.recovery \
229
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800230include $(BUILD_EXECUTABLE)
231
Yabin Cui2f272c02016-06-24 18:22:02 -0700232include \
Alex Deymofb00d822016-11-08 15:46:07 -0800233 $(LOCAL_PATH)/boot_control/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700234 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700235 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700236 $(LOCAL_PATH)/updater_sample/Android.mk \