blob: e10fef10873d1f57f49427933743c6f1191b7c4c [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
Matt Mower66766fe2014-10-06 18:03:39 -050017ifdef project-path-for
18 ifeq ($(LOCAL_PATH),$(call project-path-for,recovery))
19 PROJECT_PATH_AGREES := true
20 endif
21else
22 ifeq ($(LOCAL_PATH),bootable/recovery)
23 PROJECT_PATH_AGREES := true
24 endif
Matt Mower55c75ca2014-08-31 11:30:15 -050025endif
26
Matt Mower66766fe2014-10-06 18:03:39 -050027ifeq ($(PROJECT_PATH_AGREES),true)
Matt Mower55c75ca2014-08-31 11:30:15 -050028
Motorhead199175b6f662014-06-12 15:58:33 -070029include $(CLEAR_VARS)
30
Dees_Troy51a0e822012-09-05 15:24:24 -040031TARGET_RECOVERY_GUI := true
Joe Onorato6396e702012-05-31 23:21:46 -070032
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080033LOCAL_SRC_FILES := \
Dees_Troy2673cec2013-04-02 20:22:16 +000034 twrp.cpp \
bigbiff bigbiffa0f8a592012-10-09 21:01:03 -040035 fixPermissions.cpp \
bigbiff bigbiff9c754052013-01-09 09:09:08 -050036 twrpTar.cpp \
bigbiff bigbiff34684ff2013-12-01 21:03:45 -050037 twrpDU.cpp \
bigbiff bigbiffcdcfee42013-02-27 21:11:26 -050038 twrpDigest.cpp \
Ethan Yonker1b7a31b2014-07-03 15:09:22 -050039 find_file.cpp \
40 infomanager.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080041
Dees_Troy51a0e822012-09-05 15:24:24 -040042LOCAL_SRC_FILES += \
Dees_Troy51a0e822012-09-05 15:24:24 -040043 data.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040044 partition.cpp \
45 partitionmanager.cpp \
Dees_Troy32c8eb82012-09-11 15:28:06 -040046 twinstall.cpp \
Dees_Troy812660f2012-09-20 09:55:17 -040047 twrp-functions.cpp \
Dees_Troye34c1332013-02-06 19:13:00 +000048 openrecoveryscript.cpp \
49 tarWrite.c
Dees_Troy51a0e822012-09-05 15:24:24 -040050
Dees_Troya58bead2012-09-27 09:49:29 -040051ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
Dees_Troy51a0e822012-09-05 15:24:24 -040052 LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
53endif
54
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080055LOCAL_MODULE := recovery
56
Dees_Troy51a0e822012-09-05 15:24:24 -040057#LOCAL_FORCE_STATIC_EXECUTABLE := true
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080058
Ethan Yonkera1674162014-11-06 08:35:10 -060059#ifeq ($(HOST_OS),linux)
60#LOCAL_REQUIRED_MODULES := mkfs.f2fs
61#endif
JP Abgrall37aedb32014-06-16 19:07:39 -070062
Doug Zongkere08991e2010-02-02 13:09:52 -080063RECOVERY_API_VERSION := 3
Ken Sumrallf35d1ce2013-02-13 12:59:35 -080064RECOVERY_FSTAB_VERSION := 2
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070065LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Doug Zongker0d32f252014-02-13 15:07:56 -080066LOCAL_CFLAGS += -Wno-unused-parameter
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070067
Dees_Troy51a0e822012-09-05 15:24:24 -040068#LOCAL_STATIC_LIBRARIES := \
Dees_Troy1669f892013-09-04 18:35:08 +000069# libext4_utils_static \
70# libsparse_static \
Dees_Troy51a0e822012-09-05 15:24:24 -040071# libminzip \
Dees_Troy1669f892013-09-04 18:35:08 +000072# libz \
Dees_Troy51a0e822012-09-05 15:24:24 -040073# libmtdutils \
74# libmincrypt \
75# libminadbd \
Dees_Troy1669f892013-09-04 18:35:08 +000076# libminui \
77# libpixelflinger_static \
78# libpng \
79# libfs_mgr \
80# libcutils \
81# liblog \
82# libselinux \
83# libstdc++ \
84# libm \
85# libc
Dees_Troy51a0e822012-09-05 15:24:24 -040086
Ethan Yonker75bf0412014-11-21 13:54:27 -060087LOCAL_C_INCLUDES += bionic external/stlport/stlport external/openssl/include $(LOCAL_PATH)/libmincrypt/includes
Dees_Troy51a0e822012-09-05 15:24:24 -040088
89LOCAL_STATIC_LIBRARIES :=
90LOCAL_SHARED_LIBRARIES :=
91
Ethan Yonkerbcc502c2014-11-10 11:22:10 -060092LOCAL_STATIC_LIBRARIES += libguitwrp
Ethan Yonker1702eb42014-11-06 09:16:16 -060093LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery
Ethan Yonkerbcc502c2014-11-10 11:22:10 -060094LOCAL_SHARED_LIBRARIES += libgccdemangle libcrecovery
Doug Zongker49c73a72010-06-29 17:36:28 -070095
Dees_Troy4546fe72013-01-10 14:33:27 +000096ifneq ($(wildcard system/core/libsparse/Android.mk),)
97LOCAL_SHARED_LIBRARIES += libsparse
98endif
99
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500100ifeq ($(TW_OEM_BUILD),true)
101 LOCAL_CFLAGS += -DTW_OEM_BUILD
102 BOARD_HAS_NO_REAL_SDCARD := true
103 TW_USE_TOOLBOX := true
104 TW_EXCLUDE_SUPERSU := true
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400105 TW_EXCLUDE_MTP := true
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500106endif
Doug Zongker49c73a72010-06-29 17:36:28 -0700107ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
Joe Onorato6396e702012-05-31 23:21:46 -0700108 LOCAL_CFLAGS += -DUSE_EXT4
109 LOCAL_C_INCLUDES += system/extras/ext4_utils
Dees_Troya95f55c2013-08-17 13:14:43 +0000110 LOCAL_SHARED_LIBRARIES += libext4_utils
Doug Zongker49c73a72010-06-29 17:36:28 -0700111endif
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000112ifneq ($(wildcard external/libselinux/Android.mk),)
113 TWHAVE_SELINUX := true
114endif
115ifeq ($(TWHAVE_SELINUX), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000116 #LOCAL_C_INCLUDES += external/libselinux/include
117 #LOCAL_STATIC_LIBRARIES += libselinux
118 #LOCAL_CFLAGS += -DHAVE_SELINUX -g
Stephen Smalley1a114492012-01-13 07:59:51 -0500119endif # HAVE_SELINUX
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000120ifeq ($(TWHAVE_SELINUX), true)
Dees_Troyf2280ff2013-08-06 18:01:12 +0000121 LOCAL_C_INCLUDES += external/libselinux/include
Dees_Troya95f55c2013-08-17 13:14:43 +0000122 LOCAL_SHARED_LIBRARIES += libselinux
Dees_Troyf2280ff2013-08-06 18:01:12 +0000123 LOCAL_CFLAGS += -DHAVE_SELINUX -g
Dees_Troya95f55c2013-08-17 13:14:43 +0000124 ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
125 LOCAL_CFLAGS += -DUSE_EXT4
126 LOCAL_C_INCLUDES += system/extras/ext4_utils
127 LOCAL_SHARED_LIBRARIES += libext4_utils
128 endif
Dees_Troyf2280ff2013-08-06 18:01:12 +0000129endif
Doug Zongker49c73a72010-06-29 17:36:28 -0700130
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800131# This binary is in the recovery ramdisk, which is otherwise a copy of root.
132# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
133# a (redundant) copy of the binary in /system/bin for user builds.
134# TODO: Build the ramdisk image in a more principled way.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800135LOCAL_MODULE_TAGS := eng
136
Dees_Troy1669f892013-09-04 18:35:08 +0000137#ifeq ($(TARGET_RECOVERY_UI_LIB),)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700138 LOCAL_SRC_FILES += default_device.cpp
Dees_Troy1669f892013-09-04 18:35:08 +0000139#else
140# LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
141#endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800142
Doug Zongkercc8cd3f2010-09-20 12:16:13 -0700143LOCAL_C_INCLUDES += system/extras/ext4_utils
144
Dees_Troy51a0e822012-09-05 15:24:24 -0400145#TWRP Build Flags
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400146ifeq ($(TW_EXCLUDE_MTP),)
147 LOCAL_SHARED_LIBRARIES += libtwrpmtp
148 LOCAL_CFLAGS += -DTW_HAS_MTP
149endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -0700150ifneq ($(TW_NO_SCREEN_TIMEOUT),)
151 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
152endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400153ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
154 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
155endif
156ifneq ($(SP1_NAME),)
157 LOCAL_CFLAGS += -DSP1_NAME=$(SP1_NAME) -DSP1_BACKUP_METHOD=$(SP1_BACKUP_METHOD) -DSP1_MOUNTABLE=$(SP1_MOUNTABLE)
158endif
159ifneq ($(SP1_DISPLAY_NAME),)
160 LOCAL_CFLAGS += -DSP1_DISPLAY_NAME=$(SP1_DISPLAY_NAME)
161endif
162ifneq ($(SP2_NAME),)
163 LOCAL_CFLAGS += -DSP2_NAME=$(SP2_NAME) -DSP2_BACKUP_METHOD=$(SP2_BACKUP_METHOD) -DSP2_MOUNTABLE=$(SP2_MOUNTABLE)
164endif
165ifneq ($(SP2_DISPLAY_NAME),)
166 LOCAL_CFLAGS += -DSP2_DISPLAY_NAME=$(SP2_DISPLAY_NAME)
167endif
168ifneq ($(SP3_NAME),)
169 LOCAL_CFLAGS += -DSP3_NAME=$(SP3_NAME) -DSP3_BACKUP_METHOD=$(SP3_BACKUP_METHOD) -DSP3_MOUNTABLE=$(SP3_MOUNTABLE)
170endif
171ifneq ($(SP3_DISPLAY_NAME),)
172 LOCAL_CFLAGS += -DSP3_DISPLAY_NAME=$(SP3_DISPLAY_NAME)
173endif
174ifneq ($(RECOVERY_SDCARD_ON_DATA),)
175 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
176endif
177ifneq ($(TW_INCLUDE_DUMLOCK),)
178 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
179endif
180ifneq ($(TW_INTERNAL_STORAGE_PATH),)
181 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
182endif
183ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
184 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
185endif
186ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
187 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
188endif
189ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
190 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
191endif
192ifeq ($(TW_HAS_NO_RECOVERY_PARTITION), true)
193 LOCAL_CFLAGS += -DTW_HAS_NO_RECOVERY_PARTITION
194endif
ChampionSwimmercf33e4d2013-02-03 13:59:22 +0530195ifeq ($(TW_HAS_NO_BOOT_PARTITION), true)
196 LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION
197endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400198ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
199 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
200endif
201ifeq ($(TW_NO_REBOOT_RECOVERY), true)
202 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
203endif
204ifeq ($(TW_NO_BATT_PERCENT), true)
205 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
206endif
Jenkins1710bf22014-10-02 20:22:21 -0400207ifeq ($(TW_NO_CPU_TEMP), true)
208 LOCAL_CFLAGS += -DTW_NO_CPU_TEMP
209endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400210ifneq ($(TW_CUSTOM_POWER_BUTTON),)
211 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
212endif
213ifeq ($(TW_ALWAYS_RMRF), true)
214 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
215endif
216ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
217 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
218endif
219ifeq ($(TW_NO_USB_STORAGE), true)
220 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
221endif
222ifeq ($(TW_INCLUDE_INJECTTWRP), true)
223 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
224endif
225ifeq ($(TW_INCLUDE_BLOBPACK), true)
226 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
227endif
228ifeq ($(TW_DEFAULT_EXTERNAL_STORAGE), true)
229 LOCAL_CFLAGS += -DTW_DEFAULT_EXTERNAL_STORAGE
230endif
231ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
232 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
233endif
234ifneq ($(BOARD_UMS_LUNFILE),)
235 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
236endif
237#ifeq ($(TW_FLASH_FROM_STORAGE), true) Making this the default behavior
238 LOCAL_CFLAGS += -DTW_FLASH_FROM_STORAGE
239#endif
240ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
241 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
242endif
bigbiff bigbiff87940362013-03-09 09:58:50 -0500243ifeq ($(TW_NO_SCREEN_BLANK), true)
244 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
245endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400246ifeq ($(TW_SDEXT_NO_EXT4), true)
247 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
248endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400249ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
250 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
251endif
Dees_Troy3f5c4e82013-02-01 15:16:59 +0000252ifeq ($(TW_NO_EXFAT_FUSE), true)
253 LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE
254endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400255ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600256 TW_INCLUDE_CRYPTO := true
Dees_Troy51a0e822012-09-05 15:24:24 -0400257endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600258ifeq ($(TW_INCLUDE_L_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600259 TW_INCLUDE_CRYPTO := true
260endif
261ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600262 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600263 LOCAL_SHARED_LIBRARIES += libcryptfslollipop
264endif
Anatoly Smaznov10c11f62013-02-12 13:33:40 +0700265ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
266 LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
267endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600268ifneq ($(TW_BRIGHTNESS_PATH),)
269 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
270endif
xNUTxe85f02d2014-07-18 01:30:58 +0200271ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),)
272 LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH)
273endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600274ifneq ($(TW_MAX_BRIGHTNESS),)
275 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
276endif
Dees_Troyf33b4902013-03-01 00:51:39 +0000277ifneq ($(TW_CUSTOM_BATTERY_PATH),)
278 LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH)
279endif
Jenkins1710bf22014-10-02 20:22:21 -0400280ifneq ($(TW_CUSTOM_CPU_TEMP_PATH),)
281 LOCAL_CFLAGS += -DTW_CUSTOM_CPU_TEMP_PATH=$(TW_CUSTOM_CPU_TEMP_PATH)
282endif
283ifneq ($(TW_NO_CPU_TEMP),)
284 LOCAL_CFLAGS += -DTW_NO_CPU_TEMP=$(TW_NO_CPU_TEMP)
285endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000286ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
287 LOCAL_SHARED_LIBRARIES += libopenaes
288else
289 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
290endif
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100291ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),)
292 ifeq ($(TARGET_CPU_VARIANT),krait)
293 LOCAL_CFLAGS += -DQCOM_RTC_FIX
294 endif
295else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true)
296 LOCAL_CFLAGS += -DQCOM_RTC_FIX
297endif
Matt Mower6883d732014-03-20 17:28:13 -0500298ifneq ($(TW_NO_LEGACY_PROPS),)
299 LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS
300endif
Dees Troy4159aed2014-02-28 17:24:43 +0000301ifneq ($(wildcard bionic/libc/include/sys/capability.h),)
302 LOCAL_CFLAGS += -DHAVE_CAPABILITIES
303endif
Sergey 'Jin' Bostandzhyan80a90ed2013-01-04 02:29:03 +0100304
Ethan Yonker75bf0412014-11-21 13:54:27 -0600305# Auto filled build flag
erikcas1db013b2014-12-03 15:41:38 +0100306ifeq ($(PLATFORM_VERSION), 5.0.1)
Ethan Yonker75bf0412014-11-21 13:54:27 -0600307 LOCAL_CFLAGS += -DANDROID_VERSION=5
308endif
309
Matt Mower031163b2014-11-01 15:13:03 -0500310LOCAL_ADDITIONAL_DEPENDENCIES := \
Matt Mower031163b2014-11-01 15:13:03 -0500311 dump_image \
312 erase_image \
313 flash_image \
314 fix_permissions.sh \
Matt Mower031163b2014-11-01 15:13:03 -0500315 mke2fs.conf \
Matt Mower031163b2014-11-01 15:13:03 -0500316 pigz \
317 teamwin \
318 toolbox_symlinks \
319 twrp \
Ethan Yonker75bf0412014-11-21 13:54:27 -0600320 unpigz_symlink
Matt Mower031163b2014-11-01 15:13:03 -0500321
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600322ifneq ($(TARGET_ARCH), arm64)
323 LOCAL_ADDITIONAL_DEPENDENCIES += \
324 dosfsck \
325 dosfslabel \
326 fsck_msdos_symlink \
327 mkdosfs
Ethan Yonker1902c792014-12-03 16:48:36 -0600328 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker
329else
330 LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600331endif
332ifneq ($(TW_USE_TOOLBOX), true)
333 LOCAL_ADDITIONAL_DEPENDENCIES += busybox_symlinks
334endif
Matt Mower20172792014-11-14 10:54:03 -0600335ifneq ($(TW_NO_EXFAT), true)
336 LOCAL_ADDITIONAL_DEPENDENCIES += mkexfatfs
337endif
Matt Mower031163b2014-11-01 15:13:03 -0500338ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
339 LOCAL_ADDITIONAL_DEPENDENCIES += parted
340endif
341ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
342 LOCAL_ADDITIONAL_DEPENDENCIES += openaes ../openaes/LICENSE
343endif
344ifeq ($(TW_INCLUDE_DUMLOCK), true)
345 LOCAL_ADDITIONAL_DEPENDENCIES += \
346 htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \
347 libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk
348endif
349ifneq ($(TW_EXCLUDE_SUPERSU), true)
350 LOCAL_ADDITIONAL_DEPENDENCIES += \
351 su install-recovery.sh 99SuperSUDaemon Superuser.apk
352endif
353ifneq ($(TW_NO_EXFAT_FUSE), true)
354 LOCAL_ADDITIONAL_DEPENDENCIES += exfat-fuse
355endif
Matt Mower031163b2014-11-01 15:13:03 -0500356ifeq ($(TW_INCLUDE_FB2PNG), true)
357 LOCAL_ADDITIONAL_DEPENDENCIES += fb2png
358endif
359ifneq ($(TW_OEM_BUILD),true)
360 LOCAL_ADDITIONAL_DEPENDENCIES += orscmd
361endif
362ifeq ($(BOARD_USES_BML_OVER_MTD),true)
363 LOCAL_ADDITIONAL_DEPENDENCIES += bml_over_mtd
364endif
365ifeq ($(TW_INCLUDE_INJECTTWRP), true)
366 LOCAL_ADDITIONAL_DEPENDENCIES += injecttwrp
367endif
368# Allow devices to specify device-specific recovery dependencies
369ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
370 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_RECOVERY_DEVICE_MODULES)
371endif
372
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800373include $(BUILD_EXECUTABLE)
374
Ethan Yonker5c933692014-04-04 11:26:32 -0500375ifneq ($(TW_USE_TOOLBOX), true)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800376include $(CLEAR_VARS)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400377# Create busybox symlinks... gzip and gunzip are excluded because those need to link to pigz instead
378BUSYBOX_LINKS := $(shell cat external/busybox/busybox-full.links)
379exclude := tune2fs mke2fs mkdosfs gzip gunzip
Matt Mower81742fb2014-09-01 14:40:52 -0500380
381# If busybox does not have restorecon, assume it does not have SELinux support.
382# Then, let toolbox provide 'ls' so -Z is available to list SELinux contexts.
Dees Troy8d66f8b2013-10-08 14:04:55 +0000383ifeq ($(TWHAVE_SELINUX), true)
Matt Mower81742fb2014-09-01 14:40:52 -0500384 ifeq ($(filter restorecon, $(notdir $(BUSYBOX_LINKS))),)
385 exclude += ls
386 endif
Dees Troy8d66f8b2013-10-08 14:04:55 +0000387endif
Matt Mower81742fb2014-09-01 14:40:52 -0500388
389RECOVERY_BUSYBOX_TOOLS := $(filter-out $(exclude), $(notdir $(BUSYBOX_LINKS)))
390RECOVERY_BUSYBOX_SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/, $(RECOVERY_BUSYBOX_TOOLS))
Dees_Troyc04dcf72012-10-02 10:46:37 -0400391$(RECOVERY_BUSYBOX_SYMLINKS): BUSYBOX_BINARY := busybox
392$(RECOVERY_BUSYBOX_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
393 @echo "Symlink: $@ -> $(BUSYBOX_BINARY)"
394 @mkdir -p $(dir $@)
395 @rm -rf $@
396 $(hide) ln -sf $(BUSYBOX_BINARY) $@
397
Matt Mower031163b2014-11-01 15:13:03 -0500398include $(CLEAR_VARS)
399LOCAL_MODULE := busybox_symlinks
400LOCAL_MODULE_TAGS := optional
401LOCAL_ADDITIONAL_DEPENDENCIES := $(RECOVERY_BUSYBOX_SYMLINKS)
402include $(BUILD_PHONY_PACKAGE)
403RECOVERY_BUSYBOX_SYMLINKS :=
404endif # !TW_USE_TOOLBOX
Dees_Troyc04dcf72012-10-02 10:46:37 -0400405
Kenny Root7a4adb52013-10-09 10:14:35 -0700406# All the APIs for testing
407include $(CLEAR_VARS)
408LOCAL_MODULE := libverifier
409LOCAL_MODULE_TAGS := tests
410LOCAL_SRC_FILES := \
411 asn1_decoder.cpp
412include $(BUILD_STATIC_LIBRARY)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800413
414include $(CLEAR_VARS)
Ethan Yonkera1674162014-11-06 08:35:10 -0600415LOCAL_SRC_FILES := fuse_sideload.c
416
417LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
418LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
Ethan Yonker75bf0412014-11-21 13:54:27 -0600419LOCAL_MODULE_TAGS := optional
Ethan Yonkera1674162014-11-06 08:35:10 -0600420LOCAL_MODULE := libfusesideload
Ethan Yonker1702eb42014-11-06 09:16:16 -0600421LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
Ethan Yonker560e65f2014-11-17 11:37:00 -0600422LOCAL_SHARED_LIBRARIES := libcutils libc libmincrypttwrp
Ethan Yonkera1674162014-11-06 08:35:10 -0600423include $(BUILD_SHARED_LIBRARY)
424
Dees_Troyc04dcf72012-10-02 10:46:37 -0400425include $(CLEAR_VARS)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700426LOCAL_MODULE := verifier_test
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700427LOCAL_FORCE_STATIC_EXECUTABLE := true
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700428LOCAL_MODULE_TAGS := tests
Ethan Yonkera1674162014-11-06 08:35:10 -0600429
Matt Mower55c75ca2014-08-31 11:30:15 -0500430LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
Ethan Yonkera1674162014-11-06 08:35:10 -0600431
Doug Zongker9e805d62013-09-04 13:44:38 -0700432LOCAL_CFLAGS += -DNO_RECOVERY_MOUNT
Doug Zongker0d32f252014-02-13 15:07:56 -0800433LOCAL_CFLAGS += -Wno-unused-parameter
Ethan Yonkera1674162014-11-06 08:35:10 -0600434
Joe Onorato6396e702012-05-31 23:21:46 -0700435LOCAL_SRC_FILES := \
436 verifier_test.cpp \
Kenny Root7a4adb52013-10-09 10:14:35 -0700437 asn1_decoder.cpp \
Joe Onorato6396e702012-05-31 23:21:46 -0700438 verifier.cpp \
439 ui.cpp
440LOCAL_STATIC_LIBRARIES := \
Dees Troyd63c7642013-11-03 13:03:55 +0000441 libmincrypttwrp \
Joe Onorato6396e702012-05-31 23:21:46 -0700442 libminui \
Doug Zongker99916f02014-01-13 14:16:58 -0800443 libminzip \
Joe Onorato6396e702012-05-31 23:21:46 -0700444 libcutils \
445 libstdc++ \
446 libc
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700447include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800448
Dees_Troy2673cec2013-04-02 20:22:16 +0000449include $(CLEAR_VARS)
450
451LOCAL_MODULE := libaosprecovery
Matt Mowerdb220442014-10-31 22:43:59 -0500452LOCAL_MODULE_TAGS := eng optional
Matt Mower55c75ca2014-08-31 11:30:15 -0500453LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
Ethan Yonker75bf0412014-11-21 13:54:27 -0600454LOCAL_SRC_FILES := adb_install.cpp asn1_decoder.cpp bootloader.cpp mtdutils/mtdutils.c legacy_property_service.c
erikcas1db013b2014-12-03 15:41:38 +0100455ifeq ($(PLATFORM_VERSION), 5.0.1)
Ethan Yonker75bf0412014-11-21 13:54:27 -0600456 LOCAL_SRC_FILES += verifier.cpp
457else
458 LOCAL_SRC_FILES += verifierold.cpp
459endif
Ethan Yonker560e65f2014-11-17 11:37:00 -0600460LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils libfusesideload libmincrypttwrp
Dees_Troy2673cec2013-04-02 20:22:16 +0000461
Matt Mowerfb60a942014-07-08 22:25:38 -0500462ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
463 LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
464endif
465
Dees_Troy2673cec2013-04-02 20:22:16 +0000466include $(BUILD_SHARED_LIBRARY)
467
Dees_Troy51a0e822012-09-05 15:24:24 -0400468commands_recovery_local_path := $(LOCAL_PATH)
Joe Onorato6396e702012-05-31 23:21:46 -0700469include $(LOCAL_PATH)/minui/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700470 $(LOCAL_PATH)/minadbd/Android.mk \
Kenny Root7a4adb52013-10-09 10:14:35 -0700471 $(LOCAL_PATH)/tests/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700472 $(LOCAL_PATH)/tools/Android.mk \
473 $(LOCAL_PATH)/edify/Android.mk \
Doug Zongker76adfc52014-01-13 10:04:25 -0800474 $(LOCAL_PATH)/uncrypt/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700475 $(LOCAL_PATH)/updater/Android.mk \
476 $(LOCAL_PATH)/applypatch/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400477
478#includes for TWRP
Dees_Troy930bf012013-08-10 22:19:03 +0000479include $(commands_recovery_local_path)/injecttwrp/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400480 $(commands_recovery_local_path)/htcdumlock/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400481 $(commands_recovery_local_path)/gui/Android.mk \
482 $(commands_recovery_local_path)/mmcutils/Android.mk \
483 $(commands_recovery_local_path)/bmlutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400484 $(commands_recovery_local_path)/prebuilt/Android.mk \
485 $(commands_recovery_local_path)/mtdutils/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500486 $(commands_recovery_local_path)/flashutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400487 $(commands_recovery_local_path)/pigz/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500488 $(commands_recovery_local_path)/libtar/Android.mk \
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400489 $(commands_recovery_local_path)/libcrecovery/Android.mk \
Dees_Troy2673cec2013-04-02 20:22:16 +0000490 $(commands_recovery_local_path)/libblkid/Android.mk \
Dees_Troy83bd4832013-05-04 12:39:56 +0000491 $(commands_recovery_local_path)/minuitwrp/Android.mk \
Dees Troy8d66f8b2013-10-08 14:04:55 +0000492 $(commands_recovery_local_path)/openaes/Android.mk \
Dees Troybb4c0cb2013-11-02 20:25:14 +0000493 $(commands_recovery_local_path)/toolbox/Android.mk \
Ethan Yonker50381972014-02-11 11:44:06 -0600494 $(commands_recovery_local_path)/libmincrypt/Android.mk \
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400495 $(commands_recovery_local_path)/twrpTarMain/Android.mk \
496 $(commands_recovery_local_path)/mtp/Android.mk
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400497
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600498ifneq ($(TARGET_ARCH), arm64)
499 include $(commands_recovery_local_path)/dosfstools/Android.mk
500endif
501
Ethan Yonker253368a2014-11-25 15:00:52 -0600502ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600503 include $(commands_recovery_local_path)/crypto/lollipop/Android.mk
Ethan Yonker253368a2014-11-25 15:00:52 -0600504 include $(commands_recovery_local_path)/crypto/scrypt/Android.mk
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600505endif
erikcas1db013b2014-12-03 15:41:38 +0100506ifeq ($(PLATFORM_VERSION), 5.0.1)
Dees Troyb7ae0982013-09-10 20:47:35 +0000507 include $(commands_recovery_local_path)/minzip/Android.mk
508else
509 include $(commands_recovery_local_path)/minzipold/Android.mk
510endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100511ifeq ($(BUILD_ID), GINGERBREAD)
512 TW_NO_EXFAT := true
513endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000514ifneq ($(TW_NO_EXFAT), true)
Captain Throwback6a1acf22014-09-18 12:46:35 -0400515 include $(commands_recovery_local_path)/exfat/mkfs/Android.mk \
Dees_Troyb05ddee2013-01-28 20:24:50 +0000516 $(commands_recovery_local_path)/fuse/Android.mk \
517 $(commands_recovery_local_path)/exfat/libexfat/Android.mk
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500518endif
Captain Throwback6a1acf22014-09-18 12:46:35 -0400519ifneq ($(TW_NO_EXFAT_FUSE), true)
520 include $(commands_recovery_local_path)/exfat/exfat-fuse/Android.mk
521endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500522ifneq ($(TW_OEM_BUILD),true)
523 include $(commands_recovery_local_path)/orscmd/Android.mk
524endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500525
Talustus3019a912013-04-06 11:50:07 +0200526# FB2PNG
527ifeq ($(TW_INCLUDE_FB2PNG), true)
528 include $(commands_recovery_local_path)/fb2png/Android.mk
529endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500530
531commands_recovery_local_path :=
532
533endif