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