blob: 4470416177cab4d15696854f39637132b36ce1ab [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 libfusesideload \
Tao Baoc70446c2018-08-07 20:11:44 -0700129 libminadbd \
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 Bao919d2c92017-04-10 16:55:57 -0700134 libvintf_recovery \
135 libvintf \
Tao Bao818f9382018-08-06 15:52:24 -0700136
137librecovery_shared_libraries := \
138 libasyncio \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700139 libbase \
Tao Bao818f9382018-08-06 15:52:24 -0700140 libbootloader_message \
141 libcrypto \
142 libcrypto_utils \
Yifan Honge8e4c402017-11-08 14:56:03 -0800143 libcutils \
Tao Bao818f9382018-08-06 15:52:24 -0700144 libext4_utils \
145 libfs_mgr \
146 libhidl-gen-utils \
Ying Wang4e214822013-04-09 21:41:29 -0700147 liblog \
Tao Bao818f9382018-08-06 15:52:24 -0700148 libpng \
Jin Qian000148d2017-11-03 11:52:33 -0700149 libselinux \
Tao Bao818f9382018-08-06 15:52:24 -0700150 libtinyxml2 \
151 libutils \
Tao Bao9e309972018-05-11 15:13:10 -0700152 libz \
Tao Bao818f9382018-08-06 15:52:24 -0700153 libziparchive \
Doug Zongker49c73a72010-06-29 17:36:28 -0700154
Tao Baofd0ace82017-10-11 20:25:36 -0700155# librecovery (static library)
156# ===============================
157include $(CLEAR_VARS)
158
159LOCAL_SRC_FILES := \
160 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -0700161 fsck_unshare_blocks.cpp \
Tao Baofd0ace82017-10-11 20:25:36 -0700162 fuse_sdcard_provider.cpp \
163 install.cpp \
164 recovery.cpp \
165 roots.cpp \
166
167LOCAL_C_INCLUDES := \
168 system/vold \
169
170LOCAL_CFLAGS := $(recovery_common_cflags)
171
Tao Baofd0ace82017-10-11 20:25:36 -0700172LOCAL_MODULE := librecovery
173
174LOCAL_STATIC_LIBRARIES := \
175 $(librecovery_static_libraries)
176
Tao Bao818f9382018-08-06 15:52:24 -0700177LOCAL_SHARED_LIBRARIES := \
178 $(librecovery_shared_libraries)
179
Tao Baofd0ace82017-10-11 20:25:36 -0700180include $(BUILD_STATIC_LIBRARY)
181
182# recovery (static executable)
183# ===============================
184include $(CLEAR_VARS)
185
186LOCAL_SRC_FILES := \
187 logging.cpp \
188 recovery_main.cpp \
189
190LOCAL_MODULE := recovery
191
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700192LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Baofd0ace82017-10-11 20:25:36 -0700193
194# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
195# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
196LOCAL_USE_CLANG_LLD := false
197
198LOCAL_CFLAGS := $(recovery_common_cflags)
199
200LOCAL_STATIC_LIBRARIES := \
201 librecovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700202 librecovery_ui_default \
Tao Baofd0ace82017-10-11 20:25:36 -0700203 $(librecovery_static_libraries)
204
Tao Bao42c45e22018-07-31 09:37:12 -0700205LOCAL_SHARED_LIBRARIES := \
206 librecovery_ui \
Tao Bao818f9382018-08-06 15:52:24 -0700207 $(librecovery_shared_libraries)
Tao Bao42c45e22018-07-31 09:37:12 -0700208
Yabin Cui53e7a062016-02-17 12:21:52 -0800209LOCAL_HAL_STATIC_LIBRARIES := libhealthd
210
Tao Bao9e309972018-05-11 15:13:10 -0700211LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900212 e2fsdroid.recovery \
213 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700214 mke2fs.conf
215
216ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
217ifeq ($(HOST_OS),linux)
218LOCAL_REQUIRED_MODULES += \
219 sload.f2fs \
220 mkfs.f2fs
221endif
222endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800223
David Andersonedee8362018-05-16 13:43:22 -0700224# e2fsck is needed for adb remount -R.
225ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
226ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Tao Bao818f9382018-08-06 15:52:24 -0700227LOCAL_REQUIRED_MODULES += \
228 e2fsck_static
David Andersonedee8362018-05-16 13:43:22 -0700229endif
230endif
231
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800232ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700233LOCAL_REQUIRED_MODULES += \
234 recovery-persist \
235 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800236endif
237
Tao Bao42c45e22018-07-31 09:37:12 -0700238LOCAL_REQUIRED_MODULES += \
239 librecovery_ui_ext
240
241# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
242# module is built with Soong (with `recovery: true` flag).
243LOCAL_REQUIRED_MODULES += \
Tao Bao818f9382018-08-06 15:52:24 -0700244 libasyncio.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700245 libbase.recovery \
Tao Bao818f9382018-08-06 15:52:24 -0700246 libbootloader_message.recovery \
247 libcrypto.recovery \
248 libcrypto_utils.recovery \
249 libcutils.recovery \
250 libext4_utils.recovery \
251 libfs_mgr.recovery \
252 libhidl-gen-utils.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700253 liblog.recovery \
254 libpng.recovery \
Tao Bao818f9382018-08-06 15:52:24 -0700255 libselinux.recovery \
256 libsparse.recovery \
257 libtinyxml2.recovery \
258 libutils.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700259 libz.recovery \
Tao Bao818f9382018-08-06 15:52:24 -0700260 libziparchive.recovery \
Tao Bao42c45e22018-07-31 09:37:12 -0700261
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800262include $(BUILD_EXECUTABLE)
263
Yabin Cui2f272c02016-06-24 18:22:02 -0700264include \
Kenny Root7a4adb52013-10-09 10:14:35 -0700265 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700266 $(LOCAL_PATH)/updater/Android.mk \