blob: 600f35635d10622b06f89f1d0b3ab9ce79645de2 [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
Dees_Troy51a0e822012-09-05 15:24:24 -040017TARGET_RECOVERY_GUI := true
Joe Onorato6396e702012-05-31 23:21:46 -070018
19include $(CLEAR_VARS)
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080020
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080021LOCAL_SRC_FILES := \
Doug Zongker28ce47c2011-10-28 10:33:05 -070022 recovery.cpp \
23 bootloader.cpp \
24 install.cpp \
25 roots.cpp \
Doug Zongker32a0a472011-11-01 11:00:20 -070026 ui.cpp \
Doug Zongker211aebc2011-10-28 15:13:10 -070027 screen_ui.cpp \
Doug Zongker9270a202012-01-09 15:16:13 -080028 verifier.cpp \
29 adb_install.cpp
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080030
Dees_Troy51a0e822012-09-05 15:24:24 -040031LOCAL_SRC_FILES += \
32 extra-functions.c \
33 data.cpp \
34 makelist.c \
Dees_Troy51a0e822012-09-05 15:24:24 -040035 partition.cpp \
36 partitionmanager.cpp \
Dees_Troy32c8eb82012-09-11 15:28:06 -040037 mtdutils/mtdutils.c \
38 twinstall.cpp \
Dees_Troy38bd7602012-09-14 13:33:53 -040039 twrp-functions.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040040
41ifeq ($(TARGET_RECOVERY_REBOOT_SRC),)
42 LOCAL_SRC_FILES += reboot.c
43else
44 LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
45endif
46
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080047LOCAL_MODULE := recovery
48
Dees_Troy51a0e822012-09-05 15:24:24 -040049#LOCAL_FORCE_STATIC_EXECUTABLE := true
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080050
Doug Zongkere08991e2010-02-02 13:09:52 -080051RECOVERY_API_VERSION := 3
Doug Zongkerfb2e3af2009-06-17 17:29:40 -070052LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
53
Dees_Troy51a0e822012-09-05 15:24:24 -040054#LOCAL_STATIC_LIBRARIES := \
55# libext4_utils \
56# libminzip \
57# libmtdutils \
58# libmincrypt \
59# libminadbd \
60# libpixelflinger_static
61
62LOCAL_C_INCLUDES += bionic external/stlport/stlport
63
64LOCAL_STATIC_LIBRARIES :=
65LOCAL_SHARED_LIBRARIES :=
66
67LOCAL_STATIC_LIBRARIES += libmtdutils
Dees_Troy43d8b002012-09-17 16:00:01 -040068LOCAL_STATIC_LIBRARIES += libminadbd libminzip libunz
Dees_Troy7d15c252012-09-05 20:47:21 -040069LOCAL_STATIC_LIBRARIES += libminuitwrp libpixelflinger_static libpng libjpegtwrp libgui
Dees_Troy43d8b002012-09-17 16:00:01 -040070LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libmincrypt libext4_utils
Doug Zongker49c73a72010-06-29 17:36:28 -070071
72ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
Joe Onorato6396e702012-05-31 23:21:46 -070073 LOCAL_CFLAGS += -DUSE_EXT4
74 LOCAL_C_INCLUDES += system/extras/ext4_utils
Dees_Troy43d8b002012-09-17 16:00:01 -040075 #LOCAL_STATIC_LIBRARIES += libext4_utils
Doug Zongker49c73a72010-06-29 17:36:28 -070076endif
77
Stephen Smalley1a114492012-01-13 07:59:51 -050078ifeq ($(HAVE_SELINUX), true)
Joe Onorato6396e702012-05-31 23:21:46 -070079 LOCAL_C_INCLUDES += external/libselinux/include
80 LOCAL_STATIC_LIBRARIES += libselinux
81 LOCAL_CFLAGS += -DHAVE_SELINUX
Stephen Smalley1a114492012-01-13 07:59:51 -050082endif # HAVE_SELINUX
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080083
84# This binary is in the recovery ramdisk, which is otherwise a copy of root.
85# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
86# a (redundant) copy of the binary in /system/bin for user builds.
87# TODO: Build the ramdisk image in a more principled way.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080088LOCAL_MODULE_TAGS := eng
89
Doug Zongkerddd6a282009-06-09 12:22:33 -070090ifeq ($(TARGET_RECOVERY_UI_LIB),)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -070091 LOCAL_SRC_FILES += default_device.cpp
Doug Zongkerddd6a282009-06-09 12:22:33 -070092else
93 LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
94endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080095
Doug Zongkercc8cd3f2010-09-20 12:16:13 -070096LOCAL_C_INCLUDES += system/extras/ext4_utils
97
Dees_Troy51a0e822012-09-05 15:24:24 -040098#TWRP Build Flags
99ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
100 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
101endif
102ifneq ($(SP1_NAME),)
103 LOCAL_CFLAGS += -DSP1_NAME=$(SP1_NAME) -DSP1_BACKUP_METHOD=$(SP1_BACKUP_METHOD) -DSP1_MOUNTABLE=$(SP1_MOUNTABLE)
104endif
105ifneq ($(SP1_DISPLAY_NAME),)
106 LOCAL_CFLAGS += -DSP1_DISPLAY_NAME=$(SP1_DISPLAY_NAME)
107endif
108ifneq ($(SP2_NAME),)
109 LOCAL_CFLAGS += -DSP2_NAME=$(SP2_NAME) -DSP2_BACKUP_METHOD=$(SP2_BACKUP_METHOD) -DSP2_MOUNTABLE=$(SP2_MOUNTABLE)
110endif
111ifneq ($(SP2_DISPLAY_NAME),)
112 LOCAL_CFLAGS += -DSP2_DISPLAY_NAME=$(SP2_DISPLAY_NAME)
113endif
114ifneq ($(SP3_NAME),)
115 LOCAL_CFLAGS += -DSP3_NAME=$(SP3_NAME) -DSP3_BACKUP_METHOD=$(SP3_BACKUP_METHOD) -DSP3_MOUNTABLE=$(SP3_MOUNTABLE)
116endif
117ifneq ($(SP3_DISPLAY_NAME),)
118 LOCAL_CFLAGS += -DSP3_DISPLAY_NAME=$(SP3_DISPLAY_NAME)
119endif
120ifneq ($(RECOVERY_SDCARD_ON_DATA),)
121 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
122endif
123ifneq ($(TW_INCLUDE_DUMLOCK),)
124 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
125endif
126ifneq ($(TW_INTERNAL_STORAGE_PATH),)
127 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
128endif
129ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
130 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
131endif
132ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
133 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
134endif
135ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
136 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
137endif
138ifeq ($(TW_HAS_NO_RECOVERY_PARTITION), true)
139 LOCAL_CFLAGS += -DTW_HAS_NO_RECOVERY_PARTITION
140endif
141ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
142 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
143endif
144ifeq ($(TW_NO_REBOOT_RECOVERY), true)
145 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
146endif
147ifeq ($(TW_NO_BATT_PERCENT), true)
148 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
149endif
150ifneq ($(TW_CUSTOM_POWER_BUTTON),)
151 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
152endif
153ifeq ($(TW_ALWAYS_RMRF), true)
154 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
155endif
156ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
157 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
158endif
159ifeq ($(TW_NO_USB_STORAGE), true)
160 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
161endif
162ifeq ($(TW_INCLUDE_INJECTTWRP), true)
163 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
164endif
165ifeq ($(TW_INCLUDE_BLOBPACK), true)
166 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
167endif
168ifeq ($(TW_DEFAULT_EXTERNAL_STORAGE), true)
169 LOCAL_CFLAGS += -DTW_DEFAULT_EXTERNAL_STORAGE
170endif
171ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
172 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
173endif
174ifneq ($(BOARD_UMS_LUNFILE),)
175 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
176endif
177#ifeq ($(TW_FLASH_FROM_STORAGE), true) Making this the default behavior
178 LOCAL_CFLAGS += -DTW_FLASH_FROM_STORAGE
179#endif
180ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
181 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
182endif
183ifeq ($(TW_SDEXT_NO_EXT4), true)
184 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
185endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400186ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
187 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
188endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400189ifeq ($(TW_INCLUDE_CRYPTO), true)
190 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
191 LOCAL_CFLAGS += -DCRYPTO_FS_TYPE=\"$(TW_CRYPTO_FS_TYPE)\"
192 LOCAL_CFLAGS += -DCRYPTO_REAL_BLKDEV=\"$(TW_CRYPTO_REAL_BLKDEV)\"
193 LOCAL_CFLAGS += -DCRYPTO_MNT_POINT=\"$(TW_CRYPTO_MNT_POINT)\"
194 LOCAL_CFLAGS += -DCRYPTO_FS_OPTIONS=\"$(TW_CRYPTO_FS_OPTIONS)\"
195 LOCAL_CFLAGS += -DCRYPTO_FS_FLAGS=\"$(TW_CRYPTO_FS_FLAGS)\"
196 LOCAL_CFLAGS += -DCRYPTO_KEY_LOC=\"$(TW_CRYPTO_KEY_LOC)\"
197 LOCAL_SHARED_LIBRARIES += libcrypto
198 LOCAL_SRC_FILES += crypto/ics/cryptfs.c
199 LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
200endif
201ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
202 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
203 LOCAL_CFLAGS += -DTW_INCLUDE_JB_CRYPTO
204 LOCAL_SHARED_LIBRARIES += libcrypto
205 LOCAL_STATIC_LIBRARIES += libfs_mgrtwrp
206 LOCAL_SRC_FILES += crypto/jb/cryptfs.c
207 LOCAL_C_INCLUDES += system/extras/ext4_utils external/openssl/include
208endif
209
210
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800211include $(BUILD_EXECUTABLE)
212
Doug Zongker73ae31c2009-12-09 17:01:45 -0800213
Joe Onorato6396e702012-05-31 23:21:46 -0700214
Doug Zongker73ae31c2009-12-09 17:01:45 -0800215include $(CLEAR_VARS)
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700216LOCAL_MODULE := verifier_test
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700217LOCAL_FORCE_STATIC_EXECUTABLE := true
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700218LOCAL_MODULE_TAGS := tests
Joe Onorato6396e702012-05-31 23:21:46 -0700219LOCAL_SRC_FILES := \
220 verifier_test.cpp \
221 verifier.cpp \
222 ui.cpp
223LOCAL_STATIC_LIBRARIES := \
224 libmincrypt \
225 libminui \
226 libcutils \
227 libstdc++ \
228 libc
Doug Zongkerdaefc1d2011-10-31 09:34:15 -0700229include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800230
Dees_Troy51a0e822012-09-05 15:24:24 -0400231commands_recovery_local_path := $(LOCAL_PATH)
Joe Onorato6396e702012-05-31 23:21:46 -0700232include $(LOCAL_PATH)/minui/Android.mk \
233 $(LOCAL_PATH)/minelf/Android.mk \
234 $(LOCAL_PATH)/minzip/Android.mk \
235 $(LOCAL_PATH)/minadbd/Android.mk \
Joe Onorato6396e702012-05-31 23:21:46 -0700236 $(LOCAL_PATH)/tools/Android.mk \
237 $(LOCAL_PATH)/edify/Android.mk \
238 $(LOCAL_PATH)/updater/Android.mk \
239 $(LOCAL_PATH)/applypatch/Android.mk
Dees_Troy51a0e822012-09-05 15:24:24 -0400240
241#includes for TWRP
242include $(commands_recovery_local_path)/libjpegtwrp/Android.mk \
243 $(commands_recovery_local_path)/injecttwrp/Android.mk \
244 $(commands_recovery_local_path)/htcdumlock/Android.mk \
245 $(commands_recovery_local_path)/minuitwrp/Android.mk \
246 $(commands_recovery_local_path)/gui/Android.mk \
247 $(commands_recovery_local_path)/mmcutils/Android.mk \
248 $(commands_recovery_local_path)/bmlutils/Android.mk \
249 $(commands_recovery_local_path)/flashutils/Android.mk \
250 $(commands_recovery_local_path)/prebuilt/Android.mk \
251 $(commands_recovery_local_path)/mtdutils/Android.mk \
252 $(commands_recovery_local_path)/pigz/Android.mk \
253 $(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \
Dees_Troyb9d88ac2012-09-14 14:34:19 -0400254 $(commands_recovery_local_path)/libcrecovery/Android.mk \
255 $(commands_recovery_local_path)/twmincrypt/Android.mk
256
Dees_Troy51a0e822012-09-05 15:24:24 -0400257
258ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
259 include $(commands_recovery_local_path)/crypto/fs_mgr/Android.mk
260endif
261
262commands_recovery_local_path :=
263