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 \ |
bigbiff | 1f9e484 | 2020-10-31 11:33:15 -0400 | [diff] [blame] | 74 | external/libcxx/include \ |
| 75 | $(LOCAL_PATH)/../twrpinstall/include |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 76 | |
Greg Wallace | ace7623 | 2016-01-27 17:15:51 -0500 | [diff] [blame] | 77 | ifneq ($(TW_INCLUDE_JPEG),) |
| 78 | LOCAL_C_INCLUDES += \ |
| 79 | external/jpeg |
| 80 | LOCAL_CFLAGS += -DTW_INCLUDE_JPEG |
| 81 | endif |
Ethan Yonker | e95c486 | 2016-01-27 10:57:26 -0600 | [diff] [blame] | 82 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 83 | ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true) |
| 84 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY |
| 85 | endif |
| 86 | |
| 87 | ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true) |
| 88 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X |
| 89 | endif |
| 90 | |
| 91 | ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true) |
| 92 | LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y |
| 93 | endif |
| 94 | |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 95 | ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true) |
| 96 | LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 97 | endif |
| 98 | |
Ethan Yonker | 4a71d4f | 2016-07-29 17:42:36 -0500 | [diff] [blame] | 99 | ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true) |
| 100 | LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER |
Kra1o5 | c9556cc | 2015-06-24 12:19:09 +0200 | [diff] [blame] | 101 | endif |
| 102 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 103 | #Remove the # from the line below to enable event logging |
| 104 | #TWRP_EVENT_LOGGING := true |
| 105 | ifeq ($(TWRP_EVENT_LOGGING), true) |
| 106 | LOCAL_CFLAGS += -D_EVENT_LOGGING |
| 107 | endif |
| 108 | |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 109 | |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 110 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888) |
| 111 | $(warning ****************************************************************************) |
| 112 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *) |
| 113 | $(warning ****************************************************************************) |
| 114 | $(error stopping) |
Kra1o5 | 7756859 | 2015-10-14 18:09:54 +0200 | [diff] [blame] | 115 | LOCAL_CFLAGS += -DRECOVERY_RGBA |
| 116 | endif |
Ethan Yonker | 31f855b | 2016-01-28 22:31:48 -0600 | [diff] [blame] | 117 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888) |
| 118 | $(warning ****************************************************************************) |
| 119 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *) |
| 120 | $(warning ****************************************************************************) |
| 121 | $(error stopping) |
| 122 | LOCAL_CFLAGS += -DRECOVERY_RGBX |
| 123 | endif |
| 124 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888) |
| 125 | $(warning ****************************************************************************) |
| 126 | $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *) |
| 127 | $(warning ****************************************************************************) |
| 128 | $(error stopping) |
| 129 | LOCAL_CFLAGS += -DRECOVERY_BGRA |
| 130 | endif |
| 131 | ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565) |
| 132 | LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565 |
| 133 | endif |
| 134 | |
| 135 | # This used to compare against values in double-quotes (which are just |
| 136 | # ordinary characters in this context). Strip double-quotes from the |
| 137 | # value so that either will work. |
| 138 | |
| 139 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888) |
| 140 | LOCAL_CFLAGS += -DRECOVERY_ABGR |
| 141 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 142 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888) |
| 143 | LOCAL_CFLAGS += -DRECOVERY_RGBX |
| 144 | endif |
| 145 | ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888) |
| 146 | LOCAL_CFLAGS += -DRECOVERY_BGRA |
| 147 | endif |
Ethan Yonker | 4ee5ad7 | 2014-02-18 18:41:17 -0600 | [diff] [blame] | 148 | |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 149 | ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),) |
| 150 | LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT) |
| 151 | else |
| 152 | LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0 |
| 153 | endif |
Muhammad Fahad Baig | 0ac2293 | 2016-04-07 09:19:33 +0100 | [diff] [blame] | 154 | ifeq ($(TW_FBIOPAN), true) |
| 155 | LOCAL_CFLAGS += -DTW_FBIOPAN |
| 156 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 157 | |
Vladimir Oltean | d32b7eb | 2018-07-03 00:04:03 +0300 | [diff] [blame] | 158 | ifneq ($(TW_ROTATION),) |
| 159 | ifeq (,$(filter 0 90 180 270, $(TW_ROTATION))) |
| 160 | $(error TW_ROTATION must be set to 0, 90, 180 or 270. Currently set to $(TW_ROTATION)) |
| 161 | endif |
| 162 | LOCAL_CFLAGS += -DTW_ROTATION=$(TW_ROTATION) |
| 163 | else |
| 164 | # Support for old flag |
| 165 | ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true) |
| 166 | LOCAL_CFLAGS += -DTW_ROTATION=180 |
| 167 | else |
| 168 | LOCAL_CFLAGS += -DTW_ROTATION=0 |
| 169 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 170 | endif |
| 171 | |
Ibrahim Awwal | 2e9cb01 | 2014-01-04 12:38:26 -0800 | [diff] [blame] | 172 | ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true) |
| 173 | LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0 |
| 174 | endif |
| 175 | |
Ethan Yonker | 32f68a3 | 2014-12-29 08:13:23 -0600 | [diff] [blame] | 176 | ifeq ($(TW_IGNORE_MT_POSITION_0), true) |
| 177 | LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0 |
| 178 | endif |
| 179 | |
Ethan Yonker | d6821a1 | 2015-08-26 15:29:23 -0500 | [diff] [blame] | 180 | ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true) |
| 181 | LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID |
| 182 | endif |
| 183 | |
Ethan Yonker | 5742a40 | 2014-08-12 14:52:49 -0500 | [diff] [blame] | 184 | ifneq ($(TW_INPUT_BLACKLIST),) |
| 185 | LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST) |
| 186 | endif |
| 187 | |
Flemmard | f467461 | 2014-01-10 09:14:44 +0100 | [diff] [blame] | 188 | ifneq ($(TW_WHITELIST_INPUT),) |
| 189 | LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT) |
| 190 | endif |
| 191 | |
LameMonster82 | 4ef96a6 | 2020-06-04 13:31:12 +0200 | [diff] [blame] | 192 | ifeq ($(TW_HAPTICS_TSPDRV), true) |
| 193 | LOCAL_SRC_FILES += tspdrv.cpp |
| 194 | LOCAL_CFLAGS += -DTW_HAPTICS_TSPDRV |
| 195 | endif |
| 196 | |
Vojtech Bocek | 76ee903 | 2014-09-07 15:01:56 +0200 | [diff] [blame] | 197 | ifeq ($(TW_DISABLE_TTF), true) |
Ethan Yonker | 88037f4 | 2015-10-04 22:09:08 -0500 | [diff] [blame] | 198 | $(warning ****************************************************************************) |
| 199 | $(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *) |
| 200 | $(warning ****************************************************************************) |
| 201 | $(error stopping) |
Vojtech Bocek | 76ee903 | 2014-09-07 15:01:56 +0200 | [diff] [blame] | 202 | endif |
| 203 | |
Ethan Yonker | fbb4353 | 2015-12-28 21:54:50 +0100 | [diff] [blame] | 204 | LOCAL_CLANG := true |
| 205 | |
Dees Troy | 3454ade | 2015-01-20 19:21:04 +0000 | [diff] [blame] | 206 | LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\" |
Dees Troy | 9a4d740 | 2019-03-21 14:17:28 -0400 | [diff] [blame] | 207 | LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++ |
Greg Wallace | ace7623 | 2016-01-27 17:15:51 -0500 | [diff] [blame] | 208 | ifneq ($(TW_INCLUDE_JPEG),) |
| 209 | LOCAL_SHARED_LIBRARIES += libjpeg |
| 210 | endif |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 211 | LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 212 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) |
| 213 | LOCAL_SHARED_LIBRARIES += libcutils liblog libutils |
| 214 | endif |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 215 | LOCAL_MODULE_TAGS := optional |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 216 | LOCAL_MODULE := libminuitwrp |
| 217 | |
Dees_Troy | 930bf01 | 2013-08-10 22:19:03 +0000 | [diff] [blame] | 218 | include $(BUILD_SHARED_LIBRARY) |