blob: 44a333403351e46d6ddf82e0150b43bda4ccb8cb [file] [log] [blame]
Dan Stoza01049c82014-11-11 10:32:31 -08001LOCAL_PATH := $(call my-dir)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08002include $(CLEAR_VARS)
3
Jesse Hall24cd98e2014-07-13 14:37:16 -07004LOCAL_CLANG := true
5
Jesse Halle9b23b62014-07-14 15:32:59 -07006LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Stoza01049c82014-11-11 10:32:31 -08007LOCAL_SRC_FILES := \
Jesse Hall99c7dbb2013-03-14 14:29:29 -07008 Client.cpp \
9 DisplayDevice.cpp \
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070010 DispSync.cpp \
Jamie Gennisd1700752013-10-14 12:22:52 -070011 EventControlThread.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070012 EventThread.cpp \
Pablo Ceballos40845df2016-01-25 17:41:15 -080013 FenceTracker.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070014 FrameTracker.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070015 Layer.cpp \
16 LayerDim.cpp \
17 MessageQueue.cpp \
Dan Stozab9b08832014-03-13 11:55:57 -070018 MonitoredProducer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070019 SurfaceFlingerConsumer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070020 Transform.cpp \
21 DisplayHardware/FramebufferSurface.cpp \
Dan Stoza651bf312015-10-23 17:03:17 -070022 DisplayHardware/HWC2.cpp \
Dan Stozac6998d22015-09-24 17:03:36 -070023 DisplayHardware/HWC2On1Adapter.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070024 DisplayHardware/PowerHAL.cpp \
25 DisplayHardware/VirtualDisplaySurface.cpp \
Mathias Agopianff2ed702013-09-01 21:36:12 -070026 Effects/Daltonizer.cpp \
Mathias Agopian85cce372013-06-04 21:50:31 -070027 EventLog/EventLogTags.logtags \
Mathias Agopian875d8e12013-06-07 15:35:48 -070028 EventLog/EventLog.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070029 RenderEngine/Description.cpp \
30 RenderEngine/Mesh.cpp \
31 RenderEngine/Program.cpp \
32 RenderEngine/ProgramCache.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070033 RenderEngine/GLExtensions.cpp \
34 RenderEngine/RenderEngine.cpp \
Mathias Agopian49457ac2013-08-14 18:20:17 -070035 RenderEngine/Texture.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070036 RenderEngine/GLES10RenderEngine.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070037 RenderEngine/GLES11RenderEngine.cpp \
38 RenderEngine/GLES20RenderEngine.cpp
Mathias Agopian875d8e12013-06-07 15:35:48 -070039
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080040
Dan Stoza01049c82014-11-11 10:32:31 -080041LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Mathias Agopian076b1cc2009-04-10 14:24:30 -070042LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
Pablo Ceballos69a1a382016-03-30 15:28:05 -070043#LOCAL_CFLAGS += -DENABLE_FENCE_TRACKING
Dan Stoza9e56aa02015-11-02 13:00:03 -080044
45USE_HWC2 := false
46ifeq ($(USE_HWC2),true)
47 LOCAL_CFLAGS += -DUSE_HWC2
48 LOCAL_SRC_FILES += \
49 SurfaceFlinger.cpp \
50 DisplayHardware/HWComposer.cpp
51else
52 LOCAL_SRC_FILES += \
53 SurfaceFlinger_hwc1.cpp \
54 DisplayHardware/HWComposer_hwc1.cpp
55endif
56
Mathias Agopian5df99622012-06-18 17:27:56 -070057ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080058 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian57bf9e72011-10-07 15:42:53 -070059endif
Mathias Agopian5df99622012-06-18 17:27:56 -070060ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080061 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070062endif
63
Mathias Agopian5df99622012-06-18 17:27:56 -070064ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080065 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
Mathias Agopian67226812010-10-11 17:54:43 -070066endif
67
Jesse Hallc354eff2013-10-25 10:44:41 -070068ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
69 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040070endif
71
Jamie Genniscdbaecb2012-10-12 14:18:10 -070072ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080073 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
Jamie Genniscdbaecb2012-10-12 14:18:10 -070074endif
75
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070076ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
77 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
78endif
79
80# See build/target/board/generic/BoardConfig.mk for a description of this setting.
81ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
82 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
83else
84 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=0
85endif
86
Jamie Gennis0a645cc2013-10-14 20:52:46 -070087# See build/target/board/generic/BoardConfig.mk for a description of this setting.
88ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
89 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
90else
91 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=0
92endif
93
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070094ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
95 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
96else
97 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
98endif
99
Dan Stoza1f3efb12014-10-15 16:34:55 -0700100ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
101 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
102else
103 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
104endif
105
Michael Lentine7306c672014-07-30 13:00:37 -0700106LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Pablo Ceballos40845df2016-01-25 17:41:15 -0800107LOCAL_CFLAGS += -std=c++14
Mathias Agopianb6df7d02013-05-09 14:53:35 -0700108
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800109LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800110 libcutils \
111 liblog \
112 libdl \
113 libhardware \
114 libutils \
115 libEGL \
116 libGLESv1_CM \
117 libGLESv2 \
118 libbinder \
119 libui \
120 libgui \
121 libpowermanager
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800122
Dan Stoza01049c82014-11-11 10:32:31 -0800123LOCAL_MODULE := libsurfaceflinger
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800124
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800125LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
126
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800127include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700128
129###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700130# build surfaceflinger's executable
131include $(CLEAR_VARS)
132
Dan Stoza01049c82014-11-11 10:32:31 -0800133LOCAL_CLANG := true
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700134
Dan Stoza01049c82014-11-11 10:32:31 -0800135LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
136LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800137LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800138
Tom Cherry74155992015-08-14 13:01:23 -0700139LOCAL_INIT_RC := surfaceflinger.rc
140
Tim Murrayac8d2392015-11-10 14:29:45 -0800141ifneq ($(ENABLE_CPUSETS),)
142 LOCAL_CFLAGS += -DENABLE_CPUSETS
143endif
144
Dan Stoza01049c82014-11-11 10:32:31 -0800145LOCAL_SRC_FILES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800146 main_surfaceflinger.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700147
148LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800149 libsurfaceflinger \
150 libcutils \
151 liblog \
152 libbinder \
153 libutils \
154 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700155
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700156LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
157
Dan Stoza01049c82014-11-11 10:32:31 -0800158LOCAL_MODULE := surfaceflinger
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700159
Colin Cross89450d42014-02-20 15:36:21 -0800160ifdef TARGET_32_BIT_SURFACEFLINGER
161LOCAL_32_BIT_ONLY := true
162endif
163
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800164LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
165
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700166include $(BUILD_EXECUTABLE)
167
168###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700169# uses jni which may not be available in PDK
170ifneq ($(wildcard libnativehelper/include),)
171include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700172
Dan Stoza01049c82014-11-11 10:32:31 -0800173LOCAL_CLANG := true
174
175LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800176LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800177
178LOCAL_SRC_FILES := \
Keun young Park63f165f2012-08-31 10:53:36 -0700179 DdmConnection.cpp
180
181LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800182 libcutils \
183 liblog \
184 libdl
Keun young Park63f165f2012-08-31 10:53:36 -0700185
Dan Stoza01049c82014-11-11 10:32:31 -0800186LOCAL_MODULE := libsurfaceflinger_ddmconnection
Keun young Park63f165f2012-08-31 10:53:36 -0700187
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800188LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
189
Keun young Park63f165f2012-08-31 10:53:36 -0700190include $(BUILD_SHARED_LIBRARY)
191endif # libnativehelper