glsl_to_tgsi: handle reladdr as TEMP in rename_temp_registers and dead_code
[mesa.git] / src / mesa / Makefile.am
1 # Copyright © 2012 Intel Corporation
2 #
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:
9 #
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
12 # Software.
13 #
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
20 # IN THE SOFTWARE.
21
22 SUBDIRS = . main/tests
23
24 # state tracker tests depend on libmesagallium.la
25 if HAVE_GALLIUM
26 SUBDIRS += state_tracker/tests
27 endif
28
29 if HAVE_XLIB_GLX
30 SUBDIRS += drivers/x11
31 endif
32
33 if HAVE_DRICOMMON
34 SUBDIRS += drivers/dri
35 endif
36
37 if HAVE_OSMESA
38 SUBDIRS += drivers/osmesa
39 endif
40
41 include Makefile.sources
42
43 EXTRA_DIST = \
44 drivers/SConscript \
45 main/format_fallback.py \
46 main/format_info.py \
47 main/format_pack.py \
48 main/format_parser.py \
49 main/format_unpack.py \
50 main/formats.csv \
51 main/get_hash_generator.py \
52 main/get_hash_params.py \
53 program/program_lexer.l \
54 program/program_parse.y \
55 SConscript \
56 swrast/NOTES \
57 swrast_setup/NOTES \
58 tnl/NOTES \
59 tnl_dd
60
61 BUILT_SOURCES = \
62 main/get_hash.h \
63 main/format_fallback.c \
64 main/format_info.h \
65 main/format_pack.c \
66 main/format_unpack.c \
67 program/program_parse.tab.c \
68 program/lex.yy.c
69 CLEANFILES = \
70 $(BUILT_SOURCES) \
71 program/program_parse.tab.h
72
73 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
74
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 > $@
79
80 main/format_fallback.c: main/format_fallback.py \
81 main/format_parser.py \
82 main/formats.csv
83 $(PYTHON_GEN) $(srcdir)/main/format_fallback.py $(srcdir)/main/formats.csv $@
84
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 > $@
88
89 main/format_pack.c: main/format_pack.py main/formats.csv \
90 main/format_parser.py
91 $(PYTHON_GEN) $(srcdir)/main/format_pack.py $(srcdir)/main/formats.csv > $@
92
93 main/format_unpack.c: main/format_unpack.py main/formats.csv \
94 main/format_parser.py
95 $(PYTHON_GEN) $(srcdir)/main/format_unpack.py $(srcdir)/main/formats.csv > $@
96
97 main/formats.c: main/format_info.h
98
99 noinst_LTLIBRARIES = $(ARCH_LIBS)
100 if NEED_LIBMESA
101 noinst_LTLIBRARIES += libmesa.la
102 else
103 check_LTLIBRARIES = libmesa.la
104 endif
105 if HAVE_GALLIUM
106 noinst_LTLIBRARIES += libmesagallium.la
107 endif
108
109 AM_CPPFLAGS = $(DEFINES) $(INCLUDE_DIRS)
110 AM_CFLAGS = \
111 $(VDPAU_CFLAGS) \
112 $(LLVM_CFLAGS) \
113 $(VISIBILITY_CFLAGS) \
114 $(MSVC2013_COMPAT_CFLAGS)
115 AM_CXXFLAGS = \
116 $(LLVM_CFLAGS) \
117 $(VISIBILITY_CXXFLAGS) \
118 $(MSVC2013_COMPAT_CXXFLAGS)
119
120 ARCH_LIBS =
121
122 if SSE41_SUPPORTED
123 ARCH_LIBS += libmesa_sse41.la
124 endif
125
126 MESA_ASM_FILES_FOR_ARCH =
127
128 if HAVE_X86_ASM
129 noinst_PROGRAMS = gen_matypes
130
131 gen_matypes_SOURCES = x86/gen_matypes.c
132 BUILT_SOURCES += matypes.h
133
134 if HAVE_X86_64_ASM
135 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
136 AM_CPPFLAGS += -I$(builddir)/x86-64 -I$(srcdir)/x86-64
137 else
138 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
139 AM_CPPFLAGS += -I$(builddir)/x86 -I$(srcdir)/x86
140 endif
141 endif
142 if HAVE_SPARC_ASM
143 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
144 AM_CPPFLAGS += -I$(builddir)/sparc -I$(srcdir)/sparc
145 endif
146
147 libmesa_la_SOURCES = \
148 $(MESA_FILES) \
149 $(PROGRAM_FILES) \
150 $(PROGRAM_NIR_FILES) \
151 $(MESA_ASM_FILES_FOR_ARCH)
152
153 libmesa_la_LIBADD = \
154 $(top_builddir)/src/compiler/glsl/libglsl.la \
155 $(ARCH_LIBS)
156
157 libmesagallium_la_SOURCES = \
158 $(MESA_GALLIUM_FILES) \
159 $(PROGRAM_FILES) \
160 $(PROGRAM_NIR_FILES) \
161 $(MESA_ASM_FILES_FOR_ARCH)
162
163 libmesagallium_la_LIBADD = \
164 $(top_builddir)/src/compiler/glsl/libglsl.la \
165 $(ARCH_LIBS)
166
167 libmesa_sse41_la_SOURCES = \
168 $(X86_SSE41_FILES)
169
170 libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) $(SSE41_CFLAGS)
171
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)
175
176 program/lex.yy.c: program/program_lexer.l
177 $(MKDIR_GEN)
178 $(LEX_GEN) -o $@ $(srcdir)/program/program_lexer.l
179
180 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
181 $(MKDIR_GEN)
182 $(YACC_GEN) -o $@ -p "_mesa_program_" --defines=$(builddir)/program/program_parse.tab.h $(srcdir)/program/program_parse.y
183
184 if GEN_ASM_OFFSETS
185 matypes.h: $(gen_matypes_SOURCES)
186 $(AM_V_GEN)$(COMPILE) $< -DASM_OFFSETS -S -o - | \
187 sed -n '/^->/{s:^->::;/[$$]/{s:^:#define :;s:[$$]::};p}' > $@
188 else
189 matypes.h: gen_matypes
190 $(AM_V_GEN)./gen_matypes > $@
191 endif
192
193 # Emacs tags
194 tags:
195 etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h