1# Copyright © 2013 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
22AM_CPPFLAGS = \
23	-I$(top_srcdir)/include \
24	-I$(top_builddir)/include \
25	$()
26
27AM_CFLAGS = \
28	$(CWARNFLAGS) \
29	$(VISIBILITY_CFLAGS) \
30	$(X11_CFLAGS) \
31	$(EGL_CFLAGS) \
32	$()
33
34epoxyincludedir = $(includedir)/epoxy
35lib_LTLIBRARIES = libepoxy.la
36
37epoxyinclude_DATA = \
38	$(GENERATED_GL_INCLUDES) \
39	$(INSTALL_GLX_INCLUDES) \
40	$(INSTALL_EGL_INCLUDES) \
41	$(INSTALL_WGL_INCLUDES) \
42	$()
43
44if BUILD_EGL
45INSTALL_EGL_INCLUDES = $(GENERATED_EGL_INCLUDES)
46endif
47
48if BUILD_GLX
49INSTALL_GLX_INCLUDES = $(GENERATED_GLX_INCLUDES)
50endif
51
52if BUILD_WGL
53INSTALL_WGL_INCLUDES = $(GENERATED_WGL_INCLUDES)
54endif
55
56GENERATED_GL_INCLUDES = \
57	$(builddir)/../include/epoxy/gl_generated.h \
58	$()
59
60GENERATED_GLX_INCLUDES = \
61	$(builddir)/../include/epoxy/glx_generated.h \
62	$()
63
64GENERATED_EGL_INCLUDES = \
65	$(builddir)/../include/epoxy/egl_generated.h \
66	$()
67
68GENERATED_WGL_INCLUDES = \
69	$(builddir)/../include/epoxy/wgl_generated.h \
70	$()
71
72GENERATED_GL_SOURCE = gl_generated_dispatch.c
73
74GENERATED_GL = \
75	$(GENERATED_GL_SOURCE) \
76	$(GENERATED_GL_INCLUDES) \
77	$()
78
79GENERATED_GLX_SOURCE = glx_generated_dispatch.c
80
81GENERATED_GLX = \
82	$(GENERATED_GLX_SOURCE) \
83	$(GENERATED_GLX_INCLUDES) \
84	$()
85
86GENERATED_EGL_SOURCE = egl_generated_dispatch.c
87
88GENERATED_EGL = \
89	$(GENERATED_EGL_SOURCE) \
90	$(GENERATED_EGL_INCLUDES) \
91	$()
92
93GENERATED_WGL_SOURCE = wgl_generated_dispatch.c
94
95GENERATED_WGL = \
96	$(GENERATED_WGL_SOURCE) \
97	$(GENERATED_WGL_INCLUDES) \
98	$()
99
100BUILT_SOURCES = \
101	$(GENERATED_GL) \
102	$(GENERATED_GLX) \
103	$(GENERATED_EGL) \
104	$(GENERATED_WGL) \
105	$()
106CLEANFILES = $(BUILT_SOURCES)
107
108libepoxy_la_SOURCES = \
109	dispatch_common.c \
110	dispatch_common.h \
111	$(GENERATED_GL) \
112	$(BUILD_EGL_CODE) \
113	$(BUILD_GLX_CODE) \
114	$(BUILD_WGL_CODE) \
115	$()
116
117libepoxy_la_LDFLAGS = \
118	-no-undefined \
119        -Bsymbolic-functions \
120	$()
121
122libepoxy_la_LIBADD = \
123	$(EPOXY_LINK_LIBS) \
124        $(DLOPEN_LIBS) \
125	$()
126
127if BUILD_EGL
128BUILD_EGL_CODE = \
129	$(GENERATED_EGL) \
130	dispatch_egl.c \
131	$()
132endif
133
134if BUILD_GLX
135BUILD_GLX_CODE = \
136	$(GENERATED_GLX) \
137	dispatch_glx.c \
138	$()
139endif
140
141if BUILD_WGL
142BUILD_WGL_CODE = \
143	$(GENERATED_WGL) \
144	dispatch_wgl.c \
145	$()
146endif
147
148# These are generated alongside the .c file.
149$(GENERATED_GL_INCLUDES): $(GENERATED_GL_SOURCE)
150$(GENERATED_GLX_INCLUDES): $(GENERATED_GLX_SOURCE)
151$(GENERATED_EGL_INCLUDES): $(GENERATED_EGL_SOURCE)
152$(GENERATED_WGL_INCLUDES): $(GENERATED_WGL_SOURCE)
153
154$(GENERATED_GL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/gl.xml
155	@$(MKDIR_P) $(top_builddir)/include/epoxy
156	$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
157		--srcdir $(top_builddir)/src \
158		--includedir $(top_builddir)/include/epoxy \
159		$(top_srcdir)/registry/gl.xml
160
161$(GENERATED_GLX_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/glx.xml
162	@$(MKDIR_P) $(top_builddir)/include/epoxy
163	$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
164		--srcdir $(top_builddir)/src \
165		--includedir $(top_builddir)/include/epoxy \
166		$(top_srcdir)/registry/glx.xml
167
168$(GENERATED_EGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/egl.xml
169	@$(MKDIR_P) $(top_builddir)/include/epoxy
170	$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
171		--srcdir $(top_builddir)/src \
172		--includedir $(top_builddir)/include/epoxy \
173		$(top_srcdir)/registry/egl.xml
174
175$(GENERATED_WGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/wgl.xml
176	@$(MKDIR_P) $(top_builddir)/include/epoxy
177	$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
178		--srcdir $(top_builddir)/src \
179		--includedir $(top_builddir)/include/epoxy \
180		$(top_srcdir)/registry/wgl.xml
181
182EXTRA_DIST = \
183	gen_dispatch.py \
184	$()
185