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