Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | include $(CLEAR_VARS) |
| 3 | |
Motorhead1991 | c7f2e12 | 2014-06-12 15:57:36 -0700 | [diff] [blame] | 4 | LOCAL_CFLAGS := -fno-strict-aliasing |
| 5 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 6 | LOCAL_SRC_FILES := \ |
| 7 | gui.cpp \ |
| 8 | resources.cpp \ |
| 9 | pages.cpp \ |
| 10 | text.cpp \ |
| 11 | image.cpp \ |
| 12 | action.cpp \ |
| 13 | console.cpp \ |
| 14 | fill.cpp \ |
| 15 | button.cpp \ |
| 16 | checkbox.cpp \ |
| 17 | fileselector.cpp \ |
| 18 | progressbar.cpp \ |
| 19 | animation.cpp \ |
Vojtech Bocek | ede51c5 | 2014-02-07 23:58:09 +0100 | [diff] [blame] | 20 | object.cpp \ |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 21 | slider.cpp \ |
Vojtech Bocek | 8593234 | 2013-04-01 22:11:33 +0200 | [diff] [blame] | 22 | slidervalue.cpp \ |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 23 | listbox.cpp \ |
| 24 | keyboard.cpp \ |
bigbiff bigbiff | 8a68c31 | 2013-02-10 14:28:30 -0500 | [diff] [blame] | 25 | input.cpp \ |
| 26 | blanktimer.cpp \ |
Vojtech Bocek | 1fc30fc | 2014-01-29 18:37:19 +0100 | [diff] [blame] | 27 | partitionlist.cpp \ |
| 28 | mousecursor.cpp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 29 | |
| 30 | ifneq ($(TWRP_CUSTOM_KEYBOARD),) |
| 31 | LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD) |
| 32 | else |
| 33 | LOCAL_SRC_FILES += hardwarekeyboard.cpp |
| 34 | endif |
| 35 | |
Dees_Troy | 94e2a46 | 2013-08-22 12:25:14 +0000 | [diff] [blame] | 36 | LOCAL_SHARED_LIBRARIES += libminuitwrp libc libstdc++ |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 37 | LOCAL_MODULE := libguitwrp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 38 | |
| 39 | # Use this flag to create a build that simulates threaded actions like installing zips, backups, restores, and wipes for theme testing |
| 40 | #TWRP_SIMULATE_ACTIONS := true |
| 41 | ifeq ($(TWRP_SIMULATE_ACTIONS), true) |
| 42 | LOCAL_CFLAGS += -D_SIMULATE_ACTIONS |
| 43 | endif |
| 44 | |
| 45 | #TWRP_EVENT_LOGGING := true |
| 46 | ifeq ($(TWRP_EVENT_LOGGING), true) |
| 47 | LOCAL_CFLAGS += -D_EVENT_LOGGING |
| 48 | endif |
| 49 | |
| 50 | ifneq ($(RECOVERY_SDCARD_ON_DATA),) |
| 51 | LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA |
| 52 | endif |
Dees_Troy | e2920fa | 2012-09-19 16:18:00 -0400 | [diff] [blame] | 53 | ifneq ($(TW_EXTERNAL_STORAGE_PATH),) |
| 54 | LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH) |
| 55 | endif |
bigbiff bigbiff | 8794036 | 2013-03-09 09:58:50 -0500 | [diff] [blame] | 56 | ifneq ($(TW_NO_SCREEN_BLANK),) |
| 57 | LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK |
| 58 | endif |
Ricardo Gomez | c9ecd44 | 2013-07-05 16:13:52 -0700 | [diff] [blame] | 59 | ifneq ($(TW_NO_SCREEN_TIMEOUT),) |
| 60 | LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT |
| 61 | endif |
Dees Troy | b7ae098 | 2013-09-10 20:47:35 +0000 | [diff] [blame] | 62 | ifeq ($(HAVE_SELINUX), true) |
| 63 | LOCAL_CFLAGS += -DHAVE_SELINUX |
| 64 | endif |
Ethan Yonker | 83e8257 | 2014-04-04 10:59:28 -0500 | [diff] [blame] | 65 | ifeq ($(TW_OEM_BUILD),true) |
| 66 | LOCAL_CFLAGS += -DTW_OEM_BUILD |
| 67 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 68 | |
bigbiff bigbiff | 163d474 | 2013-11-16 13:25:27 -0500 | [diff] [blame] | 69 | ifeq ($(DEVICE_RESOLUTION),) |
bigbiff bigbiff | 705f16e | 2013-11-16 09:59:44 -0500 | [diff] [blame] | 70 | $(warning ********************************************************************************) |
| 71 | $(warning * DEVICE_RESOLUTION is NOT SET in BoardConfig.mk ) |
| 72 | $(warning * Please see http://tinyw.in/nP7d for details ) |
| 73 | $(warning ********************************************************************************) |
| 74 | $(error stopping) |
| 75 | endif |
| 76 | |
bigbiff bigbiff | 163d474 | 2013-11-16 13:25:27 -0500 | [diff] [blame] | 77 | ifeq "$(wildcard bootable/recovery/gui/devices/$(DEVICE_RESOLUTION))" "" |
| 78 | $(warning ********************************************************************************) |
| 79 | $(warning * DEVICE_RESOLUTION ($(DEVICE_RESOLUTION)) does NOT EXIST in bootable/recovery/gui/devices ) |
| 80 | $(warning * Please choose an existing theme or create a new one for your device ) |
| 81 | $(warning ********************************************************************************) |
| 82 | $(error stopping) |
| 83 | endif |
| 84 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 85 | LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION) |
| 86 | |
| 87 | include $(BUILD_STATIC_LIBRARY) |
| 88 | |
| 89 | # Transfer in the resources for the device |
| 90 | include $(CLEAR_VARS) |
| 91 | LOCAL_MODULE := twrp |
| 92 | LOCAL_MODULE_TAGS := eng |
| 93 | LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES |
| 94 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 95 | TWRP_RES_LOC := $(commands_recovery_local_path)/gui/devices/common/res |
Ethan Yonker | 780cd39 | 2014-07-21 15:24:39 -0500 | [diff] [blame] | 96 | TWRP_COMMON_XML := $(hide) echo "No common TWRP XML resources" |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 97 | |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 98 | ifeq ($(TW_CUSTOM_THEME),) |
big biff | ba535e3 | 2014-07-29 00:44:47 +0000 | [diff] [blame] | 99 | PORTRAIT := 320x480 480x800 480x854 540x960 720x1280 800x1280 1080x1920 1200x1920 1440x2560 1600x2560 |
| 100 | LANDSCAPE := 800x480 1024x600 1024x768 1280x800 1920x1200 2560x1600 |
Ethan Yonker | d9b7200 | 2014-07-30 08:46:28 -0500 | [diff] [blame] | 101 | WATCH := 240x240 280x280 320x320 |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 102 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)/res |
big biff | ba535e3 | 2014-07-29 00:44:47 +0000 | [diff] [blame] | 103 | ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT)),) |
Ethan Yonker | 780cd39 | 2014-07-21 15:24:39 -0500 | [diff] [blame] | 104 | TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/portrait/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/ |
big biff | ba535e3 | 2014-07-29 00:44:47 +0000 | [diff] [blame] | 105 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE)),) |
Ethan Yonker | 780cd39 | 2014-07-21 15:24:39 -0500 | [diff] [blame] | 106 | TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/landscape/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/ |
Ethan Yonker | d9b7200 | 2014-07-30 08:46:28 -0500 | [diff] [blame] | 107 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(WATCH)),) |
| 108 | TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/watch/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/ |
Ethan Yonker | 780cd39 | 2014-07-21 15:24:39 -0500 | [diff] [blame] | 109 | endif |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 110 | else |
| 111 | TWRP_THEME_LOC := $(TW_CUSTOM_THEME) |
| 112 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 113 | TWRP_RES_GEN := $(intermediates)/twrp |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 114 | ifneq ($(TW_USE_TOOLBOX), true) |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 115 | TWRP_SH_TARGET := /sbin/busybox |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 116 | else |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 117 | TWRP_SH_TARGET := /sbin/mksh |
| 118 | endif |
| 119 | |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 120 | $(TWRP_RES_GEN): |
| 121 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res/ |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 122 | cp -fr $(TWRP_RES_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)/res/ |
| 123 | cp -fr $(TWRP_THEME_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)/res/ |
Ethan Yonker | 780cd39 | 2014-07-21 15:24:39 -0500 | [diff] [blame] | 124 | $(TWRP_COMMON_XML) |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 125 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/ |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 126 | ln -sf $(TWRP_SH_TARGET) $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 127 | ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip |
| 128 | ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 129 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 130 | |
| 131 | LOCAL_GENERATED_SOURCES := $(TWRP_RES_GEN) |
| 132 | LOCAL_SRC_FILES := twrp $(TWRP_RES_GEN) |
Dees_Troy | 7d15c25 | 2012-09-05 20:47:21 -0400 | [diff] [blame] | 133 | include $(BUILD_PREBUILT) |