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 include Makefile.sources
40 main/format_fallback.py \
43 main/format_parser.py \
44 main/format_unpack.py \
46 main/get_hash_generator.py \
47 main/get_hash_params.py \
48 program/program_lexer.l \
49 program/program_parse.y \
58 main/format_fallback.c \
61 main/format_unpack.c \
62 program/program_parse.tab.c \
66 program/program_parse.tab.h
68 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
70 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
71 main/get_hash_generator.py
72 $(PYTHON_GEN) $(srcdir)/main/get_hash_generator.py \
73 -f $(srcdir)/../mapi/glapi/gen/gl_and_es_API.xml > $@
75 main/format_fallback.c: main/format_fallback.py \
76 main/format_parser.py \
78 $(PYTHON_GEN) $(srcdir)/main/format_fallback.py $(srcdir)/main/formats.csv $@
80 main/format_info.h: main/formats.csv \
81 main/format_parser.py main/format_info.py
82 $(PYTHON_GEN) $(srcdir)/main/format_info.py $(srcdir)/main/formats.csv > $@
84 main/format_pack.c: main/format_pack.py main/formats.csv \
86 $(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
88 main/format_unpack.c: main/format_unpack.py main/formats.csv \
90 $(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
92 main/formats.c: main/format_info.h
94 noinst_LTLIBRARIES = $(ARCH_LIBS)
96 noinst_LTLIBRARIES += libmesa.la
98 check_LTLIBRARIES = libmesa.la
101 noinst_LTLIBRARIES += libmesagallium.la
104 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
108 $(VISIBILITY_CFLAGS) \
109 $(MSVC2013_COMPAT_CFLAGS)
112 $(VISIBILITY_CXXFLAGS) \
113 $(MSVC2013_COMPAT_CXXFLAGS)
118 ARCH_LIBS += libmesa_sse41.la
121 MESA_ASM_FILES_FOR_ARCH =
124 noinst_PROGRAMS = gen_matypes
126 gen_matypes_SOURCES = x86/gen_matypes.c
127 BUILT_SOURCES += matypes.h
130 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
131 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
133 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
134 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
138 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
139 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
142 libmesa_la_SOURCES = \
145 $(PROGRAM_NIR_FILES) \
146 $(MESA_ASM_FILES_FOR_ARCH)
148 libmesa_la_LIBADD = \
149 $(top_builddir)/src/compiler/glsl/libglsl.la \
152 libmesagallium_la_SOURCES = \
153 $(MESA_GALLIUM_FILES) \
155 $(PROGRAM_NIR_FILES) \
156 $(MESA_ASM_FILES_FOR_ARCH)
158 libmesagallium_la_LIBADD = \
159 $(top_builddir)/src/compiler/glsl/libglsl.la \
162 libmesa_sse41_la_SOURCES = \
165 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
167 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
168 YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS)
169 LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS)
171 program/lex.yy.c: program/program_lexer.l
173 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
175 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
177 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
180 matypes.h: $(gen_matypes_SOURCES)
181 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
182 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
184 matypes.h: gen_matypes
185 $(AM_V_GEN)./gen_matypes > $@
190 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h