1 # Copyright © 2012 Intel Corporation
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:
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
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
22 AUTOMAKE_OPTIONS = subdir-objects
24 SUBDIRS = . main/tests
27 SUBDIRS += drivers/x11
31 SUBDIRS += drivers/dri
35 SUBDIRS += drivers/osmesa
38 gldir = $(includedir)/GL
39 gl_HEADERS = $(top_srcdir)/include/GL/*.h
41 .PHONY: main/git_sha1.h.tmp
43 @touch main/git_sha1.h.tmp
44 @if test -d $(top_srcdir)/.git; then \
45 if which git > /dev/null; then \
46 git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
47 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
48 > main/git_sha1.h.tmp ; \
52 main/git_sha1.h: main/git_sha1.h.tmp
53 @echo "updating main/git_sha1.h"
54 @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
55 mv main/git_sha1.h.tmp main/git_sha1.h ;\
57 rm main/git_sha1.h.tmp ;\
60 include Makefile.sources
66 main/format_parser.py \
67 main/format_unpack.py \
69 main/get_hash_generator.py \
70 main/get_hash_params.py \
71 program/program_lexer.l \
72 program/program_parse.y \
84 main/format_unpack.c \
85 program/program_parse.tab.c \
89 program/program_parse.tab.h \
92 GET_HASH_GEN = main/get_hash_generator.py
94 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
97 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
101 main/format_info.h: main/formats.csv \
102 main/format_parser.py main/format_info.py
104 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
108 main/format_pack.c: main/format_pack.py main/formats.csv \
109 main/format_parser.py
111 $(PYTHON2) $(PYTHON_FLAGS) \
112 $(srcdir)/main/format_pack.py \
113 $(srcdir)/main/formats.csv \
114 | $(INDENT) $(INDENT_FLAGS) > $@;
116 main/format_unpack.c: main/format_unpack.py main/formats.csv \
117 main/format_parser.py
119 $(PYTHON2) $(PYTHON_FLAGS) \
120 $(srcdir)/main/format_unpack.py \
121 $(srcdir)/main/formats.csv \
122 | $(INDENT) $(INDENT_FLAGS) > $@;
124 main/formats.c: main/format_info.h
126 noinst_LTLIBRARIES = $(ARCH_LIBS)
128 noinst_LTLIBRARIES += libmesa.la
130 check_LTLIBRARIES = libmesa.la
133 noinst_LTLIBRARIES += libmesagallium.la
136 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
139 $(VISIBILITY_CFLAGS) \
140 $(MSVC2013_COMPAT_CFLAGS)
143 $(VISIBILITY_CXXFLAGS) \
144 $(MSVC2013_COMPAT_CXXFLAGS)
149 ARCH_LIBS += libmesa_sse41.la
152 MESA_ASM_FILES_FOR_ARCH =
155 noinst_PROGRAMS = gen_matypes
157 gen_matypes_SOURCES = x86/gen_matypes.c
158 BUILT_SOURCES += matypes.h
161 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
162 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
164 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
165 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
169 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
170 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
173 libmesa_la_SOURCES = \
176 $(PROGRAM_NIR_FILES) \
177 $(MESA_ASM_FILES_FOR_ARCH)
179 libmesa_la_LIBADD = \
180 $(top_builddir)/src/glsl/libglsl.la \
183 libmesagallium_la_SOURCES = \
184 $(MESA_GALLIUM_FILES) \
186 $(PROGRAM_NIR_FILES) \
187 $(MESA_ASM_FILES_FOR_ARCH)
189 libmesagallium_la_LIBADD = \
190 $(top_builddir)/src/glsl/libglsl.la \
193 libmesa_sse41_la_SOURCES = \
194 main/streaming-load-memcpy.c \
195 main/streaming-load-memcpy.h \
198 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
200 pkgconfigdir = $(libdir)/pkgconfig
201 pkgconfig_DATA = gl.pc
203 program/lex.yy.c: program/program_lexer.l
204 $(AM_V_at)$(MKDIR_P) program
205 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
207 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
208 $(AM_V_at)$(MKDIR_P) program
209 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $<
212 matypes.h: $(gen_matypes_SOURCES)
213 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
214 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
216 matypes.h: gen_matypes
217 $(AM_V_GEN)./gen_matypes > $@
222 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h