blob: 0b5afe1d8f0224812e651450cc3e5c580f4392e4 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
Motorhead1991c7f2e122014-06-12 15:57:36 -07004LOCAL_CFLAGS := -fno-strict-aliasing
5
Dees_Troy51a0e822012-09-05 15:24:24 -04006LOCAL_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 Bocekede51c52014-02-07 23:58:09 +010020 object.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040021 slider.cpp \
Vojtech Bocek85932342013-04-01 22:11:33 +020022 slidervalue.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040023 listbox.cpp \
24 keyboard.cpp \
bigbiff bigbiff8a68c312013-02-10 14:28:30 -050025 input.cpp \
26 blanktimer.cpp \
Vojtech Bocek1fc30fc2014-01-29 18:37:19 +010027 partitionlist.cpp \
Ethan Yonker0a3a98f2015-02-05 00:48:28 +010028 mousecursor.cpp \
29 scrolllist.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040030
31ifneq ($(TWRP_CUSTOM_KEYBOARD),)
32 LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD)
33else
34 LOCAL_SRC_FILES += hardwarekeyboard.cpp
35endif
36
Ethan Yonker4b94cfd2014-12-11 10:00:45 -060037LOCAL_SHARED_LIBRARIES += libminuitwrp libc libstdc++ libminzip libaosprecovery
Dees_Troy2673cec2013-04-02 20:22:16 +000038LOCAL_MODULE := libguitwrp
Dees_Troy51a0e822012-09-05 15:24:24 -040039
Dees_Troy51a0e822012-09-05 15:24:24 -040040#TWRP_EVENT_LOGGING := true
41ifeq ($(TWRP_EVENT_LOGGING), true)
42LOCAL_CFLAGS += -D_EVENT_LOGGING
43endif
44
bigbiff bigbiff87940362013-03-09 09:58:50 -050045ifneq ($(TW_NO_SCREEN_BLANK),)
46 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
47endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -070048ifneq ($(TW_NO_SCREEN_TIMEOUT),)
49 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
50endif
Dees Troyb7ae0982013-09-10 20:47:35 +000051ifeq ($(HAVE_SELINUX), true)
52LOCAL_CFLAGS += -DHAVE_SELINUX
53endif
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040054ifeq ($(TW_OEM_BUILD), true)
Ethan Yonker83e82572014-04-04 10:59:28 -050055 LOCAL_CFLAGS += -DTW_OEM_BUILD
56endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +020057ifeq ($(TW_DISABLE_TTF), true)
58 LOCAL_CFLAGS += -DTW_DISABLE_TTF
59endif
Ethan Yonker751a85e2014-12-12 16:59:10 -060060ifneq ($(TW_X_OFFSET),)
61 LOCAL_CFLAGS += -DTW_X_OFFSET=$(TW_X_OFFSET)
62endif
63ifneq ($(TW_Y_OFFSET),)
64 LOCAL_CFLAGS += -DTW_Y_OFFSET=$(TW_Y_OFFSET)
65endif
Ethan Yonker63e414f2015-02-06 15:44:39 -060066ifeq ($(TW_ROUND_SCREEN), true)
67 LOCAL_CFLAGS += -DTW_ROUND_SCREEN
68endif
Dees_Troy51a0e822012-09-05 15:24:24 -040069
bigbiff bigbiff163d4742013-11-16 13:25:27 -050070ifeq ($(DEVICE_RESOLUTION),)
thatc1f5c0f2014-12-25 19:57:36 +010071 $(warning ********************************************************************************)
72 $(warning * DEVICE_RESOLUTION is NOT SET in BoardConfig.mk )
73 $(warning * Please see http://tinyw.in/50tg for details. )
74 $(warning ********************************************************************************)
75 $(error stopping)
bigbiff bigbiff705f16e2013-11-16 09:59:44 -050076endif
77
HandyMenny466dc972014-10-19 20:08:03 +020078ifeq ($(TW_CUSTOM_THEME),)
thatc1f5c0f2014-12-25 19:57:36 +010079 ifeq "$(wildcard $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION))" ""
80 $(warning ********************************************************************************)
81 $(warning * DEVICE_RESOLUTION ($(DEVICE_RESOLUTION)) does NOT EXIST in $(commands_recovery_local_path)/gui/devices )
82 $(warning * Please choose an existing theme or create a new one for your device. )
83 $(warning ********************************************************************************)
84 $(error stopping)
85 endif
bigbiff bigbiff163d4742013-11-16 13:25:27 -050086endif
87
Dees_Troy51a0e822012-09-05 15:24:24 -040088LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)
Dees Troy3454ade2015-01-20 19:21:04 +000089LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
Dees_Troy51a0e822012-09-05 15:24:24 -040090
91include $(BUILD_STATIC_LIBRARY)
92
93# Transfer in the resources for the device
94include $(CLEAR_VARS)
95LOCAL_MODULE := twrp
96LOCAL_MODULE_TAGS := eng
97LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
Dees Troy3454ade2015-01-20 19:21:04 +000098LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
Ethan Yonker1ecaca72014-04-14 09:27:15 -050099TWRP_RES_LOC := $(commands_recovery_local_path)/gui/devices/common/res
Ethan Yonker780cd392014-07-21 15:24:39 -0500100TWRP_COMMON_XML := $(hide) echo "No common TWRP XML resources"
Dees_Troy51a0e822012-09-05 15:24:24 -0400101
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500102ifeq ($(TW_CUSTOM_THEME),)
big biffba535e32014-07-29 00:44:47 +0000103 PORTRAIT := 320x480 480x800 480x854 540x960 720x1280 800x1280 1080x1920 1200x1920 1440x2560 1600x2560
104 LANDSCAPE := 800x480 1024x600 1024x768 1280x800 1920x1200 2560x1600
Ethan Yonkerd9b72002014-07-30 08:46:28 -0500105 WATCH := 240x240 280x280 320x320
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500106 TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)/res
big biffba535e32014-07-29 00:44:47 +0000107 ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT)),)
Dees Troy3454ade2015-01-20 19:21:04 +0000108 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/portrait/res/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
big biffba535e32014-07-29 00:44:47 +0000109 else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE)),)
Dees Troy3454ade2015-01-20 19:21:04 +0000110 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/landscape/res/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
Ethan Yonkerd9b72002014-07-30 08:46:28 -0500111 else ifneq ($(filter $(DEVICE_RESOLUTION), $(WATCH)),)
Dees Troy3454ade2015-01-20 19:21:04 +0000112 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/watch/res/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
Ethan Yonker780cd392014-07-21 15:24:39 -0500113 endif
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500114else
115 TWRP_THEME_LOC := $(TW_CUSTOM_THEME)
116endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200117
118ifeq ($(TW_DISABLE_TTF), true)
Dees Troy3454ade2015-01-20 19:21:04 +0000119 TWRP_REMOVE_FONT := rm -f $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)fonts/*.ttf
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200120else
Dees Troy3454ade2015-01-20 19:21:04 +0000121 TWRP_REMOVE_FONT := rm -f $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)fonts/*.dat
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200122endif
123
Dees_Troy51a0e822012-09-05 15:24:24 -0400124TWRP_RES_GEN := $(intermediates)/twrp
Ethan Yonker5c933692014-04-04 11:26:32 -0500125ifneq ($(TW_USE_TOOLBOX), true)
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500126 TWRP_SH_TARGET := /sbin/busybox
Ethan Yonker5c933692014-04-04 11:26:32 -0500127else
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500128 TWRP_SH_TARGET := /sbin/mksh
129endif
130
Ethan Yonker5c933692014-04-04 11:26:32 -0500131$(TWRP_RES_GEN):
Dees Troy3454ade2015-01-20 19:21:04 +0000132 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
133 cp -fr $(TWRP_RES_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
134 cp -fr $(TWRP_THEME_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)
Ethan Yonker780cd392014-07-21 15:24:39 -0500135 $(TWRP_COMMON_XML)
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200136 $(TWRP_REMOVE_FONT)
Ethan Yonker5c933692014-04-04 11:26:32 -0500137 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600138ifneq ($(TW_USE_TOOLBOX), true)
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500139 ln -sf $(TWRP_SH_TARGET) $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600140endif
Ethan Yonker5c933692014-04-04 11:26:32 -0500141 ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip
142 ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500143
Dees_Troy51a0e822012-09-05 15:24:24 -0400144
145LOCAL_GENERATED_SOURCES := $(TWRP_RES_GEN)
146LOCAL_SRC_FILES := twrp $(TWRP_RES_GEN)
Dees_Troy7d15c252012-09-05 20:47:21 -0400147include $(BUILD_PREBUILT)