blob: e6bea07230c0435b28709be839e70d8272aa2be0 [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 Bao1d866052017-04-10 16:55:57 -070026# librecovery (static library)
27# ===============================
28include $(CLEAR_VARS)
Tao Baof6d25962018-03-23 22:01:43 -070029
Tao Bao1d866052017-04-10 16:55:57 -070030LOCAL_SRC_FILES := \
31 install.cpp
Tao Baof6d25962018-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 Xu5fe5eb62018-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 Xu5fe5eb62018-03-20 16:07:39 -070060 wear_ui.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080061
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070062LOCAL_CFLAGS := -Wall -Werror
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080063
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070064LOCAL_MODULE := librecovery_ui
Tao Baod2f2ad62018-03-23 23:24:25 -070065
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070066LOCAL_STATIC_LIBRARIES := \
67 libminui \
Tao Bao2c526392018-05-03 23:01:13 -070068 libotautil \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -070069 libbase
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070070
Tao Bao4521b702017-06-20 18:11:21 -070071ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
72LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
73else
74LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=0
75endif
76
77ifneq ($(TARGET_RECOVERY_UI_MARGIN_WIDTH),)
78LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=$(TARGET_RECOVERY_UI_MARGIN_WIDTH)
79else
80LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_WIDTH=0
81endif
82
Tao Bao5f8dd992017-07-28 00:05:40 -070083ifneq ($(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD),)
84LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD)
85else
86LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_LOW_THRESHOLD=50
87endif
88
89ifneq ($(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD),)
90LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=$(TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD)
91else
92LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90
93endif
94
Tao Bao0470cee2017-08-02 17:11:04 -070095ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),)
96LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE)
97else
98LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259
99endif
100
101ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),)
102LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS)
103else
104LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
105endif
106
Tao Baoeea3af32017-08-11 13:50:24 -0700107ifneq ($(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS),)
108LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=$(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS)
109else
110LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=9
111endif
112
Luke Song9d4839c2017-06-23 14:33:46 -0700113ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
114LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
115else
116LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=0
117endif
118
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700119include $(BUILD_STATIC_LIBRARY)
120
121# recovery (static executable)
122# ===============================
123include $(CLEAR_VARS)
124
125LOCAL_SRC_FILES := \
126 adb_install.cpp \
127 device.cpp \
128 fuse_sdcard_provider.cpp \
Jerry Zhang152933a2018-05-02 16:56:00 -0700129 logging.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700130 recovery.cpp \
Tao Bao6d99d4b2018-04-25 16:47:04 -0700131 recovery_main.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700132 roots.cpp \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700133
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700134LOCAL_MODULE := recovery
135
136LOCAL_FORCE_STATIC_EXECUTABLE := true
137
Chih-Hung Hsieh83847e62018-03-07 21:59:52 -0800138# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
139# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
140LOCAL_USE_CLANG_LLD := false
141
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700142LOCAL_REQUIRED_MODULES := e2fsdroid_static mke2fs_static mke2fs.conf
143
144ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
145ifeq ($(HOST_OS),linux)
146LOCAL_REQUIRED_MODULES += sload.f2fs mkfs.f2fs
147endif
148endif
149
150LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
151LOCAL_CFLAGS += -Wall -Werror
152
Dan Albert1ddd3502015-02-18 15:58:15 -0800153LOCAL_C_INCLUDES += \
154 system/vold \
Adrien Grassein3cd669f2014-11-06 14:53:50 +0100155
Tao Baof6d25962018-03-23 22:01:43 -0700156LOCAL_STATIC_LIBRARIES := \
157 librecovery \
158 $(TARGET_RECOVERY_UI_LIB) \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700159 librecovery_ui \
Joe Onorato6396e702012-05-31 23:21:46 -0700160 libminui \
Tao Bao6cd81682018-05-03 21:53:11 -0700161 libverifier \
162 libbootloader_message \
163 libfusesideload \
164 libminadbd \
165 libotautil \
166 libasyncio \
167 libbatterymonitor \
168 libfs_mgr \
169 libext4_utils \
Joe Onorato6396e702012-05-31 23:21:46 -0700170 libpng \
Tao Bao6cd81682018-05-03 21:53:11 -0700171 libsparse \
172 libziparchive \
Josh Gao073164f2016-08-05 15:59:05 -0700173 libcrypto_utils \
174 libcrypto \
Tao Bao919d2c92017-04-10 16:55:57 -0700175 libvintf_recovery \
176 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800177 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700178 libtinyxml2 \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700179 libbase \
Joe Onorato6396e702012-05-31 23:21:46 -0700180 libcutils \
Yabin Cui53e7a062016-02-17 12:21:52 -0800181 libutils \
Ying Wang4e214822013-04-09 21:41:29 -0700182 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700183 libselinux \
184 libz
Doug Zongker49c73a72010-06-29 17:36:28 -0700185
Yabin Cui53e7a062016-02-17 12:21:52 -0800186LOCAL_HAL_STATIC_LIBRARIES := libhealthd
187
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700188ifeq ($(AB_OTA_UPDATER),true)
189 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
190endif
191
Ying Wang5a50b1b2015-03-10 11:56:56 -0700192LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800193
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800194ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Jin Qianded2dac2017-04-21 14:36:12 -0700195LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800196endif
197
198include $(BUILD_EXECUTABLE)
199
Yabin Cui2f272c02016-06-24 18:22:02 -0700200include \
Alex Deymofb00d822016-11-08 15:46:07 -0800201 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700202 $(LOCAL_PATH)/minui/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700203 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700204 $(LOCAL_PATH)/tools/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700205 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700206 $(LOCAL_PATH)/updater_sample/Android.mk \