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