Makefile.am 7.22 KB
Newer Older
1
# Copyright © 2013, 2014 Intel Corporation
Matt Turner's avatar
Matt Turner committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

22
SUBDIRS =
Matt Turner's avatar
Matt Turner committed
23
TESTS =
24
25
26
27
28

BUILT_SOURCES =
CLEANFILES = $(BUILT_SOURCES)

lib_LTLIBRARIES =
29
check_PROGRAMS =
Matt Turner's avatar
Matt Turner committed
30
31
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
32

33
EXTRA_DIST = \
34
	new/genCommon.py \
35
	new/gen_gldispatch_mapi.py \
36
37
	es1api/ABI-check \
	es2api/ABI-check \
38
39
	mapi_abi.py \
	glapi/SConscript \
40
	glapi/registry/gl.xml \
41
42
43
44
45
46
	shared-glapi/SConscript \
	es1api/meson.build \
	es2api/meson.build \
	glapi/meson.build \
	shared-glapi/meson.build \
	meson.build
47

48
49
50
AM_CFLAGS = \
	$(PTHREAD_CFLAGS) \
	$(MSVC2013_COMPAT_CFLAGS)
51
52
53
54
AM_CPPFLAGS =							\
	$(DEFINES)						\
	$(SELINUX_CFLAGS)					\
	-I$(top_srcdir)/include					\
55
	-I$(top_srcdir)/src					\
56
	-I$(top_builddir)/src/mapi				\
57
58
59
	-I$(top_srcdir)/src/mapi				\
	-I$(top_builddir)/src/mapi/glapi			\
	-I$(top_srcdir)/src/mapi/glapi
60
61

include Makefile.sources
Matt Turner's avatar
Matt Turner committed
62

63
MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
64
PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
65

66
shared_glapi_gen_mapi_deps := \
Matt Turner's avatar
Matt Turner committed
67
	mapi_abi.py \
68
69
	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.xml) \
	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.py)
Matt Turner's avatar
Matt Turner committed
70

71
72
73
74
75
76
77
78
79
glapi_gen_gl_xml := \
	$(srcdir)/glapi/registry/gl.xml
glapi_gen_mapi_script = $(srcdir)/new/gen_gldispatch_mapi.py
glapi_gen_mapi_deps = \
	$(glapi_gen_mapi_script) \
	$(srcdir)/new/genCommon.py \
	$(glapi_gen_gl_xml)
glapi_gen_mapi = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS) $(glapi_gen_mapi_script)

Matt Turner's avatar
Matt Turner committed
80
if HAVE_SHARED_GLAPI
81
82
83
BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h

lib_LTLIBRARIES += shared-glapi/libglapi.la
84
shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES) shared-glapi/glapi_mapi_tmp.h
85
86
87
shared_glapi_libglapi_la_CFLAGS = \
	$(AM_CFLAGS) \
	$(VISIBILITY_CFLAGS)
88
89
90
91
92
93
94
95
96
97
98
99
shared_glapi_libglapi_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-DMAPI_MODE_GLAPI \
	-DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
shared_glapi_libglapi_la_LIBADD = \
	$(PTHREAD_LIBS) \
	$(SELINUX_LIBS)
shared_glapi_libglapi_la_LDFLAGS = \
	-no-undefined \
	$(GC_SECTIONS) \
	$(LD_NO_UNDEFINED)

100
101
102
103
104
105
TESTS += shared-glapi-test
check_PROGRAMS += shared-glapi-test

shared_glapi_test_SOURCES = shared-glapi/tests/check_table.cpp
shared_glapi_test_CPPFLAGS = \
	$(AM_CPPFLAGS) \
106
107
	-I$(top_srcdir)/src/gtest/include \
	-I$(top_srcdir)/src/mesa
108
109
110
shared_glapi_test_LDADD = \
	$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
	$(top_builddir)/src/gtest/libgtest.la
