blob: 9431c945eb636be977cd1391dc5cc557865f6de7 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
2
3RELINK := $(LOCAL_PATH)/relink.sh
4
5#dummy file to trigger required modules
6include $(CLEAR_VARS)
7LOCAL_MODULE := teamwin
8LOCAL_MODULE_TAGS := eng
9LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
10LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
11
Matt Mowerfb1c4ff2014-04-16 13:43:36 -050012# Manage list
Dees_Troy51a0e822012-09-05 15:24:24 -040013RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dump_image
14RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/flash_image
15RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/erase_image
Ethan Yonker5c933692014-04-04 11:26:32 -050016ifneq ($(TW_USE_TOOLBOX), true)
17 RELINK_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/busybox
18else
19 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mksh
20endif
Dees_Troy51a0e822012-09-05 15:24:24 -040021RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/pigz
bigbiff bigbiff9c754052013-01-09 09:09:08 -050022RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfsck
23RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dosfslabel
24RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/mkdosfs
Dees_Troy51a0e822012-09-05 15:24:24 -040025RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck
26RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs
27RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs
28RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/linker
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040029#RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/twrpmtp
Dees_Troy51a0e822012-09-05 15:24:24 -040030RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libc.so
31RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040032RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcorkscrew.so
33RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libusbhost.so
34RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgccdemangle.so
35RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so
Dees_Troy51a0e822012-09-05 15:24:24 -040036RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdl.so
37RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
38RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_com_err.so
39RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_e2p.so
40RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
41RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_profile.so
42RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_uuid.so
43RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so
44RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libm.so
45RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstdc++.so
46RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libz.so
Dees_Troy2673cec2013-04-02 20:22:16 +000047RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminuitwrp.so
48RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminadbd.so
49RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminzip.so
50RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmtdutils.so
bigbiff bigbiff9c754052013-01-09 09:09:08 -050051RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtar.so
Vojtech Bocek7cc278b2013-02-24 01:40:19 +010052RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libblkid.so
Dees_Troy51a0e822012-09-05 15:24:24 -040053RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmmcutils.so
54RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbmlutils.so
55RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libflashutils.so
56RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstlport.so
Vojtech Bocek85932342013-04-01 22:11:33 +020057#RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmincrypt.so
Dees Troy8d66f8b2013-10-08 14:04:55 +000058RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/toolbox
Ethan Yonker03a42f62014-08-08 11:03:51 -050059ifneq ($(TW_OEM_BUILD),true)
60 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/twrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040061else
62 TW_EXCLUDE_MTP := true
63endif
64ifneq ($(TW_EXCLUDE_MTP), true)
65 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpmtp.so
Ethan Yonker03a42f62014-08-08 11:03:51 -050066endif
Dees_Troya95f55c2013-08-17 13:14:43 +000067ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
68 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
69endif
Dees_Troy2673cec2013-04-02 20:22:16 +000070RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libaosprecovery.so
Dees_Troy930bf012013-08-10 22:19:03 +000071RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
Dees Troy4bf3b0d2013-09-11 19:12:49 +000072ifeq ($(TWHAVE_SELINUX), true)
Dees_Troyf2280ff2013-08-06 18:01:12 +000073 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libselinux.so
Dees_Troye3850a32013-08-29 18:33:47 +000074 ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
75 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
76 endif
Dees_Troyf2280ff2013-08-06 18:01:12 +000077endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +010078ifeq ($(BUILD_ID), GINGERBREAD)
79 TW_NO_EXFAT := true
80endif
Dees_Troyb05ddee2013-01-28 20:24:50 +000081ifneq ($(TW_NO_EXFAT), true)
bigbiff bigbiff9c754052013-01-09 09:09:08 -050082 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/exfat-fuse
Dees_Troyb05ddee2013-01-28 20:24:50 +000083 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/mkexfatfs
Vojtech Bocek7cc278b2013-02-24 01:40:19 +010084 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libexfat.so
bigbiff bigbiff9c754052013-01-09 09:09:08 -050085endif
Dees_Troy51a0e822012-09-05 15:24:24 -040086ifeq ($(TW_INCLUDE_BLOBPACK), true)
87 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/blobpack
88endif
89ifeq ($(TW_INCLUDE_INJECTTWRP), true)
90 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/injecttwrp
91endif
92ifeq ($(TW_INCLUDE_DUMLOCK), true)
93 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/htcdumlock
94endif
95ifeq ($(TW_INCLUDE_CRYPTO), true)
Dees_Troy2673cec2013-04-02 20:22:16 +000096 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfsics.so
Dees_Troy51a0e822012-09-05 15:24:24 -040097 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so
98endif
99ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Dees_Troy2673cec2013-04-02 20:22:16 +0000100 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfsjb.so
Dees_Troy51a0e822012-09-05 15:24:24 -0400101 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so
102endif
Dees_Troy38bd7602012-09-14 13:33:53 -0400103ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
104 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/make_ext4fs
105endif
Dees_Troy4546fe72013-01-10 14:33:27 +0000106ifneq ($(wildcard system/core/libsparse/Android.mk),)
107 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsparse.so
108endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000109ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
110 RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/openaes
111 RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libopenaes.so
112endif
Dees_Troye5017042013-08-29 16:38:55 +0000113ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
114 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.f2fs
115 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.f2fs
116 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fibmap.f2fs
117endif
Dees Troy0226cd52013-11-04 14:12:35 +0000118ifneq ($(wildcard system/core/reboot/Android.mk),)
119 RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/reboot
120endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400121
122TWRP_AUTOGEN := $(intermediates)/teamwin
123
124GEN := $(intermediates)/teamwin
125$(GEN): $(RELINK)
126$(GEN): $(RELINK_SOURCE_FILES) $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
127 $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/sbin $(RELINK_SOURCE_FILES)
128 $(RELINK) $(call intermediates-dir-for,EXECUTABLES,recovery) $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
129
130LOCAL_GENERATED_SOURCES := $(GEN)
131LOCAL_SRC_FILES := teamwin $(GEN)
132include $(BUILD_PREBUILT)
133
Dees_Troy51a0e822012-09-05 15:24:24 -0400134#fix_permissions
135include $(CLEAR_VARS)
136LOCAL_MODULE := fix_permissions.sh
137LOCAL_MODULE_TAGS := eng
138LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
139LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
140LOCAL_SRC_FILES := $(LOCAL_MODULE)
141include $(BUILD_PREBUILT)
142
Dees_Troy51a0e822012-09-05 15:24:24 -0400143#mke2fs.conf
144include $(CLEAR_VARS)
145LOCAL_MODULE := mke2fs.conf
146LOCAL_MODULE_TAGS := eng
147LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
148LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/etc
149LOCAL_SRC_FILES := $(LOCAL_MODULE)
150include $(BUILD_PREBUILT)
151
152ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
153 #parted
154 include $(CLEAR_VARS)
155 LOCAL_MODULE := parted
156 LOCAL_MODULE_TAGS := eng
157 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
158 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
159 LOCAL_SRC_FILES := $(LOCAL_MODULE)
160 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400161endif
162
Dees_Troy83bd4832013-05-04 12:39:56 +0000163# copy license file for OpenAES
164ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
165 include $(CLEAR_VARS)
166 LOCAL_MODULE := ../openaes/LICENSE
167 LOCAL_MODULE_TAGS := eng
168 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
169 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/license/openaes
170 LOCAL_SRC_FILES := $(LOCAL_MODULE)
171 include $(BUILD_PREBUILT)
172endif
173
Dees_Troy51a0e822012-09-05 15:24:24 -0400174ifeq ($(TW_INCLUDE_DUMLOCK), true)
175 #htcdumlock for /system for dumlock
176 include $(CLEAR_VARS)
177 LOCAL_MODULE := htcdumlocksys
178 LOCAL_MODULE_TAGS := eng
179 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
180 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
181 LOCAL_SRC_FILES := $(LOCAL_MODULE)
182 include $(BUILD_PREBUILT)
183
184 #flash_image for /system for dumlock
185 include $(CLEAR_VARS)
186 LOCAL_MODULE := flash_imagesys
187 LOCAL_MODULE_TAGS := eng
188 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
189 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
190 LOCAL_SRC_FILES := $(LOCAL_MODULE)
191 include $(BUILD_PREBUILT)
192
193 #dump_image for /system for dumlock
194 include $(CLEAR_VARS)
195 LOCAL_MODULE := dump_imagesys
196 LOCAL_MODULE_TAGS := eng
197 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
198 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
199 LOCAL_SRC_FILES := $(LOCAL_MODULE)
200 include $(BUILD_PREBUILT)
201
202 #libbmlutils for /system for dumlock
203 include $(CLEAR_VARS)
204 LOCAL_MODULE := libbmlutils.so
205 LOCAL_MODULE_TAGS := eng
206 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
207 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
208 LOCAL_SRC_FILES := $(LOCAL_MODULE)
209 include $(BUILD_PREBUILT)
210
211 #libflashutils for /system for dumlock
212 include $(CLEAR_VARS)
213 LOCAL_MODULE := libflashutils.so
214 LOCAL_MODULE_TAGS := eng
215 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
216 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
217 LOCAL_SRC_FILES := $(LOCAL_MODULE)
218 include $(BUILD_PREBUILT)
219
220 #libmmcutils for /system for dumlock
221 include $(CLEAR_VARS)
222 LOCAL_MODULE := libmmcutils.so
223 LOCAL_MODULE_TAGS := eng
224 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
225 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
226 LOCAL_SRC_FILES := $(LOCAL_MODULE)
227 include $(BUILD_PREBUILT)
228
229 #libmtdutils for /system for dumlock
230 include $(CLEAR_VARS)
231 LOCAL_MODULE := libmtdutils.so
232 LOCAL_MODULE_TAGS := eng
233 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
234 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
235 LOCAL_SRC_FILES := $(LOCAL_MODULE)
236 include $(BUILD_PREBUILT)
237
238 #HTCDumlock.apk
239 include $(CLEAR_VARS)
240 LOCAL_MODULE := HTCDumlock.apk
241 LOCAL_MODULE_TAGS := eng
242 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
243 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res/htcd
244 LOCAL_SRC_FILES := $(LOCAL_MODULE)
245 include $(BUILD_PREBUILT)
246endif
Dees_Troy6ef66352013-02-21 08:26:57 -0600247
248ifneq ($(TW_EXCLUDE_SUPERSU), true)
249 #su binary
250 include $(CLEAR_VARS)
251 LOCAL_MODULE := su
252 LOCAL_MODULE_TAGS := eng
253 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
jt1134113ee732013-02-22 23:26:10 -0600254 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/supersu
Dees_Troy6ef66352013-02-21 08:26:57 -0600255 LOCAL_SRC_FILES := $(LOCAL_MODULE)
256 include $(BUILD_PREBUILT)
257
Dees_Troya7939bb2013-08-29 20:21:12 +0000258 #install-recovery.sh
259 include $(CLEAR_VARS)
260 LOCAL_MODULE := install-recovery.sh
261 LOCAL_MODULE_TAGS := eng
262 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
263 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/supersu
264 LOCAL_SRC_FILES := $(LOCAL_MODULE)
265 include $(BUILD_PREBUILT)
266
267 #99SuperSUDaemon
268 include $(CLEAR_VARS)
269 LOCAL_MODULE := 99SuperSUDaemon
270 LOCAL_MODULE_TAGS := eng
271 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
272 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/supersu
273 LOCAL_SRC_FILES := $(LOCAL_MODULE)
274 include $(BUILD_PREBUILT)
275
Dees_Troy6ef66352013-02-21 08:26:57 -0600276 #SuperSU special installer APK
277 include $(CLEAR_VARS)
278 LOCAL_MODULE := Superuser.apk
279 LOCAL_MODULE_TAGS := eng
280 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
jt1134113ee732013-02-22 23:26:10 -0600281 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/supersu
Dees_Troy6ef66352013-02-21 08:26:57 -0600282 LOCAL_SRC_FILES := $(LOCAL_MODULE)
283 include $(BUILD_PREBUILT)
jt1134113ee732013-02-22 23:26:10 -0600284endif