blob: 1350fbaafd9624ac1986e00877d569ff05af3d46 [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
Tianjie Xu5fe5eb62018-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 Xu5fe5eb62018-03-20 16:07:39 -070039 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080040
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070041LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -070042
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070043LOCAL_STATIC_LIBRARIES := \
44 libminui \
Tao Bao2c526392018-05-03 23:01:13 -070045 libotautil \
Tianjie Xu5fe5eb62018-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 Xu5fe5eb62018-03-20 16:07:39 -070050include $(BUILD_STATIC_LIBRARY)
51
Tao Bao371fe6e2017-10-11 20:25:36 -070052librecovery_static_libraries := \
Tao Baof6d25962018-03-23 22:01:43 -070053 $(TARGET_RECOVERY_UI_LIB) \
Tao Bao6cd81682018-05-03 21:53:11 -070054 libbootloader_message \
55 libfusesideload \
56 libminadbd \
Tao Bao9e309972018-05-11 15:13:10 -070057 librecovery_ui \
58 libminui \
59 libverifier \
Tao Bao6cd81682018-05-03 21:53:11 -070060 libotautil \
61 libasyncio \
62 libbatterymonitor \
Josh Gao073164f2016-08-05 15:59:05 -070063 libcrypto_utils \
64 libcrypto \
Tao Bao9e309972018-05-11 15:13:10 -070065 libext4_utils \
66 libfs_mgr \
67 libpng \
68 libsparse \
Tao Bao919d2c92017-04-10 16:55:57 -070069 libvintf_recovery \
70 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -080071 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -070072 libtinyxml2 \
Tao Bao9e309972018-05-11 15:13:10 -070073 libziparchive \
Elliott Hughes8fd86d72015-04-13 14:36:02 -070074 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -080075 libutils \
Tao Bao371fe6e2017-10-11 20:25:36 -070076 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -070077 liblog \
Jin Qian000148d2017-11-03 11:52:33 -070078 libselinux \
Tao Bao9e309972018-05-11 15:13:10 -070079 libz \
Doug Zongker49c73a72010-06-29 17:36:28 -070080
Tao Bao371fe6e2017-10-11 20:25:36 -070081# librecovery (static library)
82# ===============================
83include $(CLEAR_VARS)
84
85LOCAL_SRC_FILES := \
86 adb_install.cpp \
David Andersonedee8362018-05-16 13:43:22 -070087 fsck_unshare_blocks.cpp \
Tao Bao371fe6e2017-10-11 20:25:36 -070088 fuse_sdcard_provider.cpp \
89 install.cpp \
90 recovery.cpp \
91 roots.cpp \
92
93LOCAL_C_INCLUDES := \
94 system/vold \
95
96LOCAL_CFLAGS := $(recovery_common_cflags)
97
Tao Bao371fe6e2017-10-11 20:25:36 -070098LOCAL_MODULE := librecovery
99
100LOCAL_STATIC_LIBRARIES := \
101 $(librecovery_static_libraries)
102
103include $(BUILD_STATIC_LIBRARY)
104
105# recovery (static executable)
106# ===============================
107include $(CLEAR_VARS)
108
109LOCAL_SRC_FILES := \
110 logging.cpp \
111 recovery_main.cpp \
112
113LOCAL_MODULE := recovery
114
115LOCAL_FORCE_STATIC_EXECUTABLE := true
116
Hridya Valsarajucfb3c922018-07-26 13:04:06 -0700117LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Tao Bao371fe6e2017-10-11 20:25:36 -0700118
119# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
120# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
121LOCAL_USE_CLANG_LLD := false
122
123LOCAL_CFLAGS := $(recovery_common_cflags)
124
125LOCAL_STATIC_LIBRARIES := \
126 librecovery \
127 $(librecovery_static_libraries)
128
Yabin Cui53e7a062016-02-17 12:21:52 -0800129LOCAL_HAL_STATIC_LIBRARIES := libhealthd
130
Tao Bao9e309972018-05-11 15:13:10 -0700131LOCAL_REQUIRED_MODULES := \
Jiyong Park69364fe2018-06-20 14:18:18 +0900132 e2fsdroid.recovery \
133 mke2fs.recovery \
Tao Bao9e309972018-05-11 15:13:10 -0700134 mke2fs.conf
135
136ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
137ifeq ($(HOST_OS),linux)
138LOCAL_REQUIRED_MODULES += \
139 sload.f2fs \
140 mkfs.f2fs
141endif
142endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800143
David Andersonedee8362018-05-16 13:43:22 -0700144# e2fsck is needed for adb remount -R.
145ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
146ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
147LOCAL_REQUIRED_MODULES += e2fsck_static
148endif
149endif
150
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800151ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Tao Bao9e309972018-05-11 15:13:10 -0700152LOCAL_REQUIRED_MODULES += \
153 recovery-persist \
154 recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800155endif
156
157include $(BUILD_EXECUTABLE)
158
Yabin Cui2f272c02016-06-24 18:22:02 -0700159include \
Alex Deymofb00d822016-11-08 15:46:07 -0800160 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700161 $(LOCAL_PATH)/minui/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700162 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700163 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700164 $(LOCAL_PATH)/updater_sample/Android.mk \