blob: 811685c0e91a48dff0ee47c7f583bacda3a7fa8c [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
Dees_Troy2673cec2013-04-02 20:22:16 +00002
Dees_Troy51a0e822012-09-05 15:24:24 -04003include $(CLEAR_VARS)
4
Ethan Yonkerfbb43532015-12-28 21:54:50 +01005LOCAL_SRC_FILES := \
6 graphics.cpp \
7 graphics_fbdev.cpp \
8 resources.cpp \
9 graphics_overlay.cpp \
10 truetype.cpp \
11 graphics_utils.cpp \
12 events.cpp
Dees_Troy86382ca2013-01-15 16:54:59 +000013
14ifneq ($(TW_BOARD_CUSTOM_GRAPHICS),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010015 $(warning ****************************************************************************)
16 $(warning * TW_BOARD_CUSTOM_GRAPHICS support has been deprecated in TWRP. *)
17 $(warning ****************************************************************************)
18 $(error stopping)
Dees_Troy86382ca2013-01-15 16:54:59 +000019endif
Dees_Troy51a0e822012-09-05 15:24:24 -040020
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060021ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
22 LOCAL_CFLAGS += -DMSM_BSP
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
Kra1o50024e382014-12-17 01:49:00 +010027 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
Greg Wallace62c188c2016-01-27 18:12:05 -050028 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Kra1o50024e382014-12-17 01:49:00 +010029 else
30 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
31 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060032 endif
33else
Greg Wallace62c188c2016-01-27 18:12:05 -050034 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Ethan Yonkerfbb43532015-12-28 21:54:50 +010035 # 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 Yonker4ee5ad72014-02-18 18:41:17 -060042endif
43
Kra1o5de50c5f2015-04-23 21:46:36 +020044ifeq ($(TW_NEW_ION_HEAP), true)
45 LOCAL_CFLAGS += -DNEW_ION_HEAP
46endif
47
Ethan Yonkerfbb43532015-12-28 21:54:50 +010048ifneq ($(wildcard external/libdrm/Android.mk),)
49 LOCAL_CFLAGS += -DHAS_DRM
50 LOCAL_SRC_FILES += graphics_drm.cpp
51 LOCAL_WHOLE_STATIC_LIBRARIES += libdrm
52endif
53
Dees_Troy2673cec2013-04-02 20:22:16 +000054LOCAL_C_INCLUDES += \
55 external/libpng \
56 external/zlib \
Dees_Troy930bf012013-08-10 22:19:03 +000057 system/core/include \
Ethan Yonkerfbb43532015-12-28 21:54:50 +010058 external/freetype/include \
59 external/libcxx/include
Dees_Troy51a0e822012-09-05 15:24:24 -040060
Greg Wallaceace76232016-01-27 17:15:51 -050061ifneq ($(TW_INCLUDE_JPEG),)
62 LOCAL_C_INCLUDES += \
63 external/jpeg
64 LOCAL_CFLAGS += -DTW_INCLUDE_JPEG
65endif
Ethan Yonkere95c4862016-01-27 10:57:26 -060066
Dees_Troy51a0e822012-09-05 15:24:24 -040067ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
68LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
69endif
70
71ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true)
72LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X
73endif
74
75ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true)
76LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y
77endif
78
Ethan Yonker31f855b2016-01-28 22:31:48 -060079ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true)
80LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH
Dees_Troy51a0e822012-09-05 15:24:24 -040081endif
82
Kra1o5c9556cc2015-06-24 12:19:09 +020083ifeq ($(TW_DISABLE_DOUBLE_BUFFERING), true)
84LOCAL_CFLAGS += -DTW_DISABLE_DOUBLE_BUFFERING
85endif
86
Dees_Troy51a0e822012-09-05 15:24:24 -040087#Remove the # from the line below to enable event logging
88#TWRP_EVENT_LOGGING := true
89ifeq ($(TWRP_EVENT_LOGGING), true)
90LOCAL_CFLAGS += -D_EVENT_LOGGING
91endif
92
Ethan Yonker31f855b2016-01-28 22:31:48 -060093ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888)
94 $(warning ****************************************************************************)
95 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *)
96 $(warning ****************************************************************************)
97 $(error stopping)
Kra1o577568592015-10-14 18:09:54 +020098 LOCAL_CFLAGS += -DRECOVERY_RGBA
99endif
Ethan Yonker31f855b2016-01-28 22:31:48 -0600100ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888)
101 $(warning ****************************************************************************)
102 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *)
103 $(warning ****************************************************************************)
104 $(error stopping)
105 LOCAL_CFLAGS += -DRECOVERY_RGBX
106endif
107ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888)
108 $(warning ****************************************************************************)
109 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *)
110 $(warning ****************************************************************************)
111 $(error stopping)
112 LOCAL_CFLAGS += -DRECOVERY_BGRA
113endif
114ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565)
115 LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565
116endif
117
118# This used to compare against values in double-quotes (which are just
119# ordinary characters in this context). Strip double-quotes from the
120# value so that either will work.
121
122ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
123 LOCAL_CFLAGS += -DRECOVERY_ABGR
124endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600125ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
126 LOCAL_CFLAGS += -DRECOVERY_RGBX
127endif
128ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
129 LOCAL_CFLAGS += -DRECOVERY_BGRA
130endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600131
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100132ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
133 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
134else
135 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
136endif
xNUTxcd56f8c2014-07-23 01:30:20 +0200137ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
138 LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
139endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400140
141ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true)
142LOCAL_CFLAGS += -DBOARD_HAS_FLIPPED_SCREEN
143endif
144
Ibrahim Awwal2e9cb012014-01-04 12:38:26 -0800145ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
146LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
147endif
148
Ethan Yonker32f68a32014-12-29 08:13:23 -0600149ifeq ($(TW_IGNORE_MT_POSITION_0), true)
150LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
151endif
152
Ethan Yonkerd6821a12015-08-26 15:29:23 -0500153ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
154LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
155endif
156
Ethan Yonker5742a402014-08-12 14:52:49 -0500157ifneq ($(TW_INPUT_BLACKLIST),)
158 LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
159endif
160
Flemmardf4674612014-01-10 09:14:44 +0100161ifneq ($(TW_WHITELIST_INPUT),)
162 LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
163endif
164
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200165ifeq ($(TW_DISABLE_TTF), true)
Ethan Yonker88037f42015-10-04 22:09:08 -0500166 $(warning ****************************************************************************)
167 $(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *)
168 $(warning ****************************************************************************)
169 $(error stopping)
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200170endif
171
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100172LOCAL_CLANG := true
173
Dees Troy3454ade2015-01-20 19:21:04 +0000174LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
Ethan Yonkere95c4862016-01-27 10:57:26 -0600175LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils
Greg Wallaceace76232016-01-27 17:15:51 -0500176ifneq ($(TW_INCLUDE_JPEG),)
177 LOCAL_SHARED_LIBRARIES += libjpeg
178endif
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500179LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
Dees_Troy2673cec2013-04-02 20:22:16 +0000180LOCAL_MODULE_TAGS := eng
Dees_Troy51a0e822012-09-05 15:24:24 -0400181LOCAL_MODULE := libminuitwrp
182
Dees_Troy930bf012013-08-10 22:19:03 +0000183include $(BUILD_SHARED_LIBRARY)