blob: 03e1a6962fe83a0f263b92c94929bc0e2350f697 [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
Doug Zongkere08991e2010-02-02 13:09:52 -080059RECOVERY_API_VERSION := 3
Ken Sumrallf35d1ce2013-02-13 12:59:35 -080060RECOVERY_FSTAB_VERSION := 2
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070061LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
62
Dees_Troy51a0e822012-09-05 15:24:24 -040063#LOCAL_STATIC_LIBRARIES := \
Dees_Troy1669f892013-09-04 18:35:08 +000064# libext4_utils_static \
65# libsparse_static \
Dees_Troy51a0e822012-09-05 15:24:24 -040066# libminzip \
Dees_Troy1669f892013-09-04 18:35:08 +000067# libz \
Dees_Troy51a0e822012-09-05 15:24:24 -040068# libmtdutils \
69# libmincrypt \
70# libminadbd \
Dees_Troy1669f892013-09-04 18:35:08 +000071# libminui \
72# libpixelflinger_static \
73# libpng \
74# libfs_mgr \
75# libcutils \
76# liblog \
77# libselinux \
78# libstdc++ \
79# libm \
80# libc
Dees_Troy51a0e822012-09-05 15:24:24 -040081
82LOCAL_C_INCLUDES += bionic external/stlport/stlport
83
84LOCAL_STATIC_LIBRARIES :=
85LOCAL_SHARED_LIBRARIES :=
86
Dees_Troy2673cec2013-04-02 20:22:16 +000087LOCAL_STATIC_LIBRARIES += libcrecovery libguitwrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040088LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery libcorkscrew
89LOCAL_SHARED_LIBRARIES += libgccdemangle
Doug Zongker49c73a72010-06-29 17:36:28 -070090
Dees_Troy4546fe72013-01-10 14:33:27 +000091ifneq ($(wildcard system/core/libsparse/Android.mk),)
92LOCAL_SHARED_LIBRARIES += libsparse
93endif
94
Ethan Yonker7af51ce2014-04-04 13:33:30 -050095ifeq ($(TW_OEM_BUILD),true)
96 LOCAL_CFLAGS += -DTW_OEM_BUILD
97 BOARD_HAS_NO_REAL_SDCARD := true
98 TW_USE_TOOLBOX := true
99 TW_EXCLUDE_SUPERSU := true
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400100 TW_EXCLUDE_MTP := true
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500101endif
Doug Zongker49c73a72010-06-29 17:36:28 -0700102ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
Joe Onorato6396e702012-05-31 23:21:46 -0700103 LOCAL_CFLAGS += -DUSE_EXT4
104 LOCAL_C_INCLUDES += system/extras/ext4_utils
Dees_Troya95f55c2013-08-17 13:14:43 +0000105 LOCAL_SHARED_LIBRARIES += libext4_utils
Doug Zongker49c73a72010-06-29 17:36:28 -0700106endif
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000107ifneq ($(wildcard external/libselinux/Android.mk),)
108 TWHAVE_SELINUX := true
109endif
110ifeq ($(TWHAVE_SELINUX), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000111 #LOCAL_C_INCLUDES += external/libselinux/include
112 #LOCAL_STATIC_LIBRARIES += libselinux
113 #LOCAL_CFLAGS += -DHAVE_SELINUX -g
Stephen Smalley1a114492012-01-13 07:59:51 -0500114endif # HAVE_SELINUX
Dees Troy4bf3b0d2013-09-11 19:12:49 +0000115ifeq ($(TWHAVE_SELINUX), true)
Dees_Troyf2280ff2013-08-06 18:01:12 +0000116 LOCAL_C_INCLUDES += external/libselinux/include
Dees_Troya95f55c2013-08-17 13:14:43 +0000117 LOCAL_SHARED_LIBRARIES += libselinux
Dees_Troyf2280ff2013-08-06 18:01:12 +0000118 LOCAL_CFLAGS += -DHAVE_SELINUX -g
Dees_Troya95f55c2013-08-17 13:14:43 +0000119 ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
120 LOCAL_CFLAGS += -DUSE_EXT4
121 LOCAL_C_INCLUDES += system/extras/ext4_utils
122 LOCAL_SHARED_LIBRARIES += libext4_utils
123 endif
Dees_Troyf2280ff2013-08-06 18:01:12 +0000124endif
Doug Zongker49c73a72010-06-29 17:36:28 -0700125
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800126# This binary is in the recovery ramdisk, which is otherwise a copy of root.
127# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
128# a (redundant) copy of the binary in /system/bin for user builds.
129# TODO: Build the ramdisk image in a more principled way.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800130LOCAL_MODULE_TAGS := eng
131
Dees_Troy1669f892013-09-04 18:35:08 +0000132#ifeq ($(TARGET_RECOVERY_UI_LIB),)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700133 LOCAL_SRC_FILES += default_device.cpp
Dees_Troy1669f892013-09-04 18:35:08 +0000134#else
135# LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
136#endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800137
Doug Zongkercc8cd3f2010-09-20 12:16:13 -0700138LOCAL_C_INCLUDES += system/extras/ext4_utils
139
Dees_Troy51a0e822012-09-05 15:24:24 -0400140#TWRP Build Flags
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400141ifeq ($(TW_EXCLUDE_MTP),)
142 LOCAL_SHARED_LIBRARIES += libtwrpmtp
143 LOCAL_CFLAGS += -DTW_HAS_MTP
144endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -0700145ifneq ($(TW_NO_SCREEN_TIMEOUT),)
146 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
147endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400148ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
149 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
150endif
151ifneq ($(SP1_NAME),)
152 LOCAL_CFLAGS += -DSP1_NAME=$(SP1_NAME) -DSP1_BACKUP_METHOD=$(SP1_BACKUP_METHOD) -DSP1_MOUNTABLE=$(SP1_MOUNTABLE)
153endif
154ifneq ($(SP1_DISPLAY_NAME),)
155 LOCAL_CFLAGS += -DSP1_DISPLAY_NAME=$(SP1_DISPLAY_NAME)
156endif
157ifneq ($(SP2_NAME),)
158 LOCAL_CFLAGS += -DSP2_NAME=$(SP2_NAME) -DSP2_BACKUP_METHOD=$(SP2_BACKUP_METHOD) -DSP2_MOUNTABLE=$(SP2_MOUNTABLE)
159endif
160ifneq ($(SP2_DISPLAY_NAME),)
161 LOCAL_CFLAGS += -DSP2_DISPLAY_NAME=$(SP2_DISPLAY_NAME)
162endif
163ifneq ($(SP3_NAME),)
164 LOCAL_CFLAGS += -DSP3_NAME=$(SP3_NAME) -DSP3_BACKUP_METHOD=$(SP3_BACKUP_METHOD) -DSP3_MOUNTABLE=$(SP3_MOUNTABLE)
165endif
166ifneq ($(SP3_DISPLAY_NAME),)
167 LOCAL_CFLAGS += -DSP3_DISPLAY_NAME=$(SP3_DISPLAY_NAME)
168endif
169ifneq ($(RECOVERY_SDCARD_ON_DATA),)
170 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
171endif
172ifneq ($(TW_INCLUDE_DUMLOCK),)
173 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
174endif
175ifneq ($(TW_INTERNAL_STORAGE_PATH),)
176 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
177endif
178ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
179 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
180endif
181ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
182 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
183endif
184ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
185 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
186endif
187ifeq ($(TW_HAS_NO_RECOVERY_PARTITION), true)
188 LOCAL_CFLAGS += -DTW_HAS_NO_RECOVERY_PARTITION
189endif
ChampionSwimmercf33e4d2013-02-03 13:59:22 +0530190ifeq ($(TW_HAS_NO_BOOT_PARTITION), true)
191 LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION
192endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400193ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
194 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
195endif
196ifeq ($(TW_NO_REBOOT_RECOVERY), true)
197 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
198endif
199ifeq ($(TW_NO_BATT_PERCENT), true)
200 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
201endif
202ifneq ($(TW_CUSTOM_POWER_BUTTON),)
203 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
204endif
205ifeq ($(TW_ALWAYS_RMRF), true)
206 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
207endif
208ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
209 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
210endif
211ifeq ($(TW_NO_USB_STORAGE), true)
212 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
213endif
214ifeq ($(TW_INCLUDE_INJECTTWRP), true)
215 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
216endif
217ifeq ($(TW_INCLUDE_BLOBPACK), true)
218 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
219endif
220ifeq ($(TW_DEFAULT_EXTERNAL_STORAGE), true)
221 LOCAL_CFLAGS += -DTW_DEFAULT_EXTERNAL_STORAGE
222endif
223ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
224 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
225endif
226ifneq ($(BOARD_UMS_LUNFILE),)
227 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
228endif
229#ifeq ($(TW_FLASH_FROM_STORAGE), true) Making this the default behavior
230 LOCAL_CFLAGS += -DTW_FLASH_FROM_STORAGE
231#endif
232ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
233 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
234endif
bigbiff bigbiff87940362013-03-09 09:58:50 -0500235ifeq ($(TW_NO_SCREEN_BLANK), true)
236 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
237endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400238ifeq ($(TW_SDEXT_NO_EXT4), true)
239 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
240endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400241ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
242 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
243endif
Dees_Troy3f5c4e82013-02-01 15:16:59 +0000244ifeq ($(TW_NO_EXFAT_FUSE), true)
245 LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE
246endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400247ifeq ($(TW_INCLUDE_CRYPTO), true)
248 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
249 LOCAL_CFLAGS += -DCRYPTO_FS_TYPE=\"$(TW_CRYPTO_FS_TYPE)\"
250 LOCAL_CFLAGS += -DCRYPTO_REAL_BLKDEV=\"$(TW_CRYPTO_REAL_BLKDEV)\"
251 LOCAL_CFLAGS += -DCRYPTO_MNT_POINT=\"$(TW_CRYPTO_MNT_POINT)\"
252 LOCAL_CFLAGS += -DCRYPTO_FS_OPTIONS=\"$(TW_CRYPTO_FS_OPTIONS)\"
253 LOCAL_CFLAGS += -DCRYPTO_FS_FLAGS=\"$(TW_CRYPTO_FS_FLAGS)\"
254 LOCAL_CFLAGS += -DCRYPTO_KEY_LOC=\"$(TW_CRYPTO_KEY_LOC)\"
a39552696ff55ce2013-01-08 16:14:56 +0000255ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true)
256 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO_SAMSUNG=\"$(TW_INCLUDE_CRYPTO_SAMSUNG)\"
257 ifdef TW_CRYPTO_SD_REAL_BLKDEV
258 LOCAL_CFLAGS += -DCRYPTO_SD_REAL_BLKDEV=\"$(TW_CRYPTO_SD_REAL_BLKDEV)\"
259 LOCAL_CFLAGS += -DCRYPTO_SD_FS_TYPE=\"$(TW_CRYPTO_SD_FS_TYPE)\"
260 endif
261 #LOCAL_LDFLAGS += -L$(TARGET_OUT_SHARED_LIBRARIES) -lsec_km
262 LOCAL_LDFLAGS += -ldl
263 LOCAL_STATIC_LIBRARIES += libcrypt_samsung
264endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000265 LOCAL_SHARED_LIBRARIES += libcryptfsics
266 #LOCAL_SRC_FILES += crypto/ics/cryptfs.c
267 #LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
Dees_Troy51a0e822012-09-05 15:24:24 -0400268endif
269ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
270 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
271 LOCAL_CFLAGS += -DTW_INCLUDE_JB_CRYPTO
Dees_Troy2673cec2013-04-02 20:22:16 +0000272 LOCAL_SHARED_LIBRARIES += libcryptfsjb
273 #LOCAL_SRC_FILES += crypto/jb/cryptfs.c
274 #LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
Dees_Troy51a0e822012-09-05 15:24:24 -0400275endif
Anatoly Smaznov10c11f62013-02-12 13:33:40 +0700276ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
277 LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
278endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600279ifneq ($(TW_BRIGHTNESS_PATH),)
280 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
281endif
xNUTxe85f02d2014-07-18 01:30:58 +0200282ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),)
283 LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH)
284endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600285ifneq ($(TW_MAX_BRIGHTNESS),)
286 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
287endif
Dees_Troyf33b4902013-03-01 00:51:39 +0000288ifneq ($(TW_CUSTOM_BATTERY_PATH),)
289 LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH)
290endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000291ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
292 LOCAL_SHARED_LIBRARIES += libopenaes
293else
294 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
295endif
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100296ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),)
297 ifeq ($(TARGET_CPU_VARIANT),krait)
298 LOCAL_CFLAGS += -DQCOM_RTC_FIX
299 endif
300else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true)
301 LOCAL_CFLAGS += -DQCOM_RTC_FIX
302endif
Matt Mower6883d732014-03-20 17:28:13 -0500303ifneq ($(TW_NO_LEGACY_PROPS),)
304 LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS
305endif
Dees Troy4159aed2014-02-28 17:24:43 +0000306ifneq ($(wildcard bionic/libc/include/sys/capability.h),)
307 LOCAL_CFLAGS += -DHAVE_CAPABILITIES
308endif
Sergey 'Jin' Bostandzhyan80a90ed2013-01-04 02:29:03 +0100309
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800310include $(BUILD_EXECUTABLE)
311
Ethan Yonker5c933692014-04-04 11:26:32 -0500312ifneq ($(TW_USE_TOOLBOX), true)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800313include $(CLEAR_VARS)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400314# Create busybox symlinks... gzip and gunzip are excluded because those need to link to pigz instead
315BUSYBOX_LINKS := $(shell cat external/busybox/busybox-full.links)
316exclude := tune2fs mke2fs mkdosfs gzip gunzip
Matt Mower81742fb2014-09-01 14:40:52 -0500317
318# If busybox does not have restorecon, assume it does not have SELinux support.
319# Then, let toolbox provide 'ls' so -Z is available to list SELinux contexts.
Dees Troy8d66f8b2013-10-08 14:04:55 +0000320ifeq ($(TWHAVE_SELINUX), true)
Matt Mower81742fb2014-09-01 14:40:52 -0500321 ifeq ($(filter restorecon, $(notdir $(BUSYBOX_LINKS))),)
322 exclude += ls
323 endif
Dees Troy8d66f8b2013-10-08 14:04:55 +0000324endif
Matt Mower81742fb2014-09-01 14:40:52 -0500325
326RECOVERY_BUSYBOX_TOOLS := $(filter-out $(exclude), $(notdir $(BUSYBOX_LINKS)))
327RECOVERY_BUSYBOX_SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/, $(RECOVERY_BUSYBOX_TOOLS))
Dees_Troyc04dcf72012-10-02 10:46:37 -0400328$(RECOVERY_BUSYBOX_SYMLINKS): BUSYBOX_BINARY := busybox
329$(RECOVERY_BUSYBOX_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
330 @echo "Symlink: $@ -> $(BUSYBOX_BINARY)"
331 @mkdir -p $(dir $@)
332 @rm -rf $@
333 $(hide) ln -sf $(BUSYBOX_BINARY) $@
334
335ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_BUSYBOX_SYMLINKS)
Ethan Yonker5c933692014-04-04 11:26:32 -0500336endif
Dees_Troyc04dcf72012-10-02 10:46:37 -0400337
338include $(CLEAR_VARS)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700339LOCAL_MODULE := verifier_test
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700340LOCAL_FORCE_STATIC_EXECUTABLE := true
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700341LOCAL_MODULE_TAGS := tests
Matt Mower55c75ca2014-08-31 11:30:15 -0500342LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
Joe Onorato6396e702012-05-31 23:21:46 -0700343LOCAL_SRC_FILES := \
344 verifier_test.cpp \
345 verifier.cpp \
346 ui.cpp
347LOCAL_STATIC_LIBRARIES := \
Dees Troyd63c7642013-11-03 13:03:55 +0000348 libmincrypttwrp \
Joe Onorato6396e702012-05-31 23:21:46 -0700349 libminui \
350 libcutils \
351 libstdc++ \
352 libc
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700353include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800354
Dees_Troy2673cec2013-04-02 20:22:16 +0000355include $(CLEAR_VARS)
356
357LOCAL_MODULE := libaosprecovery
358LOCAL_MODULE_TAGS := eng
359LOCAL_MODULES_TAGS = optional
Matt Mower55c75ca2014-08-31 11:30:15 -0500360LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
that7e303cf2014-03-06 07:57:43 +0100361LOCAL_SRC_FILES = adb_install.cpp bootloader.cpp verifier.cpp mtdutils/mtdutils.c legacy_property_service.c
Dees_Troy2673cec2013-04-02 20:22:16 +0000362LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils
Dees Troybb4c0cb2013-11-02 20:25:14 +0000363LOCAL_STATIC_LIBRARIES += libmincrypttwrp
Dees_Troy2673cec2013-04-02 20:22:16 +0000364
Matt Mowerfb60a942014-07-08 22:25:38 -0500365ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
366 LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
367endif
368
Dees_Troy2673cec2013-04-02 20:22:16 +0000369include $(BUILD_SHARED_LIBRARY)
370
Dees_Troy51a0e822012-09-05 15:24:24 -0400371commands_recovery_local_path := $(LOCAL_PATH)
Joe Onorato6396e702012-05-31 23:21:46 -0700372include $(LOCAL_PATH)/minui/Android.mk \
373 $(LOCAL_PATH)/minelf/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700374 $(LOCAL_PATH)/minadbd/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700375 $(LOCAL_PATH)/tools/Android.mk \
376 $(LOCAL_PATH)/edify/Android.mk \
377 $(LOCAL_PATH)/updater/Android.mk \
378 $(LOCAL_PATH)/applypatch/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400379
380#includes for TWRP
Dees_Troy930bf012013-08-10 22:19:03 +0000381include $(commands_recovery_local_path)/injecttwrp/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400382 $(commands_recovery_local_path)/htcdumlock/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400383 $(commands_recovery_local_path)/gui/Android.mk \
384 $(commands_recovery_local_path)/mmcutils/Android.mk \
385 $(commands_recovery_local_path)/bmlutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400386 $(commands_recovery_local_path)/prebuilt/Android.mk \
387 $(commands_recovery_local_path)/mtdutils/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500388 $(commands_recovery_local_path)/flashutils/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400389 $(commands_recovery_local_path)/pigz/Android.mk \
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500390 $(commands_recovery_local_path)/dosfstools/Android.mk \
391 $(commands_recovery_local_path)/libtar/Android.mk \
Dees_Troy51a0e822012-09-05 15:24:24 -0400392 $(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \
a39552696ff55ce2013-01-08 16:14:56 +0000393 $(commands_recovery_local_path)/crypto/cryptfs/Android.mk \
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400394 $(commands_recovery_local_path)/libcrecovery/Android.mk \
Dees_Troy2673cec2013-04-02 20:22:16 +0000395 $(commands_recovery_local_path)/libblkid/Android.mk \
Dees_Troy83bd4832013-05-04 12:39:56 +0000396 $(commands_recovery_local_path)/minuitwrp/Android.mk \
Dees Troy8d66f8b2013-10-08 14:04:55 +0000397 $(commands_recovery_local_path)/openaes/Android.mk \
Dees Troybb4c0cb2013-11-02 20:25:14 +0000398 $(commands_recovery_local_path)/toolbox/Android.mk \
Ethan Yonker50381972014-02-11 11:44:06 -0600399 $(commands_recovery_local_path)/libmincrypt/Android.mk \
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400400 $(commands_recovery_local_path)/twrpTarMain/Android.mk \
401 $(commands_recovery_local_path)/mtp/Android.mk
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400402
a39552696ff55ce2013-01-08 16:14:56 +0000403ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true)
404 include $(commands_recovery_local_path)/crypto/libcrypt_samsung/Android.mk
405endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400406
407ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000408 include $(commands_recovery_local_path)/crypto/jb/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400409 include $(commands_recovery_local_path)/crypto/fs_mgr/Android.mk
Dees Troy4dff2e62013-11-10 04:11:43 +0000410 include $(commands_recovery_local_path)/crypto/logwrapper/Android.mk
411 include $(commands_recovery_local_path)/crypto/scrypt/Android.mk
Dees Troy89310072013-11-11 15:14:14 +0000412 include $(commands_recovery_local_path)/crypto/crypttools/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400413endif
Ethan Yonker3d2baac2014-01-27 22:03:00 -0600414ifeq ($(TWHAVE_SELINUX), true)
Dees Troyb7ae0982013-09-10 20:47:35 +0000415 include $(commands_recovery_local_path)/minzip/Android.mk
416else
417 include $(commands_recovery_local_path)/minzipold/Android.mk
418endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100419ifeq ($(BUILD_ID), GINGERBREAD)
420 TW_NO_EXFAT := true
421endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000422ifneq ($(TW_NO_EXFAT), true)
Captain Throwback6a1acf22014-09-18 12:46:35 -0400423 include $(commands_recovery_local_path)/exfat/mkfs/Android.mk \
Dees_Troyb05ddee2013-01-28 20:24:50 +0000424 $(commands_recovery_local_path)/fuse/Android.mk \
425 $(commands_recovery_local_path)/exfat/libexfat/Android.mk
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500426endif
Captain Throwback6a1acf22014-09-18 12:46:35 -0400427ifneq ($(TW_NO_EXFAT_FUSE), true)
428 include $(commands_recovery_local_path)/exfat/exfat-fuse/Android.mk
429endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000430ifeq ($(TW_INCLUDE_CRYPTO), true)
431 include $(commands_recovery_local_path)/crypto/ics/Android.mk
432endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500433ifneq ($(TW_OEM_BUILD),true)
434 include $(commands_recovery_local_path)/orscmd/Android.mk
435endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500436
Talustus3019a912013-04-06 11:50:07 +0200437# FB2PNG
438ifeq ($(TW_INCLUDE_FB2PNG), true)
439 include $(commands_recovery_local_path)/fb2png/Android.mk
440endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500441
442commands_recovery_local_path :=
443
444endif