blob: dbd2eb7882d23c409c2cea40dabdde192b87860d [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 \
Tao Bao2c526392018-05-03 23:01:13 -070068 libotautil \
Tianjie Xuba0460c2018-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 Xuba0460c2018-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 Zhang3c3f2112018-05-02 16:56:00 -0700129 logging.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -0700130 recovery.cpp \
Tao Bao2ac56af2018-04-25 16:47:04 -0700131 recovery_main.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -0700132 roots.cpp \
Tianjie Xuba0460c2018-03-20 16:07:39 -0700133
Tianjie Xuba0460c2018-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 Xuba0460c2018-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
Yifan Honge8e4c402017-11-08 14:56:03 -0800156# Health HAL dependency
Joe Onorato6396e702012-05-31 23:21:46 -0700157LOCAL_STATIC_LIBRARIES := \
Yifan Honge8e4c402017-11-08 14:56:03 -0800158 android.hardware.health@2.0-impl \
159 android.hardware.health@2.0 \
160 android.hardware.health@1.0 \
161 android.hardware.health@1.0-convert \
Hridya Valsarajubd84bd42018-01-10 16:18:42 -0800162 libhealthstoragedefault \
Yifan Honge8e4c402017-11-08 14:56:03 -0800163 libhidltransport \
164 libhidlbase \
Pirama Arumuga Nainar2ca4a402018-04-09 10:38:24 -0700165 libhwbinder_noltopgo \
Yifan Honge8e4c402017-11-08 14:56:03 -0800166 libvndksupport \
167 libbatterymonitor
168
169LOCAL_STATIC_LIBRARIES += \
Tao Baof7e80122018-03-23 22:01:43 -0700170 librecovery \
171 $(TARGET_RECOVERY_UI_LIB) \
Tao Baob168f5f2017-04-16 15:22:13 -0700172 libverifier \
Yabin Cui2f272c02016-06-24 18:22:02 -0700173 libbootloader_message \
Jin Qianded2dac2017-04-21 14:36:12 -0700174 libfs_mgr \
Alex Deymo31653662017-01-11 14:02:13 -0800175 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800176 libsparse \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700177 libziparchive \
178 libotautil \
Joe Onorato6396e702012-05-31 23:21:46 -0700179 libminadbd \
Jerry Zhangd428e792017-07-13 18:17:35 -0700180 libasyncio \
Doug Zongker18a78e02014-07-10 07:31:46 -0700181 libfusesideload \
Tianjie Xuba0460c2018-03-20 16:07:39 -0700182 librecovery_ui \
Joe Onorato6396e702012-05-31 23:21:46 -0700183 libminui \
Joe Onorato6396e702012-05-31 23:21:46 -0700184 libpng \
Josh Gao073164f2016-08-05 15:59:05 -0700185 libcrypto_utils \
186 libcrypto \
Tao Bao919d2c92017-04-10 16:55:57 -0700187 libvintf_recovery \
188 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800189 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700190 libtinyxml2 \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700191 libbase \
Yabin Cui53e7a062016-02-17 12:21:52 -0800192 libutils \
Yifan Honge8e4c402017-11-08 14:56:03 -0800193 libcutils \
Ying Wang4e214822013-04-09 21:41:29 -0700194 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700195 libselinux \
196 libz
Doug Zongker49c73a72010-06-29 17:36:28 -0700197
Yabin Cui53e7a062016-02-17 12:21:52 -0800198LOCAL_HAL_STATIC_LIBRARIES := libhealthd
199
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700200ifeq ($(AB_OTA_UPDATER),true)
201 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
202endif
203
Ying Wang5a50b1b2015-03-10 11:56:56 -0700204LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800205
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800206ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Jin Qianded2dac2017-04-21 14:36:12 -0700207LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800208endif
209
210include $(BUILD_EXECUTABLE)
211
Yabin Cui2f272c02016-06-24 18:22:02 -0700212include \
Alex Deymofb00d822016-11-08 15:46:07 -0800213 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700214 $(LOCAL_PATH)/minui/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 Bao32118f62018-04-25 15:19:47 -0700218 $(LOCAL_PATH)/updater_sample/Android.mk \