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 SUBDIRS = . main/tests
25 SUBDIRS += drivers/x11
29 SUBDIRS += drivers/dri
33 SUBDIRS += drivers/osmesa
36 gldir = $(includedir)/GL
37 gl_HEADERS = $(top_srcdir)/include/GL/*.h
39 .PHONY: $(BUILDDIR)main/git_sha1.h.tmp
40 $(BUILDDIR)main/git_sha1.h.tmp:
41 @touch main/git_sha1.h.tmp
42 @if test -d $(top_srcdir)/.git; then \
43 if which git > /dev/null; then \
44 git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
45 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
46 > main/git_sha1.h.tmp ; \
50 $(BUILDDIR)main/git_sha1.h: $(BUILDDIR)main/git_sha1.h.tmp
51 @echo "updating main/git_sha1.h"
52 @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
53 mv main/git_sha1.h.tmp main/git_sha1.h ;\
55 rm main/git_sha1.h.tmp ;\
58 # include glapi_gen.mk for generating glapi headers for GLES
59 GLAPI = $(top_srcdir)/src/mapi/glapi/gen
60 include $(GLAPI)/glapi_gen.mk
62 BUILDDIR = $(builddir)/
63 include Makefile.sources
70 main/format_parser.py \
72 main/get_hash_generator.py \
73 main/get_hash_params.py \
74 program/program_lexer.l \
75 program/program_parse.y \
85 $(BUILDDIR)main/git_sha1.h \
87 $(BUILDDIR)program/program_parse.tab.c \
88 $(BUILDDIR)program/lex.yy.c
91 $(BUILDDIR)program/program_parse.tab.h \
92 $(BUILDDIR)main/git_sha1.h.tmp
94 GET_HASH_GEN = main/get_hash_generator.py
96 main/get_hash.h: $(GLAPI)/gl_and_es_API.xml main/get_hash_params.py \
97 $(GET_HASH_GEN) Makefile
99 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/$(GET_HASH_GEN) \
103 main/format_info.c: main/formats.csv \
104 main/format_parser.py main/format_info.py
106 $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/main/format_info.py \
110 main/format_pack.c: main/format_pack.py main/formats.csv \
111 main/format_parser.py
113 $(PYTHON2) $(PYTHON_FLAGS) \
114 $(srcdir)/main/format_pack.py \
115 $(srcdir)/main/formats.csv \
116 | $(INDENT) $(INDENT_FLAGS) > $@;
118 main/formats.c: main/format_info.c
120 noinst_LTLIBRARIES = $(ARCH_LIBS)
122 noinst_LTLIBRARIES += libmesa.la
124 check_LTLIBRARIES = libmesa.la
127 noinst_LTLIBRARIES += libmesagallium.la
130 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
131 AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
132 AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS)
137 ARCH_LIBS += libmesa_sse41.la
140 MESA_ASM_FILES_FOR_ARCH =
143 noinst_PROGRAMS = gen_matypes
145 gen_matypes_SOURCES = x86/gen_matypes.c
146 BUILT_SOURCES += matypes.h
149 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
150 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
152 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
153 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
157 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
158 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
161 libmesa_la_SOURCES = \
164 $(MESA_ASM_FILES_FOR_ARCH)
166 libmesa_la_LIBADD = \
167 $(top_builddir)/src/glsl/libglsl.la \
170 libmesagallium_la_SOURCES = \
171 $(MESA_GALLIUM_FILES) \
173 $(MESA_ASM_FILES_FOR_ARCH)
175 libmesagallium_la_LIBADD = \
176 $(top_builddir)/src/glsl/libglsl.la \
179 libmesa_sse41_la_SOURCES = \
180 main/streaming-load-memcpy.c \
181 main/streaming-load-memcpy.h \
184 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
186 pkgconfigdir = $(libdir)/pkgconfig
187 pkgconfig_DATA = gl.pc
189 $(BUILDDIR)program/lex.yy.c: program/program_lexer.l
190 $(AM_V_at)$(MKDIR_P) program
191 $(AM_V_GEN) $(LEX) --never-interactive --outfile=$@ $<
193 $(BUILDDIR)program/program_parse.tab.c $(BUILDDIR)program/program_parse.tab.h: program/program_parse.y
194 $(AM_V_at)$(MKDIR_P) program
195 $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=$(BUILDDIR)program/program_parse.tab.c $<
198 matypes.h: $(gen_matypes_SOURCES)
199 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
200 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
202 matypes.h: gen_matypes
203 $(AM_V_GEN)./gen_matypes > $@
208 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h