blob: 76545f37757431624fb4756326a0c40bbe62b6d9 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001LOCAL_PATH:= $(call my-dir)
2include $(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
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -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 \
13 FrameTracker.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070014 Layer.cpp \
15 LayerDim.cpp \
16 MessageQueue.cpp \
Dan Stozab9b08832014-03-13 11:55:57 -070017 MonitoredProducer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070018 SurfaceFlinger.cpp \
19 SurfaceFlingerConsumer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070020 Transform.cpp \
21 DisplayHardware/FramebufferSurface.cpp \
22 DisplayHardware/HWComposer.cpp \
23 DisplayHardware/PowerHAL.cpp \
24 DisplayHardware/VirtualDisplaySurface.cpp \
Mathias Agopianff2ed702013-09-01 21:36:12 -070025 Effects/Daltonizer.cpp \
Mathias Agopian85cce372013-06-04 21:50:31 -070026 EventLog/EventLogTags.logtags \
Mathias Agopian875d8e12013-06-07 15:35:48 -070027 EventLog/EventLog.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070028 RenderEngine/Description.cpp \
29 RenderEngine/Mesh.cpp \
30 RenderEngine/Program.cpp \
31 RenderEngine/ProgramCache.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070032 RenderEngine/GLExtensions.cpp \
33 RenderEngine/RenderEngine.cpp \
Mathias Agopian49457ac2013-08-14 18:20:17 -070034 RenderEngine/Texture.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070035 RenderEngine/GLES10RenderEngine.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070036 RenderEngine/GLES11RenderEngine.cpp \
37 RenderEngine/GLES20RenderEngine.cpp
Mathias Agopian875d8e12013-06-07 15:35:48 -070038
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080039
Mathias Agopian076b1cc2009-04-10 14:24:30 -070040LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
41LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080042
Mathias Agopian5df99622012-06-18 17:27:56 -070043ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Mathias Agopian57bf9e72011-10-07 15:42:53 -070044 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
45endif
Mathias Agopian5df99622012-06-18 17:27:56 -070046ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070047 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070048endif
49
Mathias Agopian5df99622012-06-18 17:27:56 -070050ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070051 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
Mathias Agopian67226812010-10-11 17:54:43 -070052endif
53
Jesse Hallc354eff2013-10-25 10:44:41 -070054ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
55 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040056endif
57
Jamie Genniscdbaecb2012-10-12 14:18:10 -070058ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
59 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
60endif
61
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070062ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
63 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
64endif
65
66# See build/target/board/generic/BoardConfig.mk for a description of this setting.
67ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
68 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
69else
70 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=0
71endif
72
Jamie Gennis0a645cc2013-10-14 20:52:46 -070073# See build/target/board/generic/BoardConfig.mk for a description of this setting.
74ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
75 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
76else
77 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=0
78endif
79
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070080ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
81 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
82else
83 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
84endif
85
Dan Stoza1f3efb12014-10-15 16:34:55 -070086ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
87 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
88else
89 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
90endif
91
Michael Lentine7306c672014-07-30 13:00:37 -070092LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Jesse Hall24cd98e2014-07-13 14:37:16 -070093LOCAL_CFLAGS += -std=c++11
Mathias Agopianb6df7d02013-05-09 14:53:35 -070094
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080095LOCAL_SHARED_LIBRARIES := \
Mathias Agopianaf54ab92009-07-02 19:04:39 -070096 libcutils \
Ying Wang8a0cb4e2013-04-09 21:55:39 -070097 liblog \
Mathias Agopianc1d359d2012-08-04 20:09:03 -070098 libdl \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080099 libhardware \
100 libutils \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800101 libEGL \
Mathias Agopianaf54ab92009-07-02 19:04:39 -0700102 libGLESv1_CM \
Mathias Agopian3f844832013-08-07 21:24:32 -0700103 libGLESv2 \
Mathias Agopianaf54ab92009-07-02 19:04:39 -0700104 libbinder \
Mathias Agopian9cce3252010-02-09 17:46:37 -0800105 libui \
Ruchi Kandoief472ec2014-04-02 12:50:06 -0700106 libgui \
107 libpowermanager
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800108
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800109LOCAL_MODULE:= libsurfaceflinger
110
111include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700112
113###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700114# build surfaceflinger's executable
115include $(CLEAR_VARS)
116
Dmitriy Ivanov2b1f2da2014-10-07 13:40:41 -0700117LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
118LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" -Iart
119LOCAL_CPPFLAGS:= -std=c++11
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700120
Dmitriy Ivanov2b1f2da2014-10-07 13:40:41 -0700121# TODO: Trying to link libsigchain as a static library prevents
122# static linker from exporting necessary symbols. So as a workaround
123# we use sigchain.o
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700124LOCAL_SRC_FILES:= \
Dmitriy Ivanov2b1f2da2014-10-07 13:40:41 -0700125 main_surfaceflinger.cpp \
126 sigchain_proxy.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700127
128LOCAL_SHARED_LIBRARIES := \
129 libsurfaceflinger \
Mathias Agopian9414d672013-08-23 15:56:38 -0700130 libcutils \
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700131 liblog \
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700132 libbinder \
Dmitriy Ivanov2b1f2da2014-10-07 13:40:41 -0700133 libutils \
134 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700135
136LOCAL_MODULE:= surfaceflinger
137
Colin Cross89450d42014-02-20 15:36:21 -0800138ifdef TARGET_32_BIT_SURFACEFLINGER
139LOCAL_32_BIT_ONLY := true
140endif
141
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700142include $(BUILD_EXECUTABLE)
143
144###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700145# uses jni which may not be available in PDK
146ifneq ($(wildcard libnativehelper/include),)
147include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700148LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
149
Keun young Park63f165f2012-08-31 10:53:36 -0700150LOCAL_SRC_FILES:= \
151 DdmConnection.cpp
152
153LOCAL_SHARED_LIBRARIES := \
154 libcutils \
Ying Wang8a0cb4e2013-04-09 21:55:39 -0700155 liblog \
Keun young Park63f165f2012-08-31 10:53:36 -0700156 libdl
157
158LOCAL_MODULE:= libsurfaceflinger_ddmconnection
159
160include $(BUILD_SHARED_LIBRARY)
161endif # libnativehelper