blob: 6134e3b578cea01e12e168bd2b82c363c17fe7d1 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
4LOCAL_SRC_FILES := \
5 gui.cpp \
6 resources.cpp \
7 pages.cpp \
8 text.cpp \
9 image.cpp \
10 action.cpp \
11 console.cpp \
12 fill.cpp \
13 button.cpp \
14 checkbox.cpp \
15 fileselector.cpp \
16 progressbar.cpp \
17 animation.cpp \
Vojtech Bocekede51c52014-02-07 23:58:09 +010018 object.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040019 slider.cpp \
Vojtech Bocek85932342013-04-01 22:11:33 +020020 slidervalue.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040021 listbox.cpp \
22 keyboard.cpp \
bigbiff bigbiff8a68c312013-02-10 14:28:30 -050023 input.cpp \
24 blanktimer.cpp \
Vojtech Bocek1fc30fc2014-01-29 18:37:19 +010025 partitionlist.cpp \
26 mousecursor.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040027
28ifneq ($(TWRP_CUSTOM_KEYBOARD),)
29 LOCAL_SRC_FILES += $(TWRP_CUSTOM_KEYBOARD)
30else
31 LOCAL_SRC_FILES += hardwarekeyboard.cpp
32endif
33
Dees_Troy94e2a462013-08-22 12:25:14 +000034LOCAL_SHARED_LIBRARIES += libminuitwrp libc libstdc++
Dees_Troy2673cec2013-04-02 20:22:16 +000035LOCAL_MODULE := libguitwrp
Dees_Troy51a0e822012-09-05 15:24:24 -040036
37# Use this flag to create a build that simulates threaded actions like installing zips, backups, restores, and wipes for theme testing
38#TWRP_SIMULATE_ACTIONS := true
39ifeq ($(TWRP_SIMULATE_ACTIONS), true)
40LOCAL_CFLAGS += -D_SIMULATE_ACTIONS
41endif
42
43#TWRP_EVENT_LOGGING := true
44ifeq ($(TWRP_EVENT_LOGGING), true)
45LOCAL_CFLAGS += -D_EVENT_LOGGING
46endif
47
48ifneq ($(RECOVERY_SDCARD_ON_DATA),)
49 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
50endif
Dees_Troye2920fa2012-09-19 16:18:00 -040051ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
52 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
53endif
bigbiff bigbiff8a68c312013-02-10 14:28:30 -050054ifneq ($(TW_BRIGHTNESS_PATH),)
55 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
56endif
Vojtech Bocek85932342013-04-01 22:11:33 +020057ifneq ($(TW_MAX_BRIGHTNESS),)
58 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
59else
60 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
61endif
bigbiff bigbiff87940362013-03-09 09:58:50 -050062ifneq ($(TW_NO_SCREEN_BLANK),)
63 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
64endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -070065ifneq ($(TW_NO_SCREEN_TIMEOUT),)
66 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
67endif
Dees Troyb7ae0982013-09-10 20:47:35 +000068ifeq ($(HAVE_SELINUX), true)
69LOCAL_CFLAGS += -DHAVE_SELINUX
70endif
Ethan Yonker83e82572014-04-04 10:59:28 -050071ifeq ($(TW_OEM_BUILD),true)
72 LOCAL_CFLAGS += -DTW_OEM_BUILD
73endif
Dees_Troy51a0e822012-09-05 15:24:24 -040074
bigbiff bigbiff163d4742013-11-16 13:25:27 -050075ifeq ($(DEVICE_RESOLUTION),)
bigbiff bigbiff705f16e2013-11-16 09:59:44 -050076$(warning ********************************************************************************)
77$(warning * DEVICE_RESOLUTION is NOT SET in BoardConfig.mk )
78$(warning * Please see http://tinyw.in/nP7d for details )
79$(warning ********************************************************************************)
80$(error stopping)
81endif
82
bigbiff bigbiff163d4742013-11-16 13:25:27 -050083ifeq "$(wildcard bootable/recovery/gui/devices/$(DEVICE_RESOLUTION))" ""
84$(warning ********************************************************************************)
85$(warning * DEVICE_RESOLUTION ($(DEVICE_RESOLUTION)) does NOT EXIST in bootable/recovery/gui/devices )
86$(warning * Please choose an existing theme or create a new one for your device )
87$(warning ********************************************************************************)
88$(error stopping)
89endif
90
Dees_Troy51a0e822012-09-05 15:24:24 -040091LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION)
92
93include $(BUILD_STATIC_LIBRARY)
94
95# Transfer in the resources for the device
96include $(CLEAR_VARS)
97LOCAL_MODULE := twrp
98LOCAL_MODULE_TAGS := eng
99LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
100LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/res
101
102TWRP_RES_LOC := $(commands_recovery_local_path)/gui/devices
103TWRP_RES_GEN := $(intermediates)/twrp
104
Ethan Yonker5c933692014-04-04 11:26:32 -0500105ifneq ($(TW_USE_TOOLBOX), true)
Dees_Troy51a0e822012-09-05 15:24:24 -0400106$(TWRP_RES_GEN):
107 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res/
108 cp -fr $(TWRP_RES_LOC)/common/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
109 cp -fr $(TWRP_RES_LOC)/$(DEVICE_RESOLUTION)/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
110 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/
Dees_Troy3bbb95b2012-09-28 17:15:22 -0400111 ln -sf /sbin/busybox $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh
Dees_Troy22ad2cc2012-09-27 15:00:27 -0400112 ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip
113 ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip
Ethan Yonker5c933692014-04-04 11:26:32 -0500114else
115$(TWRP_RES_GEN):
116 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/res/
117 cp -fr $(TWRP_RES_LOC)/common/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
118 cp -fr $(TWRP_RES_LOC)/$(DEVICE_RESOLUTION)/res/* $(TARGET_RECOVERY_ROOT_OUT)/res/
119 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin/
120 ln -sf /sbin/mksh $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh
121 ln -sf /sbin/pigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gzip
122 ln -sf /sbin/unpigz $(TARGET_RECOVERY_ROOT_OUT)/sbin/gunzip
123endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400124
125LOCAL_GENERATED_SOURCES := $(TWRP_RES_GEN)
126LOCAL_SRC_FILES := twrp $(TWRP_RES_GEN)
Dees_Troy7d15c252012-09-05 20:47:21 -0400127include $(BUILD_PREBUILT)