blob: 010a51630e27cca8ff39fb75ee8f1e7bd14d5315 [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 Bao1d866052017-04-10 16:55:57 -070026# librecovery (static library)
27# ===============================
28include $(CLEAR_VARS)
Tao Baof7e80122018-03-23 22:01:43 -070029
Tao Bao1d866052017-04-10 16:55:57 -070030LOCAL_SRC_FILES := \
31 install.cpp
Tao Baof7e80122018-03-23 22:01:43 -070032
Tao Baob24510c2017-04-20 17:54:27 -070033LOCAL_CFLAGS := -Wall -Werror
Tao Bao1d866052017-04-10 16:55:57 -070034LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Bao7fdcb192017-04-12 23:52:20 -070035
36ifeq ($(AB_OTA_UPDATER),true)
37 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
38endif
39
Tao Bao1d866052017-04-10 16:55:57 -070040LOCAL_MODULE := librecovery
Tao Baod2f2ad62018-03-23 23:24:25 -070041
Tao Bao1d866052017-04-10 16:55:57 -070042LOCAL_STATIC_LIBRARIES := \
43 libminui \
Tao Baocfe53c22017-10-03 14:37:21 -070044 libotautil \
Tao Bao919d2c92017-04-10 16:55:57 -070045 libvintf_recovery \
Tao Bao1d866052017-04-10 16:55:57 -070046 libcrypto_utils \
47 libcrypto \
Elliott Hughese1bb7a52017-06-28 08:00:17 -070048 libbase \
49 libziparchive \
Tao Bao1d866052017-04-10 16:55:57 -070050
51include $(BUILD_STATIC_LIBRARY)
52
Tianjie Xuba0460c2018-03-20 16:07:39 -070053# librecovery_ui (static library)
Tao Baod80a9982016-03-03 11:43:47 -080054# ===============================
Doug Zongker18a78e02014-07-10 07:31:46 -070055include $(CLEAR_VARS)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080056LOCAL_SRC_FILES := \
Elliott Hughes9e7ae8a2015-04-09 13:40:31 -070057 screen_ui.cpp \
58 ui.cpp \
Luke Songe2bd8762017-06-12 16:08:33 -070059 vr_ui.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -070060 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080061
Tianjie Xuba0460c2018-03-20 16:07:39 -070062LOCAL_CFLAGS := -Wall -Werror
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080063
Tianjie Xuba0460c2018-03-20 16:07:39 -070064LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -070065
Tianjie Xuba0460c2018-03-20 16:07:39 -070066LOCAL_STATIC_LIBRARIES := \
67 libminui \
68 libbase
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070069
Tao Bao4521b702017-06-20 18:11:21 -070070ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
71LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
72else
73LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=0
74endif
75
76ifneq ($(TARGET_RECOVERY_UI_MARGIN_WIDTH),)
77LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=$(TARGET_RECOVERY_UI_MARGIN_WIDTH)
78else
79LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=0
80endif
81
Tao Bao5f8dd992017-07-28 00:05:40 -070082ifneq ($(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD),)
83LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD)
84else
85LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=50
86endif
87
88ifneq ($(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD),)
89LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD)
90else
91LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90
92endif
93
Tao Bao0470cee2017-08-02 17:11:04 -070094ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),)
95LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE)
96else
97LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259
98endif
99
100ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),)
101LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS)
102else
103LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
104endif
105
Tao Baoeea3af32017-08-11 13:50:24 -0700106ifneq ($(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS),)
107LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=$(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS)
108else
109LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=9
110endif
111
Luke Song9d4839c2017-06-23 14:33:46 -0700112ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
113LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
114else
115LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0
116endif
117
Tianjie Xuba0460c2018-03-20 16:07:39 -0700118include $(BUILD_STATIC_LIBRARY)
119
120# recovery (static executable)
121# ===============================
122include $(CLEAR_VARS)
123
124LOCAL_SRC_FILES := \
125 adb_install.cpp \
126 device.cpp \
127 fuse_sdcard_provider.cpp \
128 recovery.cpp \
129 roots.cpp \
130 rotate_logs.cpp \
131
Tianjie Xuba0460c2018-03-20 16:07:39 -0700132LOCAL_MODULE := recovery
133
134LOCAL_FORCE_STATIC_EXECUTABLE := true
135
Chih-Hung Hsieh83847e62018-03-07 21:59:52 -0800136# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
137# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
138LOCAL_USE_CLANG_LLD := false
139
Tianjie Xuba0460c2018-03-20 16:07:39 -0700140LOCAL_REQUIRED_MODULES := e2fsdroid_static mke2fs_static mke2fs.conf
141
142ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
143ifeq ($(HOST_OS),linux)
144LOCAL_REQUIRED_MODULES += sload.f2fs mkfs.f2fs
145endif
146endif
147
148LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
149LOCAL_CFLAGS += -Wall -Werror
150
Dan Albert1ddd3502015-02-18 15:58:15 -0800151LOCAL_C_INCLUDES += \
152 system/vold \
Adrien Grassein3cd669f2014-11-06 14:53:50 +0100153
Yifan Honge8e4c402017-11-08 14:56:03 -0800154# Health HAL dependency
Joe Onorato6396e702012-05-31 23:21:46 -0700155LOCAL_STATIC_LIBRARIES := \
Yifan Honge8e4c402017-11-08 14:56:03 -0800156 android.hardware.health@2.0-impl \
157 android.hardware.health@2.0 \
158 android.hardware.health@1.0 \
159 android.hardware.health@1.0-convert \
Hridya Valsarajubd84bd42018-01-10 16:18:42 -0800160 libhealthstoragedefault \
Yifan Honge8e4c402017-11-08 14:56:03 -0800161 libhidltransport \
162 libhidlbase \
Pirama Arumuga Nainar2ca4a402018-04-09 10:38:24 -0700163 libhwbinder_noltopgo \
Yifan Honge8e4c402017-11-08 14:56:03 -0800164 libvndksupport \
165 libbatterymonitor
166
167LOCAL_STATIC_LIBRARIES += \
Tao Baof7e80122018-03-23 22:01:43 -0700168 librecovery \
169 $(TARGET_RECOVERY_UI_LIB) \
Tao Baob168f5f2017-04-16 15:22:13 -0700170 libverifier \
Yabin Cui2f272c02016-06-24 18:22:02 -0700171 libbootloader_message \
Jin Qianded2dac2017-04-21 14:36:12 -0700172 libfs_mgr \
Alex Deymo31653662017-01-11 14:02:13 -0800173 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800174 libsparse \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700175 libziparchive \
176 libotautil \
Elliott Hughes63a31922016-06-09 17:41:22 -0700177 libmounts \
Joe Onorato6396e702012-05-31 23:21:46 -0700178 libminadbd \
Jerry Zhangd428e792017-07-13 18:17:35 -0700179 libasyncio \
Doug Zongker18a78e02014-07-10 07:31:46 -0700180 libfusesideload \
Tianjie Xuba0460c2018-03-20 16:07:39 -0700181 librecovery_ui \
Joe Onorato6396e702012-05-31 23:21:46 -0700182 libminui \
Joe Onorato6396e702012-05-31 23:21:46 -0700183 libpng \
Josh Gao073164f2016-08-05 15:59:05 -0700184 libcrypto_utils \
185 libcrypto \
Tao Bao919d2c92017-04-10 16:55:57 -0700186 libvintf_recovery \
187 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800188 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700189 libtinyxml2 \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700190 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -0800191 libutils \
Yifan Honge8e4c402017-11-08 14:56:03 -0800192 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -0700193 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700194 libselinux \
195 libz
Doug Zongker49c73a72010-06-29 17:36:28 -0700196
Yabin Cui53e7a062016-02-17 12:21:52 -0800197LOCAL_HAL_STATIC_LIBRARIES := libhealthd
198
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700199ifeq ($(AB_OTA_UPDATER),true)
200 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
201endif
202
Ying Wang5a50b1b2015-03-10 11:56:56 -0700203LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800204
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800205ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Jin Qianded2dac2017-04-21 14:36:12 -0700206LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800207endif
208
209include $(BUILD_EXECUTABLE)
210
Yabin Cui2f272c02016-06-24 18:22:02 -0700211include \
Alex Deymofb00d822016-11-08 15:46:07 -0800212 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700213 $(LOCAL_PATH)/minui/Android.mk \
Jiachen Zhao051b9682018-03-30 14:04:51 -0700214 $(LOCAL_PATH)/sample_updater/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700215 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700216 $(LOCAL_PATH)/tools/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700217 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao7197ee02015-12-05 21:21:27 -0800218 $(LOCAL_PATH)/update_verifier/Android.mk \