Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 1 | # 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 Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 14 | |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 15 | LOCAL_PATH := $(call my-dir) |
| 16 | |
Tao Bao | 1d86605 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 17 | # Needed by build/make/core/Makefile. |
| 18 | RECOVERY_API_VERSION := 3 |
| 19 | RECOVERY_FSTAB_VERSION := 2 |
| 20 | |
Tao Bao | f7e8012 | 2018-03-23 22:01:43 -0700 | [diff] [blame] | 21 | # 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. |
| 24 | TARGET_RECOVERY_UI_LIB ?= librecovery_ui_default |
| 25 | |
Tao Bao | 6a542dc | 2018-03-26 15:45:54 -0700 | [diff] [blame] | 26 | recovery_common_cflags := \ |
| 27 | -Wall \ |
| 28 | -Werror \ |
| 29 | -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) |
| 30 | |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 31 | # librecovery_ui_ext (shared library) |
| 32 | # =================================== |
| 33 | include $(CLEAR_VARS) |
| 34 | |
| 35 | LOCAL_MODULE := librecovery_ui_ext |
| 36 | |
| 37 | # LOCAL_MODULE_PATH for shared libraries is unsupported in multiarch builds. |
| 38 | LOCAL_MULTILIB := first |
| 39 | |
| 40 | ifeq ($(TARGET_IS_64_BIT),true) |
| 41 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 |
| 42 | else |
| 43 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib |
| 44 | endif |
| 45 | |
| 46 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 47 | $(TARGET_RECOVERY_UI_LIB) |
| 48 | |
| 49 | LOCAL_SHARED_LIBRARIES := \ |
| 50 | libbase \ |
| 51 | liblog \ |
| 52 | librecovery_ui |
| 53 | |
| 54 | include $(BUILD_SHARED_LIBRARY) |
| 55 | |
| 56 | # librecovery_ui (shared library) |
| 57 | # =============================== |
| 58 | include $(CLEAR_VARS) |
| 59 | LOCAL_SRC_FILES := \ |
| 60 | device.cpp \ |
| 61 | screen_ui.cpp \ |
| 62 | ui.cpp \ |
| 63 | vr_ui.cpp \ |
| 64 | wear_ui.cpp |
| 65 | |
| 66 | LOCAL_MODULE := librecovery_ui |
| 67 | |
| 68 | LOCAL_CFLAGS := $(recovery_common_cflags) |
| 69 | |
| 70 | LOCAL_MULTILIB := first |
| 71 | |
| 72 | ifeq ($(TARGET_IS_64_BIT),true) |
| 73 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 |
| 74 | else |
| 75 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib |
| 76 | endif |
| 77 | |
| 78 | LOCAL_STATIC_LIBRARIES := \ |
| 79 | libminui \ |
| 80 | libotautil \ |
| 81 | |
| 82 | LOCAL_SHARED_LIBRARIES := \ |
| 83 | libbase \ |
| 84 | libpng \ |
| 85 | libz \ |
| 86 | |
| 87 | include $(BUILD_SHARED_LIBRARY) |
| 88 | |
Tianjie Xu | ba0460c | 2018-03-20 16:07:39 -0700 | [diff] [blame] | 89 | # librecovery_ui (static library) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 90 | # =============================== |
Doug Zongker | 18a78e0 | 2014-07-10 07:31:46 -0700 | [diff] [blame] | 91 | include $(CLEAR_VARS) |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 92 | LOCAL_SRC_FILES := \ |
Tao Bao | 6a542dc | 2018-03-26 15:45:54 -0700 | [diff] [blame] | 93 | device.cpp \ |
Elliott Hughes | 9e7ae8a | 2015-04-09 13:40:31 -0700 | [diff] [blame] | 94 | screen_ui.cpp \ |
| 95 | ui.cpp \ |
Luke Song | e2bd876 | 2017-06-12 16:08:33 -0700 | [diff] [blame] | 96 | vr_ui.cpp \ |
Tianjie Xu | ba0460c | 2018-03-20 16:07:39 -0700 | [diff] [blame] | 97 | wear_ui.cpp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 98 | |
Tianjie Xu | ba0460c | 2018-03-20 16:07:39 -0700 | [diff] [blame] | 99 | LOCAL_MODULE := librecovery_ui |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 100 | |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 101 | LOCAL_CFLAGS := $(recovery_common_cflags) |
| 102 | |
Tianjie Xu | ba0460c | 2018-03-20 16:07:39 -0700 | [diff] [blame] | 103 | LOCAL_STATIC_LIBRARIES := \ |
| 104 | libminui \ |
Tao Bao | 2c52639 | 2018-05-03 23:01:13 -0700 | [diff] [blame] | 105 | libotautil \ |
Doug Zongker | fb2e3af | 2009-06-17 17:29:40 -0700 | [diff] [blame] | 106 | |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 107 | LOCAL_SHARED_LIBRARIES := \ |
| 108 | libbase \ |
| 109 | libpng \ |
| 110 | libz \ |
Tao Bao | 6a542dc | 2018-03-26 15:45:54 -0700 | [diff] [blame] | 111 | |
Tianjie Xu | ba0460c | 2018-03-20 16:07:39 -0700 | [diff] [blame] | 112 | include $(BUILD_STATIC_LIBRARY) |
| 113 | |
Yifan Hong | e8e4c40 | 2017-11-08 14:56:03 -0800 | [diff] [blame] | 114 | # Health HAL dependency |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 115 | health_hal_static_libraries := \ |
Yifan Hong | e8e4c40 | 2017-11-08 14:56:03 -0800 | [diff] [blame] | 116 | 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 Valsaraju | bd84bd4 | 2018-01-10 16:18:42 -0800 | [diff] [blame] | 120 | libhealthstoragedefault \ |
Yifan Hong | e8e4c40 | 2017-11-08 14:56:03 -0800 | [diff] [blame] | 121 | libhidltransport \ |
| 122 | libhidlbase \ |
Pirama Arumuga Nainar | 2ca4a40 | 2018-04-09 10:38:24 -0700 | [diff] [blame] | 123 | libhwbinder_noltopgo \ |
Yifan Hong | e8e4c40 | 2017-11-08 14:56:03 -0800 | [diff] [blame] | 124 | libvndksupport \ |
| 125 | libbatterymonitor |
| 126 | |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 127 | librecovery_static_libraries := \ |
Tao Bao | 6cd8168 | 2018-05-03 21:53:11 -0700 | [diff] [blame] | 128 | libbootloader_message \ |
| 129 | libfusesideload \ |
Tao Bao | c70446c | 2018-08-07 20:11:44 -0700 | [diff] [blame^] | 130 | libminadbd \ |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 131 | libminui \ |
| 132 | libverifier \ |
Tao Bao | 6cd8168 | 2018-05-03 21:53:11 -0700 | [diff] [blame] | 133 | libotautil \ |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 134 | $(health_hal_static_libraries) \ |
Tao Bao | 6cd8168 | 2018-05-03 21:53:11 -0700 | [diff] [blame] | 135 | libasyncio \ |
Josh Gao | 073164f | 2016-08-05 15:59:05 -0700 | [diff] [blame] | 136 | libcrypto_utils \ |
| 137 | libcrypto \ |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 138 | libext4_utils \ |
| 139 | libfs_mgr \ |
| 140 | libpng \ |
| 141 | libsparse \ |
Tao Bao | 919d2c9 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 142 | libvintf_recovery \ |
| 143 | libvintf \ |
Yifan Hong | 495c521 | 2018-03-06 17:59:58 -0800 | [diff] [blame] | 144 | libhidl-gen-utils \ |
Tao Bao | 919d2c9 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 145 | libtinyxml2 \ |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 146 | libziparchive \ |
Elliott Hughes | 8fd86d7 | 2015-04-13 14:36:02 -0700 | [diff] [blame] | 147 | libbase \ |
Yabin Cui | 53e7a06 | 2016-02-17 12:21:52 -0800 | [diff] [blame] | 148 | libutils \ |
Yifan Hong | e8e4c40 | 2017-11-08 14:56:03 -0800 | [diff] [blame] | 149 | libcutils \ |
Ying Wang | 4e21482 | 2013-04-09 21:41:29 -0700 | [diff] [blame] | 150 | liblog \ |
Jin Qian | 000148d | 2017-11-03 11:52:33 -0700 | [diff] [blame] | 151 | libselinux \ |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 152 | libz \ |
Doug Zongker | 49c73a7 | 2010-06-29 17:36:28 -0700 | [diff] [blame] | 153 | |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 154 | # librecovery (static library) |
| 155 | # =============================== |
| 156 | include $(CLEAR_VARS) |
| 157 | |
| 158 | LOCAL_SRC_FILES := \ |
| 159 | adb_install.cpp \ |
David Anderson | edee836 | 2018-05-16 13:43:22 -0700 | [diff] [blame] | 160 | fsck_unshare_blocks.cpp \ |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 161 | fuse_sdcard_provider.cpp \ |
| 162 | install.cpp \ |
| 163 | recovery.cpp \ |
| 164 | roots.cpp \ |
| 165 | |
| 166 | LOCAL_C_INCLUDES := \ |
| 167 | system/vold \ |
| 168 | |
| 169 | LOCAL_CFLAGS := $(recovery_common_cflags) |
| 170 | |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 171 | LOCAL_MODULE := librecovery |
| 172 | |
| 173 | LOCAL_STATIC_LIBRARIES := \ |
| 174 | $(librecovery_static_libraries) |
| 175 | |
| 176 | include $(BUILD_STATIC_LIBRARY) |
| 177 | |
| 178 | # recovery (static executable) |
| 179 | # =============================== |
| 180 | include $(CLEAR_VARS) |
| 181 | |
| 182 | LOCAL_SRC_FILES := \ |
| 183 | logging.cpp \ |
| 184 | recovery_main.cpp \ |
| 185 | |
| 186 | LOCAL_MODULE := recovery |
| 187 | |
Hridya Valsaraju | cfb3c92 | 2018-07-26 13:04:06 -0700 | [diff] [blame] | 188 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 189 | |
| 190 | # Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText |
| 191 | # http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld. |
| 192 | LOCAL_USE_CLANG_LLD := false |
| 193 | |
| 194 | LOCAL_CFLAGS := $(recovery_common_cflags) |
| 195 | |
| 196 | LOCAL_STATIC_LIBRARIES := \ |
| 197 | librecovery \ |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 198 | librecovery_ui_default \ |
Tao Bao | fd0ace8 | 2017-10-11 20:25:36 -0700 | [diff] [blame] | 199 | $(librecovery_static_libraries) |
| 200 | |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 201 | LOCAL_SHARED_LIBRARIES := \ |
| 202 | librecovery_ui \ |
| 203 | |
Yabin Cui | 53e7a06 | 2016-02-17 12:21:52 -0800 | [diff] [blame] | 204 | LOCAL_HAL_STATIC_LIBRARIES := libhealthd |
| 205 | |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 206 | LOCAL_REQUIRED_MODULES := \ |
Jiyong Park | 69364fe | 2018-06-20 14:18:18 +0900 | [diff] [blame] | 207 | e2fsdroid.recovery \ |
| 208 | mke2fs.recovery \ |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 209 | mke2fs.conf |
| 210 | |
| 211 | ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) |
| 212 | ifeq ($(HOST_OS),linux) |
| 213 | LOCAL_REQUIRED_MODULES += \ |
| 214 | sload.f2fs \ |
| 215 | mkfs.f2fs |
| 216 | endif |
| 217 | endif |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 218 | |
David Anderson | edee836 | 2018-05-16 13:43:22 -0700 | [diff] [blame] | 219 | # e2fsck is needed for adb remount -R. |
| 220 | ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true) |
| 221 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
| 222 | LOCAL_REQUIRED_MODULES += e2fsck_static |
| 223 | endif |
| 224 | endif |
| 225 | |
Mark Salyzyn | a4f701a | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 226 | ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) |
Tao Bao | 9e30997 | 2018-05-11 15:13:10 -0700 | [diff] [blame] | 227 | LOCAL_REQUIRED_MODULES += \ |
| 228 | recovery-persist \ |
| 229 | recovery-refresh |
Mark Salyzyn | a4f701a | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 230 | endif |
| 231 | |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 232 | LOCAL_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). |
| 237 | LOCAL_REQUIRED_MODULES += \ |
| 238 | libbase.recovery \ |
| 239 | liblog.recovery \ |
| 240 | libpng.recovery \ |
| 241 | libz.recovery \ |
| 242 | |
Mark Salyzyn | a4f701a | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 243 | include $(BUILD_EXECUTABLE) |
| 244 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 245 | include \ |
Alex Deymo | fb00d82 | 2016-11-08 15:46:07 -0800 | [diff] [blame] | 246 | $(LOCAL_PATH)/boot_control/Android.mk \ |
Kenny Root | 7a4adb5 | 2013-10-09 10:14:35 -0700 | [diff] [blame] | 247 | $(LOCAL_PATH)/tests/Android.mk \ |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 248 | $(LOCAL_PATH)/updater/Android.mk \ |
Tao Bao | 32118f6 | 2018-04-25 15:19:47 -0700 | [diff] [blame] | 249 | $(LOCAL_PATH)/updater_sample/Android.mk \ |