Matt Turner's avatar
Matt Turner committed
111
112
endif

113
shared-glapi/glapi_mapi_tmp.h : glapi/gen/gl_and_es_API.xml $(shared_glapi_gen_mapi_deps)
114
	$(MKDIR_GEN)
115
	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer shared-glapi \
116
		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
117

Matt Turner's avatar
Matt Turner committed
118
if HAVE_OPENGL
Matt Turner's avatar
Matt Turner committed
119
120
121
122
noinst_LTLIBRARIES = glapi/libglapi.la

if HAVE_X86_ASM
if HAVE_X86_64_ASM
Matt Turner's avatar
Matt Turner committed
123
GLAPI_ASM_SOURCES = glapi/glapi_x86-64.S
Matt Turner's avatar
Matt Turner committed
124
else
Matt Turner's avatar
Matt Turner committed
125
GLAPI_ASM_SOURCES = glapi/glapi_x86.S
Matt Turner's avatar
Matt Turner committed
126
127
128
endif
endif
if HAVE_SPARC_ASM
Matt Turner's avatar
Matt Turner committed
129
GLAPI_ASM_SOURCES = glapi/glapi_sparc.S
Matt Turner's avatar
Matt Turner committed
130
131
endif

132
glapi_libglapi_la_SOURCES =
Matt Turner's avatar
Matt Turner committed
133
134
135
136
glapi_libglapi_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-I$(top_srcdir)/src/mesa

137
138
139
if HAVE_APPLEDRI
glapi_libglapi_la_SOURCES += glapi/glapi_gentable.c
endif
140
141
142
if HAVE_WINDOWSDRI
glapi_libglapi_la_SOURCES += glapi/glapi_gentable.c
endif
143

Matt Turner's avatar
Matt Turner committed
144
if HAVE_SHARED_GLAPI
145
glapi_libglapi_la_SOURCES += $(MAPI_BRIDGE_FILES) glapi/glapi_mapi_tmp.h
Matt Turner's avatar
Matt Turner committed
146
147
148
149
150
151
152
glapi_libglapi_la_CPPFLAGS += \
	-DMAPI_MODE_BRIDGE \
	-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
else
glapi_libglapi_la_CPPFLAGS += \
	-DMAPI_MODE_UTIL
glapi_libglapi_la_SOURCES += \
Matt Turner's avatar
Matt Turner committed
153
154
155
156
157
158
159
	glapi/glapi_dispatch.c \
	glapi/glapi_entrypoint.c \
	glapi/glapi_getproc.c \
	glapi/glapi_nop.c \
	glapi/glapi.c \
	glapi/glapi.h \
	glapi/glapi_priv.h \
Matt Turner's avatar
Matt Turner committed
160
161
	$(GLAPI_ASM_SOURCES) \
	$(MAPI_UTIL_FILES)
162
163
164
165
166
167
168

TESTS += glapi-test
check_PROGRAMS += glapi-test

glapi_test_SOURCES = glapi/tests/check_table.cpp
glapi_test_CPPFLAGS = \
	$(AM_CPPFLAGS) \
169
170
	-I$(top_srcdir)/src/gtest/include \
	-I$(top_srcdir)/src/mesa
171
172
173
174

glapi_test_LDADD = \
	$(top_builddir)/src/mapi/glapi/libglapi.la \
	$(top_builddir)/src/gtest/libgtest.la
Matt Turner's avatar
Matt Turner committed
175
endif
Matt Turner's avatar
Matt Turner committed
176
177
endif

178
179
if USE_LIBGLVND
else
Matt Turner's avatar
Matt Turner committed
180
if HAVE_OPENGL_ES1
Matt Turner's avatar
Matt Turner committed
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
TESTS += es1api/ABI-check

BUILT_SOURCES += es1api/glapi_mapi_tmp.h

pkgconfig_DATA += es1api/glesv1_cm.pc

