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