blob: d7a605e96e712aae3f331c7ca9b9034e0780ff28 [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 \
28 mousecursor.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040029
30ifneq ($(TWRP_CUSTOM_KEYBOARD),)
31 LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD)
32else
33 LOCAL_SRC_FILES += hardwarekeyboard.cpp
34endif
35
Ethan Yonker4b94cfd2014-12-11 10:00:45 -060036LOCAL_SHARED_LIBRARIES += libminuitwrp libc libstdc++ libminzip libaosprecovery
Dees_Troy2673cec2013-04-02 20:22:16 +000037LOCAL_MODULE := libguitwrp
Dees_Troy51a0e822012-09-05 15:24:24 -040038
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
41ifeq ($(TWRP_SIMULATE_ACTIONS), true)
42LOCAL_CFLAGS += -D_SIMULATE_ACTIONS
43endif
44
45#TWRP_EVENT_LOGGING := true
46ifeq ($(TWRP_EVENT_LOGGING), true)
47LOCAL_CFLAGS += -D_EVENT_LOGGING
48endif
49
bigbiff bigbiff87940362013-03-09 09:58:50 -050050ifneq ($(TW_NO_SCREEN_BLANK),)
51 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
52endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -070053ifneq ($(TW_NO_SCREEN_TIMEOUT),)
54 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
55endif
Dees Troyb7ae0982013-09-10 20:47:35 +000056ifeq ($(HAVE_SELINUX), true)
57LOCAL_CFLAGS += -DHAVE_SELINUX
58endif
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040059ifeq ($(TW_OEM_BUILD), true)
Ethan Yonker83e82572014-04-04 10:59:28 -050060 LOCAL_CFLAGS += -DTW_OEM_BUILD
61endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +020062ifeq ($(TW_DISABLE_TTF), true)
63 LOCAL_CFLAGS += -DTW_DISABLE_TTF
64endif
Dees_Troy51a0e822012-09-05 15:24:24 -040065
bigbiff bigbiff163d4742013-11-16 13:25:27 -050066ifeq ($(DEVICE_RESOLUTION),)
bigbiff bigbiff705f16e2013-11-16 09:59:44 -050067$(warning ********************************************************************************)
68$(warning * DEVICE_RESOLUTION is NOT SET in BoardConfig.mk )
69$(warning * Please see http://tinyw.in/nP7d for details )
70$(warning ********************************************************************************)
71$(error stopping)
72endif
73
HandyMenny466dc972014-10-19 20:08:03 +020074ifeq ($(TW_CUSTOM_THEME),)
75 ifeq "$(wildcard $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION))" ""
76 $(warning ********************************************************************************)
77 $(warning * DEVICE_RESOLUTION ($(DEVICE_RESOLUTION)) does NOT EXIST in $(commands_recovery_local_path)/gui/devices )
78 $(warning * Please choose an existing theme or create a new one for your device )
79 $(warning ********************************************************************************)
80 $(error stopping)
81 endif
bigbiff bigbiff163d4742013-11-16 13:25:27 -050082endif
83
Dees_Troy51a0e822012-09-05 15:24:24 -040084LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)
85
86include $(BUILD_STATIC_LIBRARY)
87
88# Transfer in the resources for the device
89include $(CLEAR_VARS)
90LOCAL_MODULE := twrp
91LOCAL_MODULE_TAGS := eng
92LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
93LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res
Ethan Yonker1ecaca72014-04-14 09:27:15 -050094TWRP_RES_LOC := $(commands_recovery_local_path)/gui/devices/common/res
Ethan Yonker780cd392014-07-21 15:24:39 -050095TWRP_COMMON_XML := $(hide) echo "No common TWRP XML resources"
Dees_Troy51a0e822012-09-05 15:24:24 -040096
Ethan Yonker1ecaca72014-04-14 09:27:15 -050097ifeq ($(TW_CUSTOM_THEME),)
big biffba535e32014-07-29 00:44:47 +000098 PORTRAIT := 320x480 480x800 480x854 540x960 720x1280 800x1280 1080x1920 1200x1920 1440x2560 1600x2560
99 LANDSCAPE := 800x480 1024x600 1024x768 1280x800 1920x1200 2560x1600
Ethan Yonkerd9b72002014-07-30 08:46:28 -0500100 WATCH := 240x240 280x280 320x320
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500101 TWRP_THEME_LOC := $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)/res
big biffba535e32014-07-29 00:44:47 +0000102 ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT)),)
Ethan Yonker780cd392014-07-21 15:24:39 -0500103 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/portrait/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
big biffba535e32014-07-29 00:44:47 +0000104 else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE)),)
Ethan Yonker780cd392014-07-21 15:24:39 -0500105 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/landscape/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
Ethan Yonkerd9b72002014-07-30 08:46:28 -0500106 else ifneq ($(filter $(DEVICE_RESOLUTION), $(WATCH)),)
107 TWRP_COMMON_XML := cp -fr $(commands_recovery_local_path)/gui/devices/watch/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
Ethan Yonker780cd392014-07-21 15:24:39 -0500108 endif
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500109else
110 TWRP_THEME_LOC := $(TW_CUSTOM_THEME)
111endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200112
113ifeq ($(TW_DISABLE_TTF), true)
114 TWRP_REMOVE_FONT := rm -f $(TARGET_RECOVERY_ROOT_OUT)/res/fonts/*.ttf
115else
116 TWRP_REMOVE_FONT := rm -f $(TARGET_RECOVERY_ROOT_OUT)/res/fonts/*.dat
117endif
118
Dees_Troy51a0e822012-09-05 15:24:24 -0400119TWRP_RES_GEN := $(intermediates)/twrp
Ethan Yonker5c933692014-04-04 11:26:32 -0500120ifneq ($(TW_USE_TOOLBOX), true)
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500121 TWRP_SH_TARGET := /sbin/busybox
Ethan Yonker5c933692014-04-04 11:26:32 -0500122else
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500123 TWRP_SH_TARGET := /sbin/mksh
124endif
125
Ethan Yonker5c933692014-04-04 11:26:32 -0500126$(TWRP_RES_GEN):
127 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res/
Ethan Yonker1ecaca72014-04-14 09:27:15 -0500128 cp -fr $(TWRP_RES_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)/res/
129 cp -fr $(TWRP_THEME_LOC)/* $(TARGET_RECOVERY_ROOT_OUT)/res/
Ethan Yonker780cd392014-07-21 15:24:39 -0500130 $(TWRP_COMMON_XML)
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200131 $(TWRP_REMOVE_FONT)
Ethan Yonker5c933692014-04-04 11:26:32 -0500132 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600133ifneq ($(TW_USE_TOOLBOX), true)
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500134 ln -sf $(TWRP_SH_TARGET) $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600135endif
Ethan Yonker5c933692014-04-04 11:26:32 -0500136 ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip
137 ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip
Ethan Yonker0c9d0492014-04-14 09:10:05 -0500138
Dees_Troy51a0e822012-09-05 15:24:24 -0400139
140LOCAL_GENERATED_SOURCES := $(TWRP_RES_GEN)
141LOCAL_SRC_FILES := twrp $(TWRP_RES_GEN)
Dees_Troy7d15c252012-09-05 20:47:21 -0400142include $(BUILD_PREBUILT)