Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 2 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 3 | include $(CLEAR_VARS) |
| 4 | |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 5 | LOCAL_SRC_FILES := \ |
| 6 | graphics.cpp \ |
| 7 | graphics_fbdev.cpp \ |
| 8 | resources.cpp \ |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 9 | truetype.cpp \ |
| 10 | graphics_utils.cpp \ |
| 11 | events.cpp |
Dees_Troy | 86382ca | 2013-01-15 16:54:59 +0000 | [diff] [blame] | 12 | |
Mohd Faraz | bc576cd | 2020-05-30 21:06:32 +0530 | [diff] [blame] | 13 | ifeq ($(TW_SUPPORT_INPUT_1_2_HAPTICS),true) |
| 14 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) |
| 15 | LOCAL_SHARED_LIBRARIES += android.hardware.vibrator@1.2 libhidlbase |
| 16 | LOCAL_CFLAGS += -DUSE_QTI_HAPTICS |
| 17 | endif |
| 18 | endif |
| 19 | |
Dees_Troy | 86382ca | 2013-01-15 16:54:59 +0000 | [diff] [blame] | 20 | ifneq ($(TW_BOARD_CUSTOM_GRAPHICS),) |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 21 | $(warning ****************************************************************************) |
| 22 | $(warning * TW_BOARD_CUSTOM_GRAPHICS support has been deprecated in TWRP. *) |
| 23 | $(warning ****************************************************************************) |
| 24 | $(error stopping) |
Dees_Troy | 86382ca | 2013-01-15 16:54:59 +0000 | [diff] [blame] | 25 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 26 | |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 27 | ifeq ($(TW_TARGET_USES_QCOM_BSP), true) |
| 28 | LOCAL_CFLAGS += -DMSM_BSP |
Ethan Yonker | b386f71 | 2017-01-20 14:30:28 -0600 | [diff] [blame] | 29 | LOCAL_SRC_FILES += graphics_overlay.cpp |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 30 | ifeq ($(TARGET_PREBUILT_KERNEL),) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 31 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) |
| 32 | LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr |
| 33 | else |
| 34 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr |
| 35 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 36 | LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include |
| 37 | else |
Kra1o5 | 0024e38 | 2014-12-17 01:49:00 +0100 | [diff] [blame] | 38 | ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),) |
Greg Wallace | 62c188c | 2016-01-27 18:12:05 -0500 | [diff] [blame] | 39 | LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include |
Kra1o5 | 0024e38 | 2014-12-17 01:49:00 +0100 | [diff] [blame] | 40 | else |
| 41 | LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS) |
| 42 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 43 | endif |
| 44 | else |
Greg Wallace | 62c188c | 2016-01-27 18:12:05 -0500 | [diff] [blame] | 45 | LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 46 | # The header files required for adf graphics can cause compile errors |
| 47 | # with adf graphics. |
Ethan Yonker | 2f68527 | 2018-10-19 08:06:03 -0500 | [diff] [blame] | 48 | ifneq ($(wildcard system/core/adf/Android.*),) |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 49 | LOCAL_CFLAGS += -DHAS_ADF |
| 50 | LOCAL_SRC_FILES += graphics_adf.cpp |
| 51 | LOCAL_WHOLE_STATIC_LIBRARIES += libadf |
| 52 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 53 | endif |
| 54 | |
Kra1o5 | de50c5f | 2015-04-23 21:46:36 +0200 | [diff] [blame] | 55 | ifeq ($(TW_NEW_ION_HEAP), true) |
| 56 | LOCAL_CFLAGS += -DNEW_ION_HEAP |
| 57 | endif |
| 58 | |
lambdadroid | d842fe1 | 2018-09-26 22:30:16 +0200 | [diff] [blame] | 59 | ifneq ($(wildcard external/libdrm/Android.*),) |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 60 | LOCAL_CFLAGS += -DHAS_DRM |
| 61 | LOCAL_SRC_FILES += graphics_drm.cpp |
Ethan Yonker | 3eb70ed | 2018-01-04 08:59:36 -0600 | [diff] [blame] | 62 | ifneq ($(wildcard external/libdrm/Android.common.mk),) |
| 63 | LOCAL_WHOLE_STATIC_LIBRARIES += libdrm_platform |
| 64 | else |
| 65 | LOCAL_WHOLE_STATIC_LIBRARIES += libdrm |
| 66 | endif |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 67 | endif |
| 68 | |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 69 | LOCAL_C_INCLUDES += \ |
| 70 | external/libpng \ |
| 71 | external/zlib \ |
Dees_Troy | 930bf01 | 2013-08-10 22:19:03 +0000 | [diff] [blame] | 72 | system/core/include \ |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 73 | external/freetype/include \ |
| 74 | external/libcxx/include |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 75 | |
Greg Wallace | ace7623 | 2016-01-27 17:15:51 -0500 | [diff] [blame] | 76 | ifneq ($(TW_INCLUDE_JPEG),) |
| 77 | LOCAL_C_INCLUDES += \ |
| 78 | external/jpeg |
| 79 | LOCAL_CFLAGS += -DTW_INCLUDE_JPEG |
| 80 | endif |
Ethan Yonker | e95c486 | 2016-01-27 10:57:26 -0600 | [diff] [blame] | 81 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 82 | ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true) |
| 83 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY |
| 84 | endif |
| 85 | |
| 86 | ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true) |
| 87 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X |
| 88 | endif |
| 89 | |
| 90 | ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true) |
| 91 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y |
| 92 | endif |
| 93 | |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 94 | ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true) |
| 95 | LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 96 | endif |
| 97 | |
Ethan Yonker | 4a71d4f | 2016-07-29 17:42:36 -0500 | [diff] [blame] | 98 | ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true) |
| 99 | LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER |
Kra1o5 | c9556cc | 2015-06-24 12:19:09 +0200 | [diff] [blame] | 100 | endif |
| 101 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 102 | #Remove the # from the line below to enable event logging |
| 103 | #TWRP_EVENT_LOGGING := true |
| 104 | ifeq ($(TWRP_EVENT_LOGGING), true) |
| 105 | LOCAL_CFLAGS += -D_EVENT_LOGGING |
| 106 | endif |
| 107 | |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 108 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888) |
| 109 | $(warning ****************************************************************************) |
| 110 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *) |
| 111 | $(warning ****************************************************************************) |
| 112 | $(error stopping) |
Kra1o5 | 7756859 | 2015-10-14 18:09:54 +0200 | [diff] [blame] | 113 | LOCAL_CFLAGS += -DRECOVERY_RGBA |
| 114 | endif |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 115 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888) |
| 116 | $(warning ****************************************************************************) |
| 117 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *) |
| 118 | $(warning ****************************************************************************) |
| 119 | $(error stopping) |
| 120 | LOCAL_CFLAGS += -DRECOVERY_RGBX |
| 121 | endif |
| 122 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888) |
| 123 | $(warning ****************************************************************************) |
| 124 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *) |
| 125 | $(warning ****************************************************************************) |
| 126 | $(error stopping) |
| 127 | LOCAL_CFLAGS += -DRECOVERY_BGRA |
| 128 | endif |
| 129 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565) |
| 130 | LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565 |
| 131 | endif |
| 132 | |
| 133 | # This used to compare against values in double-quotes (which are just |
| 134 | # ordinary characters in this context). Strip double-quotes from the |
| 135 | # value so that either will work. |
| 136 | |
| 137 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888) |
| 138 | LOCAL_CFLAGS += -DRECOVERY_ABGR |
| 139 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 140 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888) |
| 141 | LOCAL_CFLAGS += -DRECOVERY_RGBX |
| 142 | endif |
| 143 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888) |
| 144 | LOCAL_CFLAGS += -DRECOVERY_BGRA |
| 145 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 146 | |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 147 | ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),) |
| 148 | LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT) |
| 149 | else |
| 150 | LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0 |
| 151 | endif |
xNUTx | cd56f8c | 2014-07-23 01:30:20 +0200 | [diff] [blame] | 152 | ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true) |
| 153 | LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT |
| 154 | endif |
Muhammad Fahad Baig | 0ac2293 | 2016-04-07 09:19:33 +0100 | [diff] [blame] | 155 | ifeq ($(TW_FBIOPAN), true) |
| 156 | LOCAL_CFLAGS += -DTW_FBIOPAN |
| 157 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 158 | |
Vladimir Oltean | d32b7eb | 2018-07-03 00:04:03 +0300 | [diff] [blame] | 159 | ifneq ($(TW_ROTATION),) |
| 160 | ifeq (,$(filter 0 90 180 270, $(TW_ROTATION))) |
| 161 | $(error TW_ROTATION must be set to 0, 90, 180 or 270. Currently set to $(TW_ROTATION)) |
| 162 | endif |
| 163 | LOCAL_CFLAGS += -DTW_ROTATION=$(TW_ROTATION) |
| 164 | else |
| 165 | # Support for old flag |
| 166 | ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true) |
| 167 | LOCAL_CFLAGS += -DTW_ROTATION=180 |
| 168 | else |
| 169 | LOCAL_CFLAGS += -DTW_ROTATION=0 |
| 170 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 171 | endif |
| 172 | |
Ibrahim Awwal | 2e9cb01 | 2014-01-04 12:38:26 -0800 | [diff] [blame] | 173 | ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true) |
| 174 | LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0 |
| 175 | endif |
| 176 | |
Ethan Yonker | 32f68a3 | 2014-12-29 08:13:23 -0600 | [diff] [blame] | 177 | ifeq ($(TW_IGNORE_MT_POSITION_0), true) |
| 178 | LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0 |
| 179 | endif |
| 180 | |
Ethan Yonker | d6821a1 | 2015-08-26 15:29:23 -0500 | [diff] [blame] | 181 | ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true) |
| 182 | LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID |
| 183 | endif |
| 184 | |
Ethan Yonker | 5742a40 | 2014-08-12 14:52:49 -0500 | [diff] [blame] | 185 | ifneq ($(TW_INPUT_BLACKLIST),) |
| 186 | LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST) |
| 187 | endif |
| 188 | |
Flemmard | f467461 | 2014-01-10 09:14:44 +0100 | [diff] [blame] | 189 | ifneq ($(TW_WHITELIST_INPUT),) |
| 190 | LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT) |
| 191 | endif |
| 192 | |
LameMonster82 | 4ef96a6 | 2020-06-04 13:31:12 +0200 | [diff] [blame] | 193 | ifeq ($(TW_HAPTICS_TSPDRV), true) |
| 194 | LOCAL_SRC_FILES += tspdrv.cpp |
| 195 | LOCAL_CFLAGS += -DTW_HAPTICS_TSPDRV |
| 196 | endif |
| 197 | |
Vojtech Bocek | 76ee903 | 2014-09-07 15:01:56 +0200 | [diff] [blame] | 198 | ifeq ($(TW_DISABLE_TTF), true) |
Ethan Yonker | 88037f4 | 2015-10-04 22:09:08 -0500 | [diff] [blame] | 199 | $(warning ****************************************************************************) |
| 200 | $(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *) |
| 201 | $(warning ****************************************************************************) |
| 202 | $(error stopping) |
Vojtech Bocek | 76ee903 | 2014-09-07 15:01:56 +0200 | [diff] [blame] | 203 | endif |
| 204 | |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 205 | LOCAL_CLANG := true |
| 206 | |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 207 | LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\" |
Dees Troy | 9a4d740 | 2019-03-21 14:17:28 -0400 | [diff] [blame] | 208 | LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++ |
Greg Wallace | ace7623 | 2016-01-27 17:15:51 -0500 | [diff] [blame] | 209 | ifneq ($(TW_INCLUDE_JPEG),) |
| 210 | LOCAL_SHARED_LIBRARIES += libjpeg |
| 211 | endif |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 212 | LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 213 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) |
| 214 | LOCAL_SHARED_LIBRARIES += libcutils liblog libutils |
| 215 | endif |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 216 | LOCAL_MODULE_TAGS := optional |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 217 | LOCAL_MODULE := libminuitwrp |
| 218 | |
Dees_Troy | 930bf01 | 2013-08-10 22:19:03 +0000 | [diff] [blame] | 219 | include $(BUILD_SHARED_LIBRARY) |