mapi: Add ABI-check tests to distribution.
[mesa.git] / src / mapi / Makefile.am
1 # Copyright © 2013, 2014 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 SUBDIRS =
23 TESTS =
24
25 TOP = $(top_srcdir)
26
27 BUILT_SOURCES =
28 CLEANFILES = $(BUILT_SOURCES)
29
30 lib_LTLIBRARIES =
31 check_PROGRAMS =
32 pkgconfigdir = $(libdir)/pkgconfig
33 pkgconfig_DATA =
34
35 EXTRA_DIST = \
36 es1api/ABI-check \
37 es2api/ABI-check \
38 mapi_abi.py \
39 glapi/SConscript \
40 shared-glapi/SConscript
41
42 AM_CFLAGS = $(PTHREAD_CFLAGS)
43 AM_CPPFLAGS = \
44 $(DEFINES) \
45 $(SELINUX_CFLAGS) \
46 -I$(top_srcdir)/include \
47 -I$(top_srcdir)/src/mapi \
48 -I$(top_builddir)/src/mapi
49
50 GLAPI = $(top_srcdir)/src/mapi/glapi
51 include Makefile.sources
52 include glapi/Makefile.sources
53 include glapi/gen/glapi_gen.mk
54
55 if HAVE_SHARED_GLAPI
56 BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h
57
58 lib_LTLIBRARIES += shared-glapi/libglapi.la
59 shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
60 shared_glapi_libglapi_la_CPPFLAGS = \
61 $(AM_CPPFLAGS) \
62 -DMAPI_MODE_GLAPI \
63 -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
64 shared_glapi_libglapi_la_LIBADD = \
65 $(PTHREAD_LIBS) \
66 $(SELINUX_LIBS)
67 shared_glapi_libglapi_la_LDFLAGS = \
68 -no-undefined \
69 $(GC_SECTIONS) \
70 $(LD_NO_UNDEFINED)
71
72 shared-glapi/glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
73 $(call glapi_gen_mapi,$<,shared-glapi)
74
75 TESTS += shared-glapi-test
76 check_PROGRAMS += shared-glapi-test
77
78 shared_glapi_test_SOURCES = shared-glapi/tests/check_table.cpp
79 shared_glapi_test_CPPFLAGS = \
80 $(AM_CPPFLAGS) \
81 -I$(top_srcdir)/src/gtest/include
82 shared_glapi_test_LDADD = \
83 $(top_builddir)/src/mapi/shared-glapi/libglapi.la \
84 $(top_builddir)/src/gtest/libgtest.la
85 endif
86
87 if HAVE_OPENGL
88 noinst_LTLIBRARIES = glapi/libglapi.la
89
90 if HAVE_X86_ASM
91 if HAVE_X86_64_ASM
92 GLAPI_ASM_SOURCES = $(X86_64_API)
93 else
94 GLAPI_ASM_SOURCES = $(X86_API)
95 endif
96 endif
97 if HAVE_SPARC_ASM
98 GLAPI_ASM_SOURCES = $(SPARC_API)
99 endif
100
101 glapi_libglapi_la_SOURCES = $(GLAPI_UTIL_SOURCES)
102 glapi_libglapi_la_CPPFLAGS = \
103 $(AM_CPPFLAGS) \
104 -I$(top_srcdir)/src/mapi/glapi \
105 -I$(top_srcdir)/src/mesa
106
107 if HAVE_SHARED_GLAPI
108 glapi_libglapi_la_SOURCES += $(MAPI_BRIDGE_FILES)
109 glapi_libglapi_la_CPPFLAGS += \
110 -DMAPI_MODE_BRIDGE \
111 -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
112 else
113 glapi_libglapi_la_CPPFLAGS += \
114 -DMAPI_MODE_UTIL
115 glapi_libglapi_la_SOURCES += \
116 $(GLAPI_SOURCES) \
117 $(GLAPI_ASM_SOURCES) \
118 $(MAPI_UTIL_FILES)
119
120 TESTS += glapi-test
121 check_PROGRAMS += glapi-test
122
123 glapi_test_SOURCES = glapi/tests/check_table.cpp
124 glapi_test_CPPFLAGS = \
125 $(AM_CPPFLAGS) \
126 -I$(top_srcdir)/src/gtest/include
127
128 glapi_test_LDADD = \
129 $(top_builddir)/src/mapi/glapi/libglapi.la \
130 $(top_builddir)/src/gtest/libgtest.la
131 endif
132 endif
133
134 if HAVE_OPENGL_ES1
135 TESTS += es1api/ABI-check
136
137 BUILT_SOURCES += es1api/glapi_mapi_tmp.h
138
139 pkgconfig_DATA += es1api/glesv1_cm.pc
140
141 GLES_includedir = $(includedir)/GLES
142 GLES_include_HEADERS = \
143 $(top_srcdir)/include/GLES/egl.h \
144 $(top_srcdir)/include/GLES/gl.h \
145 $(top_srcdir)/include/GLES/glext.h \
146 $(top_srcdir)/include/GLES/glplatform.h
147
148 lib_LTLIBRARIES += es1api/libGLESv1_CM.la
149
150 es1api_libGLESv1_CM_la_SOURCES = entry.c es1api/glapi_mapi_tmp.h
151 es1api_libGLESv1_CM_la_CFLAGS = \
152 $(AM_CFLAGS) \
153 $(VISIBILITY_CFLAGS)
154 es1api_libGLESv1_CM_la_CPPFLAGS = \
155 $(AM_CPPFLAGS) \
156 -DMAPI_MODE_BRIDGE \
157 -DMAPI_ABI_HEADER=\"es1api/glapi_mapi_tmp.h\"
158 es1api_libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
159 es1api_libGLESv1_CM_la_LDFLAGS = \
160 -no-undefined \
161 -version-number 1:1 \
162 $(GC_SECTIONS) \
163 $(LD_NO_UNDEFINED)
164
165 if HAVE_SHARED_GLAPI
166 es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
167 endif
168
169 es1api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
170 $(call glapi_gen_mapi,$<,es1api)
171 endif
172
173 if HAVE_OPENGL_ES2
174 TESTS += es2api/ABI-check
175
176 BUILT_SOURCES += es2api/glapi_mapi_tmp.h
177
178 pkgconfig_DATA += es2api/glesv2.pc
179
180 GLES2_includedir = $(includedir)/GLES2
181 GLES2_include_HEADERS = \
182 $(top_srcdir)/include/GLES2/gl2.h \
183 $(top_srcdir)/include/GLES2/gl2ext.h \
184 $(top_srcdir)/include/GLES2/gl2platform.h
185 GLES3_includedir = $(includedir)/GLES3
186 GLES3_include_HEADERS = \
187 $(top_srcdir)/include/GLES3/gl3.h \
188 $(top_srcdir)/include/GLES3/gl31.h \
189 $(top_srcdir)/include/GLES3/gl3ext.h \
190 $(top_srcdir)/include/GLES3/gl3platform.h
191
192 lib_LTLIBRARIES += es2api/libGLESv2.la
193
194 es2api_libGLESv2_la_SOURCES = entry.c es2api/glapi_mapi_tmp.h
195 es2api_libGLESv2_la_CFLAGS = \
196 $(AM_CFLAGS) \
197 $(VISIBILITY_CFLAGS)
198 es2api_libGLESv2_la_CPPFLAGS = \
199 $(AM_CPPFLAGS) \
200 -DMAPI_MODE_BRIDGE \
201 -DMAPI_ABI_HEADER=\"es2api/glapi_mapi_tmp.h\"
202 es2api_libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
203 es2api_libGLESv2_la_LDFLAGS = \
204 -no-undefined \
205 -version-number 2 \
206 $(GC_SECTIONS) \
207 $(LD_NO_UNDEFINED)
208
209 if HAVE_SHARED_GLAPI
210 es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
211 endif
212
213 es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
214 $(call glapi_gen_mapi,$<,es2api)
215 endif
216
217 if HAVE_OPENVG
218 SUBDIRS += vgapi
219 endif
220
221 include $(top_srcdir)/install-lib-links.mk