blob: 2f30343d0b0ac0883b450f07aaad91a0e08b9f63 [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
Dees Troyf171e102014-11-06 22:19:58 +01005LOCAL_SRC_FILES := events.c resources.c graphics_overlay.c graphics_utils.c
Dees_Troy86382ca2013-01-15 16:54:59 +00006
7ifneq ($(TW_BOARD_CUSTOM_GRAPHICS),)
8 LOCAL_SRC_FILES += $(TW_BOARD_CUSTOM_GRAPHICS)
9else
10 LOCAL_SRC_FILES += graphics.c
11endif
Dees_Troy51a0e822012-09-05 15:24:24 -040012
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060013ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
14 LOCAL_CFLAGS += -DMSM_BSP
15 ifeq ($(TARGET_PREBUILT_KERNEL),)
16 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
17 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
18 else
Kra1o50024e382014-12-17 01:49:00 +010019 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
20 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
21 else
22 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
23 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060024 endif
25else
Matt Mower55c75ca2014-08-31 11:30:15 -050026 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060027endif
28
Kra1o5de50c5f2015-04-23 21:46:36 +020029ifeq ($(TW_NEW_ION_HEAP), true)
30 LOCAL_CFLAGS += -DNEW_ION_HEAP
31endif
32
Dees_Troy2673cec2013-04-02 20:22:16 +000033LOCAL_C_INCLUDES += \
34 external/libpng \
35 external/zlib \
Dees_Troy930bf012013-08-10 22:19:03 +000036 system/core/include \
37 external/jpeg
Dees_Troy51a0e822012-09-05 15:24:24 -040038
Dees_Troy51a0e822012-09-05 15:24:24 -040039ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
40LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
41endif
42
43ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true)
44LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X
45endif
46
47ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true)
48LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y
49endif
50
51ifeq ($(RECOVERY_GRAPHICS_USE_LINELENGTH), true)
52LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_USE_LINELENGTH
53endif
54
Kra1o5c9556cc2015-06-24 12:19:09 +020055ifeq ($(TW_DISABLE_DOUBLE_BUFFERING), true)
56LOCAL_CFLAGS += -DTW_DISABLE_DOUBLE_BUFFERING
57endif
58
Dees_Troy51a0e822012-09-05 15:24:24 -040059#Remove the # from the line below to enable event logging
60#TWRP_EVENT_LOGGING := true
61ifeq ($(TWRP_EVENT_LOGGING), true)
62LOCAL_CFLAGS += -D_EVENT_LOGGING
63endif
64
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060065ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
66 LOCAL_CFLAGS += -DRECOVERY_RGBX
67endif
68ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
69 LOCAL_CFLAGS += -DRECOVERY_BGRA
70endif
71ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGB_565)
72 LOCAL_CFLAGS += -DRECOVERY_RGB_565
73endif
74
Dees_Troy51a0e822012-09-05 15:24:24 -040075ifeq ($(TARGET_RECOVERY_PIXEL_FORMAT),"RGBX_8888")
76 LOCAL_CFLAGS += -DRECOVERY_RGBX
77endif
78ifeq ($(TARGET_RECOVERY_PIXEL_FORMAT),"BGRA_8888")
79 LOCAL_CFLAGS += -DRECOVERY_BGRA
80endif
81ifeq ($(TARGET_RECOVERY_PIXEL_FORMAT),"RGB_565")
82 LOCAL_CFLAGS += -DRECOVERY_RGB_565
83endif
xNUTxcd56f8c2014-07-23 01:30:20 +020084ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
85 LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
86endif
Dees_Troy51a0e822012-09-05 15:24:24 -040087
88ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true)
89LOCAL_CFLAGS += -DBOARD_HAS_FLIPPED_SCREEN
90endif
91
Ibrahim Awwal2e9cb012014-01-04 12:38:26 -080092ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
93LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
94endif
95
Ethan Yonker32f68a32014-12-29 08:13:23 -060096ifeq ($(TW_IGNORE_MT_POSITION_0), true)
97LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
98endif
99
Ethan Yonkerd6821a12015-08-26 15:29:23 -0500100ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
101LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
102endif
103
Ethan Yonker5742a402014-08-12 14:52:49 -0500104ifneq ($(TW_INPUT_BLACKLIST),)
105 LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
106endif
107
Dees_Troy51a0e822012-09-05 15:24:24 -0400108ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
109 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
Ethan Yonkerb24caab2014-08-07 09:28:04 -0500110else
Ethan Yonker591b9202015-03-11 11:17:15 -0500111 ifeq ($(TW_THEME),)
112 # This converts the old DEVICE_RESOLUTION flag to the new TW_THEME flag
113 PORTRAIT_MDPI := 320x480 480x800 480x854 540x960
114 PORTRAIT_HDPI := 720x1280 800x1280 1080x1920 1200x1920 1440x2560 1600x2560
115 WATCH_MDPI := 240x240 280x280 320x320
116 LANDSCAPE_MDPI := 800x480 1024x600 1024x768
117 LANDSCAPE_HDPI := 1280x800 1920x1200 2560x1600
118 ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT_MDPI)),)
119 TW_THEME := portrait_mdpi
120 else ifneq ($(filter $(DEVICE_RESOLUTION), $(PORTRAIT_HDPI)),)
121 TW_THEME := portrait_hdpi
122 else ifneq ($(filter $(DEVICE_RESOLUTION), $(WATCH_MDPI)),)
123 TW_THEME := watch_mdpi
124 else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE_MDPI)),)
125 TW_THEME := landscape_mdpi
126 else ifneq ($(filter $(DEVICE_RESOLUTION), $(LANDSCAPE_HDPI)),)
127 TW_THEME := landscape_hdpi
128 endif
129 endif
130 ifeq ($(TW_THEME), portrait_mdpi)
131 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=\"roboto_10x18.h\"
132 else ifeq ($(TW_THEME), portrait_hdpi)
133 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=\"roboto_15x24.h\"
134 else ifeq ($(TW_THEME), watch_mdpi)
135 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=\"font_7x16.h\"
136 else ifeq ($(TW_THEME), landscape_mdpi)
137 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=\"roboto_10x18.h\"
138 else ifeq ($(TW_THEME), landscape_hdpi)
139 LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=\"roboto_15x24.h\"
140 endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400141endif
Flemmardf4674612014-01-10 09:14:44 +0100142
143ifneq ($(TW_WHITELIST_INPUT),)
144 LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
145endif
146
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200147ifeq ($(TW_DISABLE_TTF), true)
148 LOCAL_CFLAGS += -DTW_DISABLE_TTF
149else
150 LOCAL_SHARED_LIBRARIES += libft2
151 LOCAL_C_INCLUDES += external/freetype/include
152 LOCAL_SRC_FILES += truetype.c
153endif
154
Dees Troy3454ade2015-01-20 19:21:04 +0000155LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200156LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg libpng
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500157LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
Dees_Troy2673cec2013-04-02 20:22:16 +0000158LOCAL_MODULE_TAGS := eng
Dees_Troy51a0e822012-09-05 15:24:24 -0400159LOCAL_MODULE := libminuitwrp
160
Dees_Troy930bf012013-08-10 22:19:03 +0000161include $(BUILD_SHARED_LIBRARY)