blob: eef4a020f38fa0533477c8d260cd8520431661a0 [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 \
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 Xu5fe5eb62018-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 Xu5fe5eb62018-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 Xu5fe5eb62018-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
Tao Baof6d25962018-03-23 22:01:43 -0700154LOCAL_STATIC_LIBRARIES := \
155 librecovery \
156 $(TARGET_RECOVERY_UI_LIB) \
Tao Baob168f5f2017-04-16 15:22:13 -0700157 libverifier \
Yabin Cui53e7a062016-02-17 12:21:52 -0800158 libbatterymonitor \
Yabin Cui2f272c02016-06-24 18:22:02 -0700159 libbootloader_message \
Jin Qianded2dac2017-04-21 14:36:12 -0700160 libfs_mgr \
Alex Deymo31653662017-01-11 14:02:13 -0800161 libext4_utils \
Alex Deymo67f3aa82017-01-11 14:38:20 -0800162 libsparse \
Tianjie Xu8cf5c8f2016-09-08 20:10:11 -0700163 libziparchive \
164 libotautil \
Elliott Hughes63a31922016-06-09 17:41:22 -0700165 libmounts \
Joe Onorato6396e702012-05-31 23:21:46 -0700166 libminadbd \
Jerry Zhangd428e792017-07-13 18:17:35 -0700167 libasyncio \
Doug Zongker18a78e02014-07-10 07:31:46 -0700168 libfusesideload \
Tianjie Xu5fe5eb62018-03-20 16:07:39 -0700169 librecovery_ui \
Joe Onorato6396e702012-05-31 23:21:46 -0700170 libminui \
Joe Onorato6396e702012-05-31 23:21:46 -0700171 libpng \
Josh Gao073164f2016-08-05 15:59:05 -0700172 libcrypto_utils \
173 libcrypto \
Tao Bao919d2c92017-04-10 16:55:57 -0700174 libvintf_recovery \
175 libvintf \
Yifan Hong495c5212018-03-06 17:59:58 -0800176 libhidl-gen-utils \
Tao Bao919d2c92017-04-10 16:55:57 -0700177 libtinyxml2 \
Elliott Hughes8fd86d72015-04-13 14:36:02 -0700178 libbase \
Joe Onorato6396e702012-05-31 23:21:46 -0700179 libcutils \
Yabin Cui53e7a062016-02-17 12:21:52 -0800180 libutils \
Ying Wang4e214822013-04-09 21:41:29 -0700181 liblog \
Jin Qian000148d2017-11-03 11:52:33 -0700182 libselinux \
183 libz
Doug Zongker49c73a72010-06-29 17:36:28 -0700184
Yabin Cui53e7a062016-02-17 12:21:52 -0800185LOCAL_HAL_STATIC_LIBRARIES := libhealthd
186
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700187ifeq ($(AB_OTA_UPDATER),true)
188 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
189endif
190
Ying Wang5a50b1b2015-03-10 11:56:56 -0700191LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800192
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800193ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
Jin Qianded2dac2017-04-21 14:36:12 -0700194LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
Mark Salyzyna4f701a2016-03-09 14:58:16 -0800195endif
196
197include $(BUILD_EXECUTABLE)
198
Yabin Cui2f272c02016-06-24 18:22:02 -0700199include \
Alex Deymofb00d822016-11-08 15:46:07 -0800200 $(LOCAL_PATH)/boot_control/Android.mk \
Yabin Cui2f272c02016-06-24 18:22:02 -0700201 $(LOCAL_PATH)/minui/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700202 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700203 $(LOCAL_PATH)/tools/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700204 $(LOCAL_PATH)/updater/Android.mk \
Tao Bao32118f62018-04-25 15:19:47 -0700205 $(LOCAL_PATH)/updater_sample/Android.mk \