Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 1 | # 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 Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 14 | |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 15 | LOCAL_PATH := $(call my-dir) |
| 16 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 17 | TARGET_RECOVERY_GUI := true |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 18 | |
| 19 | include $(CLEAR_VARS) |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 20 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 21 | LOCAL_SRC_FILES := \ |
Doug Zongker | 28ce47c | 2011-10-28 10:33:05 -0700 | [diff] [blame] | 22 | recovery.cpp \ |
Dees_Troy | 7c2dec8 | 2012-09-26 09:49:14 -0400 | [diff] [blame] | 23 | twbootloader.cpp \ |
Doug Zongker | 28ce47c | 2011-10-28 10:33:05 -0700 | [diff] [blame] | 24 | install.cpp \ |
| 25 | roots.cpp \ |
Doug Zongker | 32a0a47 | 2011-11-01 11:00:20 -0700 | [diff] [blame] | 26 | ui.cpp \ |
Doug Zongker | 211aebc | 2011-10-28 15:13:10 -0700 | [diff] [blame] | 27 | screen_ui.cpp \ |
Doug Zongker | 9270a20 | 2012-01-09 15:16:13 -0800 | [diff] [blame] | 28 | verifier.cpp \ |
| 29 | adb_install.cpp |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 30 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 31 | LOCAL_SRC_FILES += \ |
| 32 | extra-functions.c \ |
| 33 | data.cpp \ |
Dees_Troy | 9df963c | 2012-09-26 08:58:12 -0400 | [diff] [blame] | 34 | makelist.cpp \ |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 35 | partition.cpp \ |
| 36 | partitionmanager.cpp \ |
Dees_Troy | 32c8eb8 | 2012-09-11 15:28:06 -0400 | [diff] [blame] | 37 | mtdutils/mtdutils.c \ |
| 38 | twinstall.cpp \ |
Dees_Troy | 812660f | 2012-09-20 09:55:17 -0400 | [diff] [blame] | 39 | twrp-functions.cpp \ |
| 40 | openrecoveryscript.cpp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 41 | |
| 42 | ifeq ($(TARGET_RECOVERY_REBOOT_SRC),) |
| 43 | LOCAL_SRC_FILES += reboot.c |
| 44 | else |
| 45 | LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC) |
| 46 | endif |
| 47 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 48 | LOCAL_MODULE := recovery |
| 49 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 50 | #LOCAL_FORCE_STATIC_EXECUTABLE := true |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 51 | |
Doug Zongker | e08991e | 2010-02-02 13:09:52 -0800 | [diff] [blame] | 52 | RECOVERY_API_VERSION := 3 |
Doug Zongker | fb2e3af | 2009-06-17 17:29:40 -0700 | [diff] [blame] | 53 | LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) |
| 54 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 55 | #LOCAL_STATIC_LIBRARIES := \ |
| 56 | # libext4_utils \ |
| 57 | # libminzip \ |
| 58 | # libmtdutils \ |
| 59 | # libmincrypt \ |
| 60 | # libminadbd \ |
| 61 | # libpixelflinger_static |
| 62 | |
| 63 | LOCAL_C_INCLUDES += bionic external/stlport/stlport |
| 64 | |
| 65 | LOCAL_STATIC_LIBRARIES := |
| 66 | LOCAL_SHARED_LIBRARIES := |
| 67 | |
| 68 | LOCAL_STATIC_LIBRARIES += libmtdutils |
Dees_Troy | 43d8b00 | 2012-09-17 16:00:01 -0400 | [diff] [blame] | 69 | LOCAL_STATIC_LIBRARIES += libminadbd libminzip libunz |
Dees_Troy | 7d15c25 | 2012-09-05 20:47:21 -0400 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES += libminuitwrp libpixelflinger_static libpng libjpegtwrp libgui |
Dees_Troy | 43d8b00 | 2012-09-17 16:00:01 -0400 | [diff] [blame] | 71 | LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libmincrypt libext4_utils |
Doug Zongker | 49c73a7 | 2010-06-29 17:36:28 -0700 | [diff] [blame] | 72 | |
| 73 | ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 74 | LOCAL_CFLAGS += -DUSE_EXT4 |
| 75 | LOCAL_C_INCLUDES += system/extras/ext4_utils |
Dees_Troy | 43d8b00 | 2012-09-17 16:00:01 -0400 | [diff] [blame] | 76 | #LOCAL_STATIC_LIBRARIES += libext4_utils |
Doug Zongker | 49c73a7 | 2010-06-29 17:36:28 -0700 | [diff] [blame] | 77 | endif |
| 78 | |
Stephen Smalley | 1a11449 | 2012-01-13 07:59:51 -0500 | [diff] [blame] | 79 | ifeq ($(HAVE_SELINUX), true) |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 80 | LOCAL_C_INCLUDES += external/libselinux/include |
| 81 | LOCAL_STATIC_LIBRARIES += libselinux |
| 82 | LOCAL_CFLAGS += -DHAVE_SELINUX |
Stephen Smalley | 1a11449 | 2012-01-13 07:59:51 -0500 | [diff] [blame] | 83 | endif # HAVE_SELINUX |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 84 | |
| 85 | # This binary is in the recovery ramdisk, which is otherwise a copy of root. |
| 86 | # It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses |
| 87 | # a (redundant) copy of the binary in /system/bin for user builds. |
| 88 | # TODO: Build the ramdisk image in a more principled way. |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 89 | LOCAL_MODULE_TAGS := eng |
| 90 | |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 91 | ifeq ($(TARGET_RECOVERY_UI_LIB),) |
Doug Zongker | daefc1d | 2011-10-31 09:34:15 -0700 | [diff] [blame] | 92 | LOCAL_SRC_FILES += default_device.cpp |
Doug Zongker | ddd6a28 | 2009-06-09 12:22:33 -0700 | [diff] [blame] | 93 | else |
| 94 | LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB) |
| 95 | endif |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 96 | |
Doug Zongker | cc8cd3f | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 97 | LOCAL_C_INCLUDES += system/extras/ext4_utils |
| 98 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 99 | #TWRP Build Flags |
| 100 | ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true) |
| 101 | LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD |
| 102 | endif |
| 103 | ifneq ($(SP1_NAME),) |
| 104 | LOCAL_CFLAGS += -DSP1_NAME=$(SP1_NAME) -DSP1_BACKUP_METHOD=$(SP1_BACKUP_METHOD) -DSP1_MOUNTABLE=$(SP1_MOUNTABLE) |
| 105 | endif |
| 106 | ifneq ($(SP1_DISPLAY_NAME),) |
| 107 | LOCAL_CFLAGS += -DSP1_DISPLAY_NAME=$(SP1_DISPLAY_NAME) |
| 108 | endif |
| 109 | ifneq ($(SP2_NAME),) |
| 110 | LOCAL_CFLAGS += -DSP2_NAME=$(SP2_NAME) -DSP2_BACKUP_METHOD=$(SP2_BACKUP_METHOD) -DSP2_MOUNTABLE=$(SP2_MOUNTABLE) |
| 111 | endif |
| 112 | ifneq ($(SP2_DISPLAY_NAME),) |
| 113 | LOCAL_CFLAGS += -DSP2_DISPLAY_NAME=$(SP2_DISPLAY_NAME) |
| 114 | endif |
| 115 | ifneq ($(SP3_NAME),) |
| 116 | LOCAL_CFLAGS += -DSP3_NAME=$(SP3_NAME) -DSP3_BACKUP_METHOD=$(SP3_BACKUP_METHOD) -DSP3_MOUNTABLE=$(SP3_MOUNTABLE) |
| 117 | endif |
| 118 | ifneq ($(SP3_DISPLAY_NAME),) |
| 119 | LOCAL_CFLAGS += -DSP3_DISPLAY_NAME=$(SP3_DISPLAY_NAME) |
| 120 | endif |
| 121 | ifneq ($(RECOVERY_SDCARD_ON_DATA),) |
| 122 | LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA |
| 123 | endif |
| 124 | ifneq ($(TW_INCLUDE_DUMLOCK),) |
| 125 | LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK |
| 126 | endif |
| 127 | ifneq ($(TW_INTERNAL_STORAGE_PATH),) |
| 128 | LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH) |
| 129 | endif |
| 130 | ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),) |
| 131 | LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT) |
| 132 | endif |
| 133 | ifneq ($(TW_EXTERNAL_STORAGE_PATH),) |
| 134 | LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH) |
| 135 | endif |
| 136 | ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),) |
| 137 | LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT) |
| 138 | endif |
| 139 | ifeq ($(TW_HAS_NO_RECOVERY_PARTITION), true) |
| 140 | LOCAL_CFLAGS += -DTW_HAS_NO_RECOVERY_PARTITION |
| 141 | endif |
| 142 | ifeq ($(TW_NO_REBOOT_BOOTLOADER), true) |
| 143 | LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER |
| 144 | endif |
| 145 | ifeq ($(TW_NO_REBOOT_RECOVERY), true) |
| 146 | LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY |
| 147 | endif |
| 148 | ifeq ($(TW_NO_BATT_PERCENT), true) |
| 149 | LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT |
| 150 | endif |
| 151 | ifneq ($(TW_CUSTOM_POWER_BUTTON),) |
| 152 | LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON) |
| 153 | endif |
| 154 | ifeq ($(TW_ALWAYS_RMRF), true) |
| 155 | LOCAL_CFLAGS += -DTW_ALWAYS_RMRF |
| 156 | endif |
| 157 | ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true) |
| 158 | LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM |
| 159 | endif |
| 160 | ifeq ($(TW_NO_USB_STORAGE), true) |
| 161 | LOCAL_CFLAGS += -DTW_NO_USB_STORAGE |
| 162 | endif |
| 163 | ifeq ($(TW_INCLUDE_INJECTTWRP), true) |
| 164 | LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP |
| 165 | endif |
| 166 | ifeq ($(TW_INCLUDE_BLOBPACK), true) |
| 167 | LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK |
| 168 | endif |
| 169 | ifeq ($(TW_DEFAULT_EXTERNAL_STORAGE), true) |
| 170 | LOCAL_CFLAGS += -DTW_DEFAULT_EXTERNAL_STORAGE |
| 171 | endif |
| 172 | ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),) |
| 173 | LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\" |
| 174 | endif |
| 175 | ifneq ($(BOARD_UMS_LUNFILE),) |
| 176 | LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\" |
| 177 | endif |
| 178 | #ifeq ($(TW_FLASH_FROM_STORAGE), true) Making this the default behavior |
| 179 | LOCAL_CFLAGS += -DTW_FLASH_FROM_STORAGE |
| 180 | #endif |
| 181 | ifeq ($(TW_HAS_DOWNLOAD_MODE), true) |
| 182 | LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE |
| 183 | endif |
| 184 | ifeq ($(TW_SDEXT_NO_EXT4), true) |
| 185 | LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4 |
| 186 | endif |
Dees_Troy | fdf5fcc | 2012-09-11 10:27:01 -0400 | [diff] [blame] | 187 | ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true) |
| 188 | LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID |
| 189 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 190 | ifeq ($(TW_INCLUDE_CRYPTO), true) |
| 191 | LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO |
| 192 | LOCAL_CFLAGS += -DCRYPTO_FS_TYPE=\"$(TW_CRYPTO_FS_TYPE)\" |
| 193 | LOCAL_CFLAGS += -DCRYPTO_REAL_BLKDEV=\"$(TW_CRYPTO_REAL_BLKDEV)\" |
| 194 | LOCAL_CFLAGS += -DCRYPTO_MNT_POINT=\"$(TW_CRYPTO_MNT_POINT)\" |
| 195 | LOCAL_CFLAGS += -DCRYPTO_FS_OPTIONS=\"$(TW_CRYPTO_FS_OPTIONS)\" |
| 196 | LOCAL_CFLAGS += -DCRYPTO_FS_FLAGS=\"$(TW_CRYPTO_FS_FLAGS)\" |
| 197 | LOCAL_CFLAGS += -DCRYPTO_KEY_LOC=\"$(TW_CRYPTO_KEY_LOC)\" |
| 198 | LOCAL_SHARED_LIBRARIES += libcrypto |
| 199 | LOCAL_SRC_FILES += crypto/ics/cryptfs.c |
| 200 | LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include |
| 201 | endif |
| 202 | ifeq ($(TW_INCLUDE_JB_CRYPTO), true) |
| 203 | LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO |
| 204 | LOCAL_CFLAGS += -DTW_INCLUDE_JB_CRYPTO |
| 205 | LOCAL_SHARED_LIBRARIES += libcrypto |
| 206 | LOCAL_STATIC_LIBRARIES += libfs_mgrtwrp |
| 207 | LOCAL_SRC_FILES += crypto/jb/cryptfs.c |
| 208 | LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include |
| 209 | endif |
| 210 | |
| 211 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 212 | include $(BUILD_EXECUTABLE) |
| 213 | |
Doug Zongker | 73ae31c | 2009-12-09 17:01:45 -0800 | [diff] [blame] | 214 | |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 215 | |
Doug Zongker | 73ae31c | 2009-12-09 17:01:45 -0800 | [diff] [blame] | 216 | include $(CLEAR_VARS) |
Doug Zongker | daefc1d | 2011-10-31 09:34:15 -0700 | [diff] [blame] | 217 | LOCAL_MODULE := verifier_test |
Doug Zongker | daefc1d | 2011-10-31 09:34:15 -0700 | [diff] [blame] | 218 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Doug Zongker | daefc1d | 2011-10-31 09:34:15 -0700 | [diff] [blame] | 219 | LOCAL_MODULE_TAGS := tests |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 220 | LOCAL_SRC_FILES := \ |
| 221 | verifier_test.cpp \ |
| 222 | verifier.cpp \ |
| 223 | ui.cpp |
| 224 | LOCAL_STATIC_LIBRARIES := \ |
| 225 | libmincrypt \ |
| 226 | libminui \ |
| 227 | libcutils \ |
| 228 | libstdc++ \ |
| 229 | libc |
Doug Zongker | daefc1d | 2011-10-31 09:34:15 -0700 | [diff] [blame] | 230 | include $(BUILD_EXECUTABLE) |
Doug Zongker | 73ae31c | 2009-12-09 17:01:45 -0800 | [diff] [blame] | 231 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 232 | commands_recovery_local_path := $(LOCAL_PATH) |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 233 | include $(LOCAL_PATH)/minui/Android.mk \ |
| 234 | $(LOCAL_PATH)/minelf/Android.mk \ |
| 235 | $(LOCAL_PATH)/minzip/Android.mk \ |
| 236 | $(LOCAL_PATH)/minadbd/Android.mk \ |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 237 | $(LOCAL_PATH)/tools/Android.mk \ |
| 238 | $(LOCAL_PATH)/edify/Android.mk \ |
| 239 | $(LOCAL_PATH)/updater/Android.mk \ |
| 240 | $(LOCAL_PATH)/applypatch/Android.mk |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 241 | |
| 242 | #includes for TWRP |
| 243 | include $(commands_recovery_local_path)/libjpegtwrp/Android.mk \ |
| 244 | $(commands_recovery_local_path)/injecttwrp/Android.mk \ |
| 245 | $(commands_recovery_local_path)/htcdumlock/Android.mk \ |
| 246 | $(commands_recovery_local_path)/minuitwrp/Android.mk \ |
| 247 | $(commands_recovery_local_path)/gui/Android.mk \ |
| 248 | $(commands_recovery_local_path)/mmcutils/Android.mk \ |
| 249 | $(commands_recovery_local_path)/bmlutils/Android.mk \ |
| 250 | $(commands_recovery_local_path)/flashutils/Android.mk \ |
| 251 | $(commands_recovery_local_path)/prebuilt/Android.mk \ |
| 252 | $(commands_recovery_local_path)/mtdutils/Android.mk \ |
| 253 | $(commands_recovery_local_path)/pigz/Android.mk \ |
| 254 | $(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \ |
Dees_Troy | b9d88ac | 2012-09-14 14:34:19 -0400 | [diff] [blame] | 255 | $(commands_recovery_local_path)/libcrecovery/Android.mk \ |
| 256 | $(commands_recovery_local_path)/twmincrypt/Android.mk |
| 257 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 258 | |
| 259 | ifeq ($(TW_INCLUDE_JB_CRYPTO), true) |
| 260 | include $(commands_recovery_local_path)/crypto/fs_mgr/Android.mk |
| 261 | endif |
| 262 | |
| 263 | commands_recovery_local_path := |
| 264 | |