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 \ |
Ethan Yonker | 0a3a98f | 2015-02-05 00:48:28 +0100 | [diff] [blame] | 28 | mousecursor.cpp \ |
Vojtech Bocek | 7e11ac5 | 2015-03-05 23:21:49 +0100 | [diff] [blame] | 29 | scrolllist.cpp \ |
Ethan Yonker | 44925ad | 2015-07-22 12:33:59 -0500 | [diff] [blame] | 30 | patternpassword.cpp \ |
Ethan Yonker | 74db157 | 2015-10-28 12:44:49 -0500 | [diff] [blame] | 31 | textbox.cpp \ |
| 32 | twmsg.cpp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 33 | |
| 34 | ifneq ($(TWRP_CUSTOM_KEYBOARD),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 35 | LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD) |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 36 | else |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 37 | LOCAL_SRC_FILES += hardwarekeyboard.cpp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 38 | endif |
| 39 | |
Ethan Yonker | 4b94cfd | 2014-12-11 10:00:45 -0600 | [diff] [blame] | 40 | LOCAL_SHARED_LIBRARIES += libminuitwrp libc libstdc++ libminzip libaosprecovery |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 41 | LOCAL_MODULE := libguitwrp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 42 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 43 | #TWRP_EVENT_LOGGING := true |
| 44 | ifeq ($(TWRP_EVENT_LOGGING), true) |
Ethan Yonker | 30fa335 | 2015-03-09 13:57:21 -0500 | [diff] [blame] | 45 | LOCAL_CFLAGS += -D_EVENT_LOGGING |
| 46 | endif |
| 47 | ifneq ($(TW_USE_KEY_CODE_TOUCH_SYNC),) |
| 48 | LOCAL_CFLAGS += -DTW_USE_KEY_CODE_TOUCH_SYNC=$(TW_USE_KEY_CODE_TOUCH_SYNC) |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 49 | endif |
| 50 | |
bigbiff bigbiff | 8794036 | 2013-03-09 09:58:50 -0500 | [diff] [blame] | 51 | ifneq ($(TW_NO_SCREEN_BLANK),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 52 | LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK |
bigbiff bigbiff | 8794036 | 2013-03-09 09:58:50 -0500 | [diff] [blame] | 53 | endif |
Ricardo Gomez | c9ecd44 | 2013-07-05 16:13:52 -0700 | [diff] [blame] | 54 | ifneq ($(TW_NO_SCREEN_TIMEOUT),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 55 | LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT |
Ricardo Gomez | c9ecd44 | 2013-07-05 16:13:52 -0700 | [diff] [blame] | 56 | endif |
Dees Troy | b7ae098 | 2013-09-10 20:47:35 +0000 | [diff] [blame] | 57 | ifeq ($(HAVE_SELINUX), true) |
Ethan Yonker | 30fa335 | 2015-03-09 13:57:21 -0500 | [diff] [blame] | 58 | LOCAL_CFLAGS += -DHAVE_SELINUX |
Dees Troy | b7ae098 | 2013-09-10 20:47:35 +0000 | [diff] [blame] | 59 | endif |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 60 | ifeq ($(TW_OEM_BUILD), true) |
Ethan Yonker | 83e8257 | 2014-04-04 10:59:28 -0500 | [diff] [blame] | 61 | LOCAL_CFLAGS += -DTW_OEM_BUILD |
| 62 | endif |
Ethan Yonker | 751a85e | 2014-12-12 16:59:10 -0600 | [diff] [blame] | 63 | ifneq ($(TW_X_OFFSET),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 64 | LOCAL_CFLAGS += -DTW_X_OFFSET=$(TW_X_OFFSET) |
Ethan Yonker | 751a85e | 2014-12-12 16:59:10 -0600 | [diff] [blame] | 65 | endif |
| 66 | ifneq ($(TW_Y_OFFSET),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 67 | LOCAL_CFLAGS += -DTW_Y_OFFSET=$(TW_Y_OFFSET) |
Ethan Yonker | 751a85e | 2014-12-12 16:59:10 -0600 | [diff] [blame] | 68 | endif |
Ethan Yonker | 63e414f | 2015-02-06 15:44:39 -0600 | [diff] [blame] | 69 | ifeq ($(TW_ROUND_SCREEN), true) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 70 | LOCAL_CFLAGS += -DTW_ROUND_SCREEN |
bigbiff bigbiff | 163d474 | 2013-11-16 13:25:27 -0500 | [diff] [blame] | 71 | endif |
| 72 | |
Xing | 0af1ac1 | 2015-11-27 11:19:37 -0800 | [diff] [blame] | 73 | LOCAL_C_INCLUDES += bionic system/core/libpixelflinger/include |
| 74 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) |
| 75 | LOCAL_C_INCLUDES += external/stlport/stlport |
| 76 | endif |
| 77 | |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 78 | LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\" |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 79 | |
| 80 | include $(BUILD_STATIC_LIBRARY) |
| 81 | |
| 82 | # Transfer in the resources for the device |
| 83 | include $(CLEAR_VARS) |
| 84 | LOCAL_MODULE := twrp |
| 85 | LOCAL_MODULE_TAGS := eng |
| 86 | LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 87 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH) |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 88 | TWRP_RES := $(commands_recovery_local_path)/gui/devices/common/res/* |
| 89 | # enable this to use new themes: |
z31s1g | 28f0a92 | 2015-11-07 18:50:22 +0100 | [diff] [blame] | 90 | TWRP_NEW_THEME := true |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 91 | |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 92 | ifeq ($(TW_CUSTOM_THEME),) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 93 | ifeq ($(TW_THEME),) |
| 94 | # This converts the old DEVICE_RESOLUTION flag to the new TW_THEME flag |
| 95 | PORTRAIT_MDPI := 320x480 480x800 480x854 540x960 |
| 96 | PORTRAIT_HDPI := 720x1280 800x1280 1080x1920 1200x1920 1440x2560 1600x2560 |
| 97 | WATCH_MDPI := 240x240 280x280 320x320 |
| 98 | LANDSCAPE_MDPI := 800x480 1024x600 1024x768 |
| 99 | LANDSCAPE_HDPI := 1280x800 1920x1200 2560x1600 |
| 100 | ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT_MDPI)),) |
| 101 | TW_THEME := portrait_mdpi |
| 102 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT_HDPI)),) |
| 103 | TW_THEME := portrait_hdpi |
| 104 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(WATCH_MDPI)),) |
| 105 | TW_THEME := watch_mdpi |
| 106 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE_MDPI)),) |
| 107 | TW_THEME := landscape_mdpi |
| 108 | else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE_HDPI)),) |
| 109 | TW_THEME := landscape_hdpi |
| 110 | endif |
| 111 | endif |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 112 | ifeq ($(TWRP_NEW_THEME),true) |
| 113 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/theme/$(TW_THEME) |
| 114 | TWRP_RES := $(commands_recovery_local_path)/gui/theme/common/fonts |
Ethan Yonker | 74db157 | 2015-10-28 12:44:49 -0500 | [diff] [blame] | 115 | TWRP_RES += $(commands_recovery_local_path)/gui/theme/common/languages |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 116 | TWRP_RES += $(commands_recovery_local_path)/gui/theme/common/$(word 1,$(subst _, ,$(TW_THEME))).xml |
| 117 | # for future copying of used include xmls and fonts: |
| 118 | # UI_XML := $(TWRP_THEME_LOC)/ui.xml |
| 119 | # TWRP_INCLUDE_XMLS := $(shell xmllint --xpath '/recovery/include/xmlfile/@name' $(UI_XML)|sed -n 's/[^\"]*\"\([^\"]*\)\"[^\"]*/\1\n/gp'|sort|uniq) |
Ethan Yonker | 88037f4 | 2015-10-04 22:09:08 -0500 | [diff] [blame] | 120 | # TWRP_FONTS_TTF := $(shell xmllint --xpath '/recovery/resources/font/@filename' $(UI_XML)|sed -n 's/[^\"]*\"\([^\"]*\)\"[^\"]*/\1\n/gp'|sort|uniq)niq) |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 121 | ifeq ($(wildcard $(TWRP_THEME_LOC)/ui.xml),) |
| 122 | $(warning ****************************************************************************) |
| 123 | $(warning * TW_THEME is not valid: '$(TW_THEME)') |
| 124 | $(warning * Please choose an appropriate TW_THEME or create a new one for your device.) |
| 125 | $(warning * Available themes:) |
| 126 | $(warning * $(notdir $(wildcard $(commands_recovery_local_path)/gui/theme/*_*))) |
| 127 | $(warning ****************************************************************************) |
| 128 | $(error stopping) |
| 129 | endif |
| 130 | else |
| 131 | TWRP_RES += $(commands_recovery_local_path)/gui/devices/$(word 1,$(subst _, ,$(TW_THEME)))/res/* |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 132 | ifeq ($(TW_THEME), portrait_mdpi) |
| 133 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/480x800/res |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 134 | else ifeq ($(TW_THEME), portrait_hdpi) |
| 135 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/1080x1920/res |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 136 | else ifeq ($(TW_THEME), watch_mdpi) |
| 137 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/320x320/res |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 138 | else ifeq ($(TW_THEME), landscape_mdpi) |
| 139 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/800x480/res |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 140 | else ifeq ($(TW_THEME), landscape_hdpi) |
| 141 | TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/1920x1200/res |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 142 | else |
| 143 | $(warning ****************************************************************************) |
| 144 | $(warning * TW_THEME ($(TW_THEME)) is not valid.) |
| 145 | $(warning * Please choose an appropriate TW_THEME or create a new one for your device.) |
| 146 | $(warning * Valid options are portrait_mdpi portrait_hdpi watch_mdpi) |
| 147 | $(warning * landscape_mdpi landscape_hdpi) |
| 148 | $(warning ****************************************************************************) |
| 149 | $(error stopping) |
| 150 | endif |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 151 | endif |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 152 | else |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 153 | TWRP_THEME_LOC := $(TW_CUSTOM_THEME) |
Ethan Yonker | 1ecaca7 | 2014-04-14 09:27:15 -0500 | [diff] [blame] | 154 | endif |
Vojtech Bocek | 76ee903 | 2014-09-07 15:01:56 +0200 | [diff] [blame] | 155 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 156 | TWRP_RES_GEN := $(intermediates)/twrp |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 157 | ifneq ($(TW_USE_TOOLBOX), true) |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 158 | TWRP_SH_TARGET := /sbin/busybox |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 159 | else |
Ethan Yonker | 591b920 | 2015-03-11 11:17:15 -0500 | [diff] [blame] | 160 | TWRP_SH_TARGET := /sbin/mksh |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 161 | endif |
| 162 | |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 163 | $(TWRP_RES_GEN): |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 164 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH) |
that | d16b2ce | 2015-07-27 20:39:19 +0200 | [diff] [blame] | 165 | cp -fr $(TWRP_RES) $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH) |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 166 | cp -fr $(TWRP_THEME_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH) |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 167 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/ |
Ethan Yonker | bcc502c | 2014-11-10 11:22:10 -0600 | [diff] [blame] | 168 | ifneq ($(TW_USE_TOOLBOX), true) |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 169 | ln -sf $(TWRP_SH_TARGET) $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh |
Ethan Yonker | bcc502c | 2014-11-10 11:22:10 -0600 | [diff] [blame] | 170 | endif |
Ethan Yonker | 5c93369 | 2014-04-04 11:26:32 -0500 | [diff] [blame] | 171 | ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip |
| 172 | ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip |
Ethan Yonker | 0c9d049 | 2014-04-14 09:10:05 -0500 | [diff] [blame] | 173 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 174 | |
| 175 | LOCAL_GENERATED_SOURCES := $(TWRP_RES_GEN) |
| 176 | LOCAL_SRC_FILES := twrp $(TWRP_RES_GEN) |
Dees_Troy | 7d15c25 | 2012-09-05 20:47:21 -0400 | [diff] [blame] | 177 | include $(BUILD_PREBUILT) |