blob: 3d95c840c5045cc9d52e360d465c9bbd43808dc8 [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 Mower55c75ca2014-08-31 11:30:15 -050017ifeq ($(RECOVERY_VARIANT),)
18ifeq ($(LOCAL_PATH),bootable/recovery)
19RECOVERY_VARIANT := twrp
20endif
21endif
22
23ifeq ($(RECOVERY_VARIANT),twrp)
24
Motorhead199175b6f662014-06-12 15:58:33 -070025include $(CLEAR_VARS)
26
Dees_Troy51a0e822012-09-05 15:24:24 -040027TARGET_RECOVERY_GUI := true
Joe Onorato6396e702012-05-31 23:21:46 -070028
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080029LOCAL_SRC_FILES := \
Dees_Troy2673cec2013-04-02 20:22:16 +000030 twrp.cpp \
bigbiff bigbiffa0f8a592012-10-09 21:01:03 -040031 fixPermissions.cpp \
bigbiff bigbiff9c754052013-01-09 09:09:08 -050032 twrpTar.cpp \
bigbiff bigbiff34684ff2013-12-01 21:03:45 -050033 twrpDU.cpp \
bigbiff bigbiffcdcfee42013-02-27 21:11:26 -050034 twrpDigest.cpp \
Ethan Yonker1b7a31b2014-07-03 15:09:22 -050035 find_file.cpp \
36 infomanager.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080037
Dees_Troy51a0e822012-09-05 15:24:24 -040038LOCAL_SRC_FILES += \
Dees_Troy51a0e822012-09-05 15:24:24 -040039 data.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040040 partition.cpp \
41 partitionmanager.cpp \
Dees_Troy32c8eb82012-09-11 15:28:06 -040042 twinstall.cpp \
Dees_Troy812660f2012-09-20 09:55:17 -040043 twrp-functions.cpp \
Dees_Troye34c1332013-02-06 19:13:00 +000044 openrecoveryscript.cpp \
45 tarWrite.c
Dees_Troy51a0e822012-09-05 15:24:24 -040046
Dees_Troya58bead2012-09-27 09:49:29 -040047ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
Dees_Troy51a0e822012-09-05 15:24:24 -040048 LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
49endif
50
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080051LOCAL_MODULE := recovery
52
Dees_Troy51a0e822012-09-05 15:24:24 -040053#LOCAL_FORCE_STATIC_EXECUTABLE := true
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080054
Doug Zongkere08991e2010-02-02 13:09:52 -080055RECOVERY_API_VERSION := 3
Ken Sumrallf35d1ce2013-02-13 12:59:35 -080056RECOVERY_FSTAB_VERSION := 2
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070057LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
58
Dees_Troy51a0e822012-09-05 15:24:24 -040059#LOCAL_STATIC_LIBRARIES := \
Dees_Troy1669f892013-09-04 18:35:08 +000060# libext4_utils_static \
61# libsparse_static \
Dees_Troy51a0e822012-09-05 15:24:24 -040062# libminzip \
Dees_Troy1669f892013-09-04 18:35:08 +000063# libz \
Dees_Troy51a0e822012-09-05 15:24:24 -040064# libmtdutils \
65# libmincrypt \
66# libminadbd \
Dees_Troy1669f892013-09-04 18:35:08 +000067# libminui \
68# libpixelflinger_static \
69# libpng \
70# libfs_mgr \
71# libcutils \
72# liblog \
73# libselinux \
74# libstdc++ \
75# libm \
76# libc
Dees_Troy51a0e822012-09-05 15:24:24 -040077
78LOCAL_C_INCLUDES += bionic external/stlport/stlport
79
80LOCAL_STATIC_LIBRARIES :=
81LOCAL_SHARED_LIBRARIES :=
82
Dees_Troy2673cec2013-04-02 20:22:16 +000083LOCAL_STATIC_LIBRARIES += libcrecovery libguitwrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040084LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery libcorkscrew
85LOCAL_SHARED_LIBRARIES += libgccdemangle
Doug Zongker49c73a72010-06-29 17:36:28 -070086
Dees_Troy4546fe72013-01-10 14:33:27 +000087ifneq ($(wildcard system/core/libsparse/Android.mk),)
88LOCAL_SHARED_LIBRARIES += libsparse
89endif
90
Ethan Yonker7af51ce2014-04-04 13:33:30 -050091ifeq ($(TW_OEM_BUILD),true)
92 LOCAL_CFLAGS += -DTW_OEM_BUILD
93 BOARD_HAS_NO_REAL_SDCARD := true
94 TW_USE_TOOLBOX := true
95 TW_EXCLUDE_SUPERSU := true
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040096 TW_EXCLUDE_MTP := true
Ethan Yonker7af51ce2014-04-04 13:33:30 -050097endif
Doug Zongker49c73a72010-06-29 17:36:28 -070098ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
Joe Onorato6396e702012-05-31 23:21:46 -070099 LOCAL_CFLAGS += -DUSE_EXT4
100 LOCAL_C_INCLUDES += system/extras/ext4_utils
Dees_Troya95f55c2013-08-17 13:14:43 +0000101 LOCAL_SHARED_LIBRARIES += libext4_utils
Doug Zongker49c73a72010-06-29 17:36:28 -0700102endif
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000103ifneq ($(wildcard external/libselinux/Android.mk),)
104 TWHAVE_SELINUX := true
105endif
106ifeq ($(TWHAVE_SELINUX), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000107 #LOCAL_C_INCLUDES += external/libselinux/include
108 #LOCAL_STATIC_LIBRARIES += libselinux
109 #LOCAL_CFLAGS += -DHAVE_SELINUX -g
Stephen Smalley1a114492012-01-13 07:59:51 -0500110endif # HAVE_SELINUX
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000111ifeq ($(TWHAVE_SELINUX), true)
Dees_Troyf2280ff2013-08-06 18:01:12 +0000112 LOCAL_C_INCLUDES += external/libselinux/include
Dees_Troya95f55c2013-08-17 13:14:43 +0000113 LOCAL_SHARED_LIBRARIES += libselinux
Dees_Troyf2280ff2013-08-06 18:01:12 +0000114 LOCAL_CFLAGS += -DHAVE_SELINUX -g
Dees_Troya95f55c2013-08-17 13:14:43 +0000115 ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
116 LOCAL_CFLAGS += -DUSE_EXT4
117 LOCAL_C_INCLUDES += system/extras/ext4_utils
118 LOCAL_SHARED_LIBRARIES += libext4_utils
119 endif
Dees_Troyf2280ff2013-08-06 18:01:12 +0000120endif
Doug Zongker49c73a72010-06-29 17:36:28 -0700121
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800122# This binary is in the recovery ramdisk, which is otherwise a copy of root.
123# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
124# a (redundant) copy of the binary in /system/bin for user builds.
125# TODO: Build the ramdisk image in a more principled way.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800126LOCAL_MODULE_TAGS := eng
127
Dees_Troy1669f892013-09-04 18:35:08 +0000128#ifeq ($(TARGET_RECOVERY_UI_LIB),)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700129 LOCAL_SRC_FILES += default_device.cpp
Dees_Troy1669f892013-09-04 18:35:08 +0000130#else
131# LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
132#endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800133
Doug Zongkercc8cd3f2010-09-20 12:16:13 -0700134LOCAL_C_INCLUDES += system/extras/ext4_utils
135
Dees_Troy51a0e822012-09-05 15:24:24 -0400136#TWRP Build Flags
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400137ifeq ($(TW_EXCLUDE_MTP),)
138 LOCAL_SHARED_LIBRARIES += libtwrpmtp
139 LOCAL_CFLAGS += -DTW_HAS_MTP
140endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -0700141ifneq ($(TW_NO_SCREEN_TIMEOUT),)
142 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
143endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400144ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
145 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
146endif
147ifneq ($(SP1_NAME),)
148 LOCAL_CFLAGS += -DSP1_NAME=$(SP1_NAME) -DSP1_BACKUP_METHOD=$(SP1_BACKUP_METHOD) -DSP1_MOUNTABLE=$(SP1_MOUNTABLE)
149endif
150ifneq ($(SP1_DISPLAY_NAME),)
151 LOCAL_CFLAGS += -DSP1_DISPLAY_NAME=$(SP1_DISPLAY_NAME)
152endif
153ifneq ($(SP2_NAME),)
154 LOCAL_CFLAGS += -DSP2_NAME=$(SP2_NAME) -DSP2_BACKUP_METHOD=$(SP2_BACKUP_METHOD) -DSP2_MOUNTABLE=$(SP2_MOUNTABLE)
155endif
156ifneq ($(SP2_DISPLAY_NAME),)
157 LOCAL_CFLAGS += -DSP2_DISPLAY_NAME=$(SP2_DISPLAY_NAME)
158endif
159ifneq ($(SP3_NAME),)
160 LOCAL_CFLAGS += -DSP3_NAME=$(SP3_NAME) -DSP3_BACKUP_METHOD=$(SP3_BACKUP_METHOD) -DSP3_MOUNTABLE=$(SP3_MOUNTABLE)
161endif
162ifneq ($(SP3_DISPLAY_NAME),)
163 LOCAL_CFLAGS += -DSP3_DISPLAY_NAME=$(SP3_DISPLAY_NAME)
164endif
165ifneq ($(RECOVERY_SDCARD_ON_DATA),)
166 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
167endif
168ifneq ($(TW_INCLUDE_DUMLOCK),)
169 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
170endif
171ifneq ($(TW_INTERNAL_STORAGE_PATH),)
172 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
173endif
174ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
175 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
176endif
177ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
178 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
179endif
180ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
181 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
182endif
183ifeq ($(TW_HAS_NO_RECOVERY_PARTITION), true)
184 LOCAL_CFLAGS += -DTW_HAS_NO_RECOVERY_PARTITION
185endif
ChampionSwimmercf33e4d2013-02-03 13:59:22 +0530186ifeq ($(TW_HAS_NO_BOOT_PARTITION), true)
187 LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION
188endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400189ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
190 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
191endif
192ifeq ($(TW_NO_REBOOT_RECOVERY), true)
193 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
194endif
195ifeq ($(TW_NO_BATT_PERCENT), true)
196 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
197endif
198ifneq ($(TW_CUSTOM_POWER_BUTTON),)
199 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
200endif
201ifeq ($(TW_ALWAYS_RMRF), true)
202 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
203endif
204ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
205 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
206endif
207ifeq ($(TW_NO_USB_STORAGE), true)
208 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
209endif
210ifeq ($(TW_INCLUDE_INJECTTWRP), true)
211 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
212endif
213ifeq ($(TW_INCLUDE_BLOBPACK), true)
214 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
215endif
216ifeq ($(TW_DEFAULT_EXTERNAL_STORAGE), true)
217 LOCAL_CFLAGS += -DTW_DEFAULT_EXTERNAL_STORAGE
218endif
219ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
220 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
221endif
222ifneq ($(BOARD_UMS_LUNFILE),)
223 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
224endif
225#ifeq ($(TW_FLASH_FROM_STORAGE), true) Making this the default behavior
226 LOCAL_CFLAGS += -DTW_FLASH_FROM_STORAGE
227#endif
228ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
229 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
230endif
bigbiff bigbiff87940362013-03-09 09:58:50 -0500231ifeq ($(TW_NO_SCREEN_BLANK), true)
232 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
233endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400234ifeq ($(TW_SDEXT_NO_EXT4), true)
235 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
236endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400237ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
238 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
239endif
Dees_Troy3f5c4e82013-02-01 15:16:59 +0000240ifeq ($(TW_NO_EXFAT_FUSE), true)
241 LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE
242endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400243ifeq ($(TW_INCLUDE_CRYPTO), true)
244 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
245 LOCAL_CFLAGS += -DCRYPTO_FS_TYPE=\"$(TW_CRYPTO_FS_TYPE)\"
246 LOCAL_CFLAGS += -DCRYPTO_REAL_BLKDEV=\"$(TW_CRYPTO_REAL_BLKDEV)\"
247 LOCAL_CFLAGS += -DCRYPTO_MNT_POINT=\"$(TW_CRYPTO_MNT_POINT)\"
248 LOCAL_CFLAGS += -DCRYPTO_FS_OPTIONS=\"$(TW_CRYPTO_FS_OPTIONS)\"
249 LOCAL_CFLAGS += -DCRYPTO_FS_FLAGS=\"$(TW_CRYPTO_FS_FLAGS)\"
250 LOCAL_CFLAGS += -DCRYPTO_KEY_LOC=\"$(TW_CRYPTO_KEY_LOC)\"
a39552696ff55ce2013-01-08 16:14:56 +0000251ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true)
252 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO_SAMSUNG=\"$(TW_INCLUDE_CRYPTO_SAMSUNG)\"
253 ifdef TW_CRYPTO_SD_REAL_BLKDEV
254 LOCAL_CFLAGS += -DCRYPTO_SD_REAL_BLKDEV=\"$(TW_CRYPTO_SD_REAL_BLKDEV)\"
255 LOCAL_CFLAGS += -DCRYPTO_SD_FS_TYPE=\"$(TW_CRYPTO_SD_FS_TYPE)\"
256 endif
257 #LOCAL_LDFLAGS += -L$(TARGET_OUT_SHARED_LIBRARIES) -lsec_km
258 LOCAL_LDFLAGS += -ldl
259 LOCAL_STATIC_LIBRARIES += libcrypt_samsung
260endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000261 LOCAL_SHARED_LIBRARIES += libcryptfsics
262 #LOCAL_SRC_FILES += crypto/ics/cryptfs.c
263 #LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
Dees_Troy51a0e822012-09-05 15:24:24 -0400264endif
265ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
266 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
267 LOCAL_CFLAGS += -DTW_INCLUDE_JB_CRYPTO
Dees_Troy2673cec2013-04-02 20:22:16 +0000268 LOCAL_SHARED_LIBRARIES += libcryptfsjb
269 #LOCAL_SRC_FILES += crypto/jb/cryptfs.c
270 #LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
Dees_Troy51a0e822012-09-05 15:24:24 -0400271endif
Anatoly Smaznov10c11f62013-02-12 13:33:40 +0700272ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
273 LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
274endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600275ifneq ($(TW_BRIGHTNESS_PATH),)
276 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
277endif
xNUTxe85f02d2014-07-18 01:30:58 +0200278ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),)
279 LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH)
280endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600281ifneq ($(TW_MAX_BRIGHTNESS),)
282 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
283endif
Dees_Troyf33b4902013-03-01 00:51:39 +0000284ifneq ($(TW_CUSTOM_BATTERY_PATH),)
285 LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH)
286endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000287ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
288 LOCAL_SHARED_LIBRARIES += libopenaes
289else
290 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
291endif
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100292ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),)
293 ifeq ($(TARGET_CPU_VARIANT),krait)
294 LOCAL_CFLAGS += -DQCOM_RTC_FIX
295 endif
296else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true)
297 LOCAL_CFLAGS += -DQCOM_RTC_FIX
298endif
Matt Mower6883d732014-03-20 17:28:13 -0500299ifneq ($(TW_NO_LEGACY_PROPS),)
300 LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS
301endif
Dees Troy4159aed2014-02-28 17:24:43 +0000302ifneq ($(wildcard bionic/libc/include/sys/capability.h),)
303 LOCAL_CFLAGS += -DHAVE_CAPABILITIES
304endif
Sergey 'Jin' Bostandzhyan80a90ed2013-01-04 02:29:03 +0100305
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800306include $(BUILD_EXECUTABLE)
307
Ethan Yonker5c933692014-04-04 11:26:32 -0500308ifneq ($(TW_USE_TOOLBOX), true)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800309include $(CLEAR_VARS)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400310# Create busybox symlinks... gzip and gunzip are excluded because those need to link to pigz instead
311BUSYBOX_LINKS := $(shell cat external/busybox/busybox-full.links)
312exclude := tune2fs mke2fs mkdosfs gzip gunzip
Matt Mower81742fb2014-09-01 14:40:52 -0500313
314# If busybox does not have restorecon, assume it does not have SELinux support.
315# Then, let toolbox provide 'ls' so -Z is available to list SELinux contexts.
Dees Troy8d66f8b2013-10-08 14:04:55 +0000316ifeq ($(TWHAVE_SELINUX), true)
Matt Mower81742fb2014-09-01 14:40:52 -0500317 ifeq ($(filter restorecon, $(notdir $(BUSYBOX_LINKS))),)
318 exclude += ls
319 endif
Dees Troy8d66f8b2013-10-08 14:04:55 +0000320endif
Matt Mower81742fb2014-09-01 14:40:52 -0500321
322RECOVERY_BUSYBOX_TOOLS := $(filter-out $(exclude), $(notdir $(BUSYBOX_LINKS)))
323RECOVERY_BUSYBOX_SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/, $(RECOVERY_BUSYBOX_TOOLS))
Dees_Troyc04dcf72012-10-02 10:46:37 -0400324$(RECOVERY_BUSYBOX_SYMLINKS): BUSYBOX_BINARY := busybox
325$(RECOVERY_BUSYBOX_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
326 @echo "Symlink: $@ -> $(BUSYBOX_BINARY)"
327 @mkdir -p $(dir $@)
328 @rm -rf $@
329 $(hide) ln -sf $(BUSYBOX_BINARY) $@
330
331ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_BUSYBOX_SYMLINKS)
Ethan Yonker5c933692014-04-04 11:26:32 -0500332endif
Dees_Troyc04dcf72012-10-02 10:46:37 -0400333
334include $(CLEAR_VARS)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700335LOCAL_MODULE := verifier_test
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700336LOCAL_FORCE_STATIC_EXECUTABLE := true
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700337LOCAL_MODULE_TAGS := tests
Matt Mower55c75ca2014-08-31 11:30:15 -0500338LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
Joe Onorato6396e702012-05-31 23:21:46 -0700339LOCAL_SRC_FILES := \
340 verifier_test.cpp \
341 verifier.cpp \
342 ui.cpp
343LOCAL_STATIC_LIBRARIES := \
Dees Troyd63c7642013-11-03 13:03:55 +0000344 libmincrypttwrp \
Joe Onorato6396e702012-05-31 23:21:46 -0700345 libminui \
346 libcutils \
347 libstdc++ \
348 libc
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700349include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800350
Dees_Troy2673cec2013-04-02 20:22:16 +0000351include $(CLEAR_VARS)
352
353LOCAL_MODULE := libaosprecovery
354LOCAL_MODULE_TAGS := eng
355LOCAL_MODULES_TAGS = optional
Matt Mower55c75ca2014-08-31 11:30:15 -0500356LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
that7e303cf2014-03-06 07:57:43 +0100357LOCAL_SRC_FILES = adb_install.cpp bootloader.cpp verifier.cpp mtdutils/mtdutils.c legacy_property_service.c
Dees_Troy2673cec2013-04-02 20:22:16 +0000358LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils
Dees Troybb4c0cb2013-11-02 20:25:14 +0000359LOCAL_STATIC_LIBRARIES += libmincrypttwrp
Dees_Troy2673cec2013-04-02 20:22:16 +0000360
Matt Mowerfb60a942014-07-08 22:25:38 -0500361ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
362 LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
363endif
364
Dees_Troy2673cec2013-04-02 20:22:16 +0000365include $(BUILD_SHARED_LIBRARY)
366
Dees_Troy51a0e822012-09-05 15:24:24 -0400367commands_recovery_local_path := $(LOCAL_PATH)
Joe Onorato6396e702012-05-31 23:21:46 -0700368include $(LOCAL_PATH)/minui/Android.mk \
369 $(LOCAL_PATH)/minelf/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700370 $(LOCAL_PATH)/minadbd/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700371 $(LOCAL_PATH)/tools/Android.mk \
372 $(LOCAL_PATH)/edify/Android.mk \
373 $(LOCAL_PATH)/updater/Android.mk \
374 $(LOCAL_PATH)/applypatch/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400375
376#includes for TWRP
Dees_Troy930bf012013-08-10 22:19:03 +0000377include $(commands_recovery_local_path)/injecttwrp/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400378 $(commands_recovery_local_path)/htcdumlock/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400379 $(commands_recovery_local_path)/gui/Android.mk \
380 $(commands_recovery_local_path)/mmcutils/Android.mk \
381 $(commands_recovery_local_path)/bmlutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400382 $(commands_recovery_local_path)/prebuilt/Android.mk \
383 $(commands_recovery_local_path)/mtdutils/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500384 $(commands_recovery_local_path)/flashutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400385 $(commands_recovery_local_path)/pigz/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500386 $(commands_recovery_local_path)/dosfstools/Android.mk \
387 $(commands_recovery_local_path)/libtar/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400388 $(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \
a39552696ff55ce2013-01-08 16:14:56 +0000389 $(commands_recovery_local_path)/crypto/cryptfs/Android.mk \
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400390 $(commands_recovery_local_path)/libcrecovery/Android.mk \
Dees_Troy2673cec2013-04-02 20:22:16 +0000391 $(commands_recovery_local_path)/libblkid/Android.mk \
Dees_Troy83bd4832013-05-04 12:39:56 +0000392 $(commands_recovery_local_path)/minuitwrp/Android.mk \
Dees Troy8d66f8b2013-10-08 14:04:55 +0000393 $(commands_recovery_local_path)/openaes/Android.mk \
Dees Troybb4c0cb2013-11-02 20:25:14 +0000394 $(commands_recovery_local_path)/toolbox/Android.mk \
Ethan Yonker50381972014-02-11 11:44:06 -0600395 $(commands_recovery_local_path)/libmincrypt/Android.mk \
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400396 $(commands_recovery_local_path)/twrpTarMain/Android.mk \
397 $(commands_recovery_local_path)/mtp/Android.mk
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400398
a39552696ff55ce2013-01-08 16:14:56 +0000399ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true)
400 include $(commands_recovery_local_path)/crypto/libcrypt_samsung/Android.mk
401endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400402
403ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000404 include $(commands_recovery_local_path)/crypto/jb/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400405 include $(commands_recovery_local_path)/crypto/fs_mgr/Android.mk
Dees Troy4dff2e62013-11-10 04:11:43 +0000406 include $(commands_recovery_local_path)/crypto/logwrapper/Android.mk
407 include $(commands_recovery_local_path)/crypto/scrypt/Android.mk
Dees Troy89310072013-11-11 15:14:14 +0000408 include $(commands_recovery_local_path)/crypto/crypttools/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400409endif
Ethan Yonker3d2baac2014-01-27 22:03:00 -0600410ifeq ($(TWHAVE_SELINUX), true)
Dees Troyb7ae0982013-09-10 20:47:35 +0000411 include $(commands_recovery_local_path)/minzip/Android.mk
412else
413 include $(commands_recovery_local_path)/minzipold/Android.mk
414endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100415ifeq ($(BUILD_ID), GINGERBREAD)
416 TW_NO_EXFAT := true
417endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000418ifneq ($(TW_NO_EXFAT), true)
419 include $(commands_recovery_local_path)/exfat/exfat-fuse/Android.mk \
420 $(commands_recovery_local_path)/exfat/mkfs/Android.mk \
421 $(commands_recovery_local_path)/fuse/Android.mk \
422 $(commands_recovery_local_path)/exfat/libexfat/Android.mk
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500423endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000424ifeq ($(TW_INCLUDE_CRYPTO), true)
425 include $(commands_recovery_local_path)/crypto/ics/Android.mk
426endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500427ifneq ($(TW_OEM_BUILD),true)
428 include $(commands_recovery_local_path)/orscmd/Android.mk
429endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500430
Talustus3019a912013-04-06 11:50:07 +0200431# FB2PNG
432ifeq ($(TW_INCLUDE_FB2PNG), true)
433 include $(commands_recovery_local_path)/fb2png/Android.mk
434endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500435
436commands_recovery_local_path :=
437
438endif