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
24 # state tracker tests depend on libmesagallium.la
26 SUBDIRS += state_tracker/tests
30 SUBDIRS += drivers/x11
34 SUBDIRS += drivers/dri
38 SUBDIRS += drivers/osmesa
41 include Makefile.sources
48 main/format_fallback.py \
51 main/format_parser.py \
52 main/format_unpack.py \
54 main/get_hash_generator.py \
55 main/get_hash_params.py \
56 program/program_lexer.l \
57 program/program_parse.y \
66 main/format_fallback.c \
69 main/format_unpack.c \
70 program/program_parse.tab.c \
74 program/program_parse.tab.h
76 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
78 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
79 main/get_hash_generator.py
80 $(PYTHON_GEN) $(srcdir)/main/get_hash_generator.py \
81 -f $(srcdir)/../mapi/glapi/gen/gl_and_es_API.xml > $@
83 main/format_fallback.c: main/format_fallback.py \
84 main/format_parser.py \
86 $(PYTHON_GEN) $(srcdir)/main/format_fallback.py $(srcdir)/main/formats.csv $@
88 main/format_info.h: main/formats.csv \
89 main/format_parser.py main/format_info.py
90 $(PYTHON_GEN) $(srcdir)/main/format_info.py $(srcdir)/main/formats.csv > $@
92 main/format_pack.c: main/format_pack.py main/formats.csv \
94 $(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
96 main/format_unpack.c: main/format_unpack.py main/formats.csv \
98 $(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
100 main/formats.c: main/format_info.h
102 noinst_LTLIBRARIES = $(ARCH_LIBS)
104 noinst_LTLIBRARIES += libmesa.la
106 check_LTLIBRARIES = libmesa.la
109 noinst_LTLIBRARIES += libmesagallium.la
112 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
116 $(VISIBILITY_CFLAGS) \
117 $(MSVC2013_COMPAT_CFLAGS)
120 $(VISIBILITY_CXXFLAGS) \
121 $(MSVC2013_COMPAT_CXXFLAGS)
126 ARCH_LIBS += libmesa_sse41.la
129 MESA_ASM_FILES_FOR_ARCH =
132 noinst_PROGRAMS = gen_matypes
134 gen_matypes_SOURCES = x86/gen_matypes.c
135 BUILT_SOURCES += matypes.h
138 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
139 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
141 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
142 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
146 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
147 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
150 libmesa_la_SOURCES = \
153 $(PROGRAM_NIR_FILES) \
154 $(MESA_ASM_FILES_FOR_ARCH)
156 libmesa_la_LIBADD = \
157 $(top_builddir)/src/compiler/glsl/libglsl.la \
160 libmesagallium_la_SOURCES = \
161 $(MESA_GALLIUM_FILES) \
163 $(PROGRAM_NIR_FILES) \
164 $(MESA_ASM_FILES_FOR_ARCH)
166 libmesagallium_la_LIBADD = \
167 $(top_builddir)/src/compiler/glsl/libglsl.la \
170 libmesa_sse41_la_SOURCES = \
173 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
175 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
176 YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS)
177 LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS)
179 program/lex.yy.c: program/program_lexer.l
181 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
183 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
185 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
188 matypes.h: $(gen_matypes_SOURCES)
189 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
190 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
192 matypes.h: gen_matypes
193 $(AM_V_GEN)./gen_matypes > $@
198 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h