egl: fix line continuation
[mesa.git] / src / egl / Makefile.am
1 # Copyright © 2012 Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 include Makefile.sources
23
24 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
25
26 BUILT_SOURCES =
27
28 AM_CFLAGS = \
29 -I$(top_srcdir)/include \
30 -I$(top_srcdir)/src/egl/main \
31 -I$(top_srcdir)/src/gbm/main \
32 -I$(top_srcdir)/src \
33 $(DEFINES) \
34 $(VISIBILITY_CFLAGS) \
35 $(LIBDRM_CFLAGS) \
36 $(EGL_CFLAGS) \
37 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
38
39 # Depending on whether libglvnd is enabled, we'll build the EGL library as
40 # either libEGL.so.1 or libEGL_mesa.so.0. Using an automake substitution
41 # in the variable names breaks "make dist" target, so use a conenience library
42 # instead.
43 noinst_LTLIBRARIES = libEGL_common.la
44 libEGL_common_la_SOURCES = \
45 $(LIBEGL_C_FILES)
46
47 libEGL_common_la_LIBADD = \
48 $(EGL_LIB_DEPS)
49
50 dri2_backend_FILES =
51 dri3_backend_FILES =
52
53 if HAVE_PLATFORM_X11
54 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
55 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
56 dri2_backend_FILES += drivers/dri2/platform_x11.c
57
58 if HAVE_DRI3
59 dri3_backend_FILES += \
60 drivers/dri2/platform_x11_dri3.c \
61 drivers/dri2/platform_x11_dri3.h
62
63 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
64 endif
65 endif
66
67 if HAVE_PLATFORM_WAYLAND
68 WL_DMABUF_XML = $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
69
70 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c: $(WL_DMABUF_XML)
71 $(MKDIR_GEN)
72 $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
73
74 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h: $(WL_DMABUF_XML)
75 $(MKDIR_GEN)
76 $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
77
78 BUILT_SOURCES += \
79 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c \
80 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
81
82 AM_CFLAGS += $(WAYLAND_CFLAGS)
83 libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
84 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
85 libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
86 libEGL_common_la_LIBADD += $(top_builddir)/src/util/libmesautil.la
87 dri2_backend_FILES += drivers/dri2/platform_wayland.c \
88 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c
89 endif
90
91 if HAVE_PLATFORM_DRM
92 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
93 dri2_backend_FILES += drivers/dri2/platform_drm.c
94 endif
95
96 if HAVE_PLATFORM_SURFACELESS
97 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
98 endif
99
100 if HAVE_PLATFORM_ANDROID
101 AM_CFLAGS += $(ANDROID_CFLAGS)
102 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
103 dri2_backend_FILES += drivers/dri2/platform_android.c
104 endif
105
106 AM_CFLAGS += \
107 -I$(top_srcdir)/src/loader \
108 -I$(top_builddir)/src/egl/drivers/dri2 \
109 -I$(top_srcdir)/src/egl/drivers/dri2 \
110 -I$(top_srcdir)/src/gbm/backends/dri \
111 -I$(top_srcdir)/src/egl/wayland/wayland-egl \
112 -I$(top_builddir)/src/egl/wayland/wayland-drm \
113 -I$(top_srcdir)/src/egl/wayland/wayland-drm \
114 -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
115 -D_EGL_BUILT_IN_DRIVER_DRI2
116
117 libEGL_common_la_SOURCES += \
118 $(dri2_backend_core_FILES) \
119 $(dri2_backend_FILES) \
120 $(dri3_backend_FILES)
121
122 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader.la
123 libEGL_common_la_LIBADD += $(DLOPEN_LIBS) $(LIBDRM_LIBS) $(CLOCK_LIB)
124
125 GLVND_GEN_DEPS = generate/gen_egl_dispatch.py \
126 generate/egl.xml generate/eglFunctionList.py generate/genCommon.py \
127 generate/egl_other.xml
128
129 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
130 g_egldispatchstubs.c: $(GLVND_GEN_DEPS)
131 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py source \
132 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
133 $(top_srcdir)/src/egl/generate/egl.xml \
134 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
135
136 g_egldispatchstubs.h: $(GLVND_GEN_DEPS)
137 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py header \
138 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
139 $(top_srcdir)/src/egl/generate/egl.xml \
140 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
141
142 BUILT_SOURCES += g_egldispatchstubs.c g_egldispatchstubs.h
143 CLEANFILES = $(BUILT_SOURCES)
144
145 if USE_LIBGLVND
146 AM_CFLAGS += \
147 $(GLVND_CFLAGS)
148
149 vendorjsondir = @LIBGLVND_DATADIR@/glvnd/egl_vendor.d
150 vendorjson_DATA = main/50_mesa.json
151
152 lib_LTLIBRARIES = libEGL_mesa.la
153 libEGL_mesa_la_SOURCES = \
154 main/eglglvnd.c \
155 main/egldispatchstubs.h \
156 main/egldispatchstubs.c \
157 g_egldispatchstubs.c \
158 g_egldispatchstubs.h
159 libEGL_mesa_la_LIBADD = libEGL_common.la
160 libEGL_mesa_la_LDFLAGS = \
161 -no-undefined \
162 -version-number 0 \
163 $(BSYMBOLIC) \
164 $(GC_SECTIONS) \
165 $(LD_NO_UNDEFINED)
166
167 else # USE_LIBGLVND
168
169 lib_LTLIBRARIES = libEGL.la
170 libEGL_la_SOURCES =
171 libEGL_la_LIBADD = libEGL_common.la
172 libEGL_la_LDFLAGS = \
173 -no-undefined \
174 -version-number 1:0 \
175 $(BSYMBOLIC) \
176 $(GC_SECTIONS) \
177 $(LD_NO_UNDEFINED)
178
179 endif # USE_LIBGLVND
180
181 include $(top_srcdir)/install-lib-links.mk
182
183 pkgconfigdir = $(libdir)/pkgconfig
184
185 pkgconfig_DATA = main/egl.pc
186
187 egldir = $(includedir)/EGL
188 egl_HEADERS = \
189 $(top_srcdir)/include/EGL/eglext.h \
190 $(top_srcdir)/include/EGL/egl.h \
191 $(top_srcdir)/include/EGL/eglextchromium.h \
192 $(top_srcdir)/include/EGL/eglmesaext.h \
193 $(top_srcdir)/include/EGL/eglplatform.h
194
195 TESTS = egl-symbols-check \
196 egl-entrypoint-check
197
198 EXTRA_DIST = \
199 $(TESTS) \
200 SConscript \
201 drivers/haiku \
202 main/egl.def \
203 main/README.txt \
204 $(GLVND_GEN_DEPS) \
205 main/50_mesa.json