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
45 main/format_fallback.py \
48 main/format_parser.py \
49 main/format_unpack.py \
51 main/get_hash_generator.py \
52 main/get_hash_params.py \
53 program/program_lexer.l \
54 program/program_parse.y \
63 main/format_fallback.c \
66 main/format_unpack.c \
67 program/program_parse.tab.c \
71 program/program_parse.tab.h
73 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
75 main/get_hash.h: ../mapi/glapi/gen/gl_and_es_API.xml main/get_hash_params.py \
76 main/get_hash_generator.py
77 $(PYTHON_GEN) $(srcdir)/main/get_hash_generator.py \
78 -f $(srcdir)/../mapi/glapi/gen/gl_and_es_API.xml > $@
80 main/format_fallback.c: main/format_fallback.py \
81 main/format_parser.py \
83 $(PYTHON_GEN) $(srcdir)/main/format_fallback.py $(srcdir)/main/formats.csv $@
85 main/format_info.h: main/formats.csv \
86 main/format_parser.py main/format_info.py
87 $(PYTHON_GEN) $(srcdir)/main/format_info.py $(srcdir)/main/formats.csv > $@
89 main/format_pack.c: main/format_pack.py main/formats.csv \
91 $(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
93 main/format_unpack.c: main/format_unpack.py main/formats.csv \
95 $(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
97 main/formats.c: main/format_info.h
99 noinst_LTLIBRARIES = $(ARCH_LIBS)
101 noinst_LTLIBRARIES += libmesa.la
103 check_LTLIBRARIES = libmesa.la
106 noinst_LTLIBRARIES += libmesagallium.la
109 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
113 $(VISIBILITY_CFLAGS) \
114 $(MSVC2013_COMPAT_CFLAGS)
117 $(VISIBILITY_CXXFLAGS) \
118 $(MSVC2013_COMPAT_CXXFLAGS)
123 ARCH_LIBS += libmesa_sse41.la
126 MESA_ASM_FILES_FOR_ARCH =
129 noinst_PROGRAMS = gen_matypes
131 gen_matypes_SOURCES = x86/gen_matypes.c
132 BUILT_SOURCES += matypes.h
135 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
136 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
138 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
139 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
143 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
144 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
147 libmesa_la_SOURCES = \
150 $(PROGRAM_NIR_FILES) \
151 $(MESA_ASM_FILES_FOR_ARCH)
153 libmesa_la_LIBADD = \
154 $(top_builddir)/src/compiler/glsl/libglsl.la \
157 libmesagallium_la_SOURCES = \
158 $(MESA_GALLIUM_FILES) \
160 $(PROGRAM_NIR_FILES) \
161 $(MESA_ASM_FILES_FOR_ARCH)
163 libmesagallium_la_LIBADD = \
164 $(top_builddir)/src/compiler/glsl/libglsl.la \
167 libmesa_sse41_la_SOURCES = \
170 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
172 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
173 YACC_GEN = $(AM_V_GEN)$(YACC) $(YFLAGS)
174 LEX_GEN = $(AM_V_GEN)$(LEX) $(LFLAGS)
176 program/lex.yy.c: program/program_lexer.l
178 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
180 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
182 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
185 matypes.h: $(gen_matypes_SOURCES)
186 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
187 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
189 matypes.h: gen_matypes
190 $(AM_V_GEN)./gen_matypes > $@
195 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h