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