GLES_includedir = $(includedir)/GLES
GLES_include_HEADERS = \
	$(top_srcdir)/include/GLES/egl.h \
	$(top_srcdir)/include/GLES/gl.h \
	$(top_srcdir)/include/GLES/glext.h \
	$(top_srcdir)/include/GLES/glplatform.h

lib_LTLIBRARIES += es1api/libGLESv1_CM.la

es1api_libGLESv1_CM_la_SOURCES = entry.c es1api/glapi_mapi_tmp.h
es1api_libGLESv1_CM_la_CFLAGS = \
	$(AM_CFLAGS) \
	$(VISIBILITY_CFLAGS)
es1api_libGLESv1_CM_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-DMAPI_MODE_BRIDGE \
	-DMAPI_ABI_HEADER=\"es1api/glapi_mapi_tmp.h\"
es1api_libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
es1api_libGLESv1_CM_la_LDFLAGS = \
	-no-undefined \
	-version-number 1:1 \
	$(GC_SECTIONS) \
	$(LD_NO_UNDEFINED)

es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
212
213
endif # HAVE_OPENGL_ES1
endif # USE_LIBGLVND
Matt Turner's avatar
Matt Turner committed
214

215
es1api/glapi_mapi_tmp.h: $(glapi_gen_mapi_deps)
216
	$(MKDIR_GEN)
217
	$(glapi_gen_mapi) glesv1 $(glapi_gen_gl_xml) > $@
Matt Turner's avatar
Matt Turner committed
218

219
220
if USE_LIBGLVND
else
Matt Turner's avatar
Matt Turner committed
221
if HAVE_OPENGL_ES2
Matt Turner's avatar
Matt Turner committed
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
TESTS += es2api/ABI-check

BUILT_SOURCES += es2api/glapi_mapi_tmp.h

pkgconfig_DATA += es2api/glesv2.pc

GLES2_includedir = $(includedir)/GLES2
GLES2_include_HEADERS = \
	$(top_srcdir)/include/GLES2/gl2.h \
	$(top_srcdir)/include/GLES2/gl2ext.h \
	$(top_srcdir)/include/GLES2/gl2platform.h
GLES3_includedir = $(includedir)/GLES3
GLES3_include_HEADERS = \
	$(top_srcdir)/include/GLES3/gl3.h \
	$(top_srcdir)/include/GLES3/gl31.h \
237
	$(top_srcdir)/include/GLES3/gl32.h \
Matt Turner's avatar
Matt Turner committed
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
	$(top_srcdir)/include/GLES3/gl3ext.h \
	$(top_srcdir)/include/GLES3/gl3platform.h

lib_LTLIBRARIES += es2api/libGLESv2.la

es2api_libGLESv2_la_SOURCES = entry.c es2api/glapi_mapi_tmp.h
es2api_libGLESv2_la_CFLAGS = \
	$(AM_CFLAGS) \
	$(VISIBILITY_CFLAGS)
es2api_libGLESv2_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-DMAPI_MODE_BRIDGE \
	-DMAPI_ABI_HEADER=\"es2api/glapi_mapi_tmp.h\"
es2api_libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
es2api_libGLESv2_la_LDFLAGS = \
	-no-undefined \
	-version-number 2 \
	$(GC_SECTIONS) \
	$(LD_NO_UNDEFINED)

es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
259
260
endif # HAVE_OPENGL_ES2
endif # USE_LIBGLVND
Matt Turner's avatar
Matt Turner committed
261

262
es2api/glapi_mapi_tmp.h: $(glapi_gen_mapi_deps)
263
	$(MKDIR_GEN)
264
	$(glapi_gen_mapi) glesv2 $(glapi_gen_gl_xml) > $@
Matt Turner's avatar
Matt Turner committed
265

266
include $(top_srcdir)/install-lib-links.mk
267

268
if NEED_KHRPLATFORM
269
270
khrdir = $(includedir)/KHR
khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
271
endif