blob: 7b2843d17e7892460495cdc42a5e9d6a1b055f57 [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
Tianjie Xuba0460c2018-03-20 16:07:39 -070031# librecovery_ui (static library)
Tao Baod80a9982016-03-03 11:43:47 -080032# ===============================
Doug Zongker18a78e02014-07-10 07:31:46 -070033include $(CLEAR_VARS)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080034LOCAL_SRC_FILES := \
Tao Bao6a542dc2018-03-26 15:45:54 -070035 device.cpp \
Elliott Hughes9e7ae8a2015-04-09 13:40:31 -070036 screen_ui.cpp \
37 ui.cpp \
Luke Songe2bd8762017-06-12 16:08:33 -070038 vr_ui.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -070039 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040
Tianjie Xuba0460c2018-03-20 16:07:39 -070041LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -070042
Tianjie Xuba0460c2018-03-20 16:07:39 -070043LOCAL_STATIC_LIBRARIES := \
44 libminui \
Tao Bao2c526392018-05-03 23:01:13 -070045 libotautil \
Tianjie Xuba0460c2018-03-20 16:07:39 -070046 libbase
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070047
Tao Bao6a542dc2018-03-26 15:45:54 -070048LOCAL_CFLAGS := $(recovery_common_cflags)
49
Tianjie Xuba0460c2018-03-20 16:07:39 -070050include $(BUILD_STATIC_LIBRARY)
51
Yifan Honge8e4c402017-11-08 14:56:03 -080052# Health HAL dependency
Tao Baofd0ace82017-10-11 20:25:36 -070053health_hal_static_libraries := \
Yifan Honge8e4c402017-11-08 14:56:03 -080054 android.hardware.health@2.0-impl \
55 android.hardware.health@2.0 \
56 android.hardware.health@1.0 \
57 android.hardware.health@1.0-convert \
Hridya Valsarajubd84bd42018-01-10 16:18:42 -080058 libhealthstoragedefault \
Yifan Honge8e4c402017-11-08 14:56:03 -080059 libhidltransport \
60 libhidlbase \
Pirama Arumuga Nainar2ca4a402018-04-09 10:38:24 -070061 libhwbinder_noltopgo \
Yifan Honge8e4c402017-11-08 14:56:03 -080062 libvndksupport \
63 libbatterymonitor
64
Tao Baofd0ace82017-10-11 20:25:36 -070065librecovery_static_libraries := \
Tao Baof7e80122018-03-23 22:01:43 -070066 $(TARGET_RECOVERY_UI_LIB) \
Tao Bao6cd81682018-05-03 21:53:11 -070067 libbootloader_message \
68 libfusesideload \
69 libminadbd \
Tao Bao9e309972018-05-11 15:13:10 -070070 librecovery_ui \
71 libminui \
72 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -070073 libotautil \
Tao Baofd0ace82017-10-11 20:25:36 -070074 $(health_hal_static_libraries) \
Tao Bao6cd81682018-05-03 21:53:11 -070075 libasyncio \
Josh Gao073164f2016-08-05 15:59:05 -070076 libcrypto_utils \
77 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -070078 libext4_utils \
79 libfs_mgr \
80 libpng \
81 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -070082 libvintf_recovery \
83 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -080084 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -070085 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -070086 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -070087 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -080088 libutils \
Yifan Honge8e4c402017-11-08 14:56:03 -080089 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -070090 liblog \
Jin Qian000148d2017-11-03 11:52:33 -070091 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -070092 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -070093
Tao Baofd0ace82017-10-11 20:25:36 -070094# librecovery (static library)
95# ===============================
96include $(CLEAR_VARS)
97
98LOCAL_SRC_FILES := \
99 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -0700100 fsck_unshare_blocks.cpp \
Tao Baofd0ace82017-10-11 20:25:36 -0700101 fuse_sdcard_provider.cpp \
102 install.cpp \
103 recovery.cpp \
104 roots.cpp \
105
106LOCAL_C_INCLUDES := \
107 system/vold \
108
109LOCAL_CFLAGS := $(recovery_common_cflags)
110
Tao Baofd0ace82017-10-11 20:25:36 -0700111LOCAL_MODULE := librecovery
112
113LOCAL_STATIC_LIBRARIES := \
114 $(librecovery_static_libraries)
115
116include $(BUILD_STATIC_LIBRARY)
117
118# recovery (static executable)
119# ===============================
120include $(CLEAR_VARS)
121
122LOCAL_SRC_FILES := \
123 logging.cpp \
124 recovery_main.cpp \
125
126LOCAL_MODULE := recovery
127
128LOCAL_FORCE_STATIC_EXECUTABLE := true
129
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700130LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Baofd0ace82017-10-11 20:25:36 -0700131
132# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
133# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
134LOCAL_USE_CLANG_LLD := false
135
136LOCAL_CFLAGS := $(recovery_common_cflags)
137
138LOCAL_STATIC_LIBRARIES := \
139 librecovery \
140 $(librecovery_static_libraries)
141
Yabin Cui53e7a062016-02-17 12:21:52 -0800142LOCAL_HAL_STATIC_LIBRARIES := libhealthd
143
Tao Bao9e309972018-05-11 15:13:10 -0700144LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900145 e2fsdroid.recovery \
146 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700147 mke2fs.conf
148
149ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
150ifeq ($(HOST_OS),linux)
151LOCAL_REQUIRED_MODULES += \
152 sload.f2fs \
153 mkfs.f2fs
154endif
155endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800156
David Andersonedee8362018-05-16 13:43:22 -0700157# e2fsck is needed for adb remount -R.
158ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
159ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
160LOCAL_REQUIRED_MODULES += e2fsck_static
161endif
162endif
163
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800164ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700165LOCAL_REQUIRED_MODULES += \
166 recovery-persist \
167 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800168endif
169
170include $(BUILD_EXECUTABLE)
171
Yabin Cui2f272c02016-06-24 18:22:02 -0700172include \
Alex Deymofb00d822016-11-08 15:46:07 -0800173 $(LOCAL_PATH)/boot_control/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700174 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700175 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700176 $(LOCAL_PATH)/updater_sample/Android.mk \