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