Makefile.am 6.9 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 35
	es1api/ABI-check \
	es2api/ABI-check \
36 37
	mapi_abi.py \
	glapi/SConscript \
38
	glapi/registry/gl.xml \
39 40 41 42 43 44
	shared-glapi/SConscript \
	es1api/meson.build \
	es2api/meson.build \
	glapi/meson.build \
	shared-glapi/meson.build \
	meson.build
45

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

include Makefile.sources
60

61
MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
62
PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
63

64 65
glapi_gen_mapi_deps := \
	mapi_abi.py \
66 67
	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.xml) \
	$(wildcard $(top_srcdir)/src/mapi/glapi/gen/*.py)
68

Matt Turner's avatar
Matt Turner committed
69
if HAVE_SHARED_GLAPI
70 71 72
BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h

lib_LTLIBRARIES += shared-glapi/libglapi.la
73
shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES) shared-glapi/glapi_mapi_tmp.h
74 75 76
shared_glapi_libglapi_la_CFLAGS = \
	$(AM_CFLAGS) \
	$(VISIBILITY_CFLAGS)
77 78 79 80 81 82 83 84 85 86 87 88
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)

89 90 91 92 93 94
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) \
95 96
	-I$(top_srcdir)/src/gtest/include \
	-I$(top_srcdir)/src/mesa
97 98 99
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
100 101
endif

102
shared-glapi/glapi_mapi_tmp.h : glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
103
	$(MKDIR_GEN)
104
	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer shared-glapi \
105
		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
106

Matt Turner's avatar
Matt Turner committed
107
if HAVE_OPENGL
Matt Turner's avatar
Matt Turner committed
108 109 110 111
noinst_LTLIBRARIES = glapi/libglapi.la

if HAVE_X86_ASM
if HAVE_X86_64_ASM
112
GLAPI_ASM_SOURCES = glapi/glapi_x86-64.S
Matt Turner's avatar
Matt Turner committed
113
else
114
GLAPI_ASM_SOURCES = glapi/glapi_x86.S
Matt Turner's avatar
Matt Turner committed
115 116 117
endif
endif
if HAVE_SPARC_ASM
118
GLAPI_ASM_SOURCES = glapi/glapi_sparc.S
Matt Turner's avatar
Matt Turner committed
119 120
endif

121
glapi_libglapi_la_SOURCES =
Matt Turner's avatar
Matt Turner committed
122 123 124 125
glapi_libglapi_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-I$(top_srcdir)/src/mesa

126 127 128
if HAVE_APPLEDRI
glapi_libglapi_la_SOURCES += glapi/glapi_gentable.c
endif
129 130 131
if HAVE_WINDOWSDRI
glapi_libglapi_la_SOURCES += glapi/glapi_gentable.c
endif
132

Matt Turner's avatar
Matt Turner committed
133
if HAVE_SHARED_GLAPI
134
glapi_libglapi_la_SOURCES += $(MAPI_BRIDGE_FILES) glapi/glapi_mapi_tmp.h
Matt Turner's avatar
Matt Turner committed
135 136 137 138 139 140 141
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 += \
142 143 144 145 146 147 148
	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
149 150
	$(GLAPI_ASM_SOURCES) \
	$(MAPI_UTIL_FILES)
151 152 153 154 155 156 157

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

glapi_test_SOURCES = glapi/tests/check_table.cpp
glapi_test_CPPFLAGS = \
	$(AM_CPPFLAGS) \
158 159
	-I$(top_srcdir)/src/gtest/include \
	-I$(top_srcdir)/src/mesa
160 161 162 163

glapi_test_LDADD = \
	$(top_builddir)/src/mapi/glapi/libglapi.la \
	$(top_builddir)/src/gtest/libgtest.la
Matt Turner's avatar
Matt Turner committed
164
endif
Matt Turner's avatar
Matt Turner committed
165 166 167
endif

if HAVE_OPENGL_ES1
Matt Turner's avatar
Matt Turner committed
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
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
endif

es1api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
202
	$(MKDIR_GEN)
203
	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer es1api \
204
		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
Matt Turner's avatar
Matt Turner committed
205 206

if HAVE_OPENGL_ES2
Matt Turner's avatar
Matt Turner committed
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
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 \
222
	$(top_srcdir)/include/GLES3/gl32.h \
Matt Turner's avatar
Matt Turner committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
	$(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
endif

es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
247
	$(MKDIR_GEN)
248
	$(PYTHON_GEN) $(srcdir)/mapi_abi.py --printer es2api \
249
		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
Matt Turner's avatar
Matt Turner committed
250

251
include $(top_srcdir)/install-lib-links.mk
252

253
if NEED_KHRPLATFORM
254 255
khrdir = $(includedir)/KHR
khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
256
endif