radv: fix clearing attachments in secondary command buffers
[mesa.git] / src / compiler / Makefile.glsl.am
1 #
2 # Copyright © 2012 Jon TURNEY
3 # Copyright (C) 2015 Intel Corporation
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the "Software"),
7 # to deal in the Software without restriction, including without limitation
8 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 # and/or sell copies of the Software, and to permit persons to whom the
10 # Software is furnished to do so, subject to the following conditions:
11 #
12 # The above copyright notice and this permission notice (including the next
13 # paragraph) shall be included in all copies or substantial portions of the
14 # Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 # IN THE SOFTWARE.
23
24 EXTRA_DIST += glsl/tests glsl/glcpp/tests glsl/README \
25 glsl/TODO glsl/glcpp/README \
26 glsl/glsl_lexer.ll \
27 glsl/glsl_parser.yy \
28 glsl/ir_expression_operation.py \
29 glsl/glcpp/glcpp-lex.l \
30 glsl/glcpp/glcpp-parse.y \
31 glsl/xxd.py \
32 glsl/float64.glsl \
33 SConscript.glsl
34
35 TESTS += glsl/glcpp/tests/glcpp-test.sh \
36 glsl/tests/blob-test \
37 glsl/tests/cache-test \
38 glsl/tests/general-ir-test \
39 glsl/tests/optimization-test.sh \
40 glsl/tests/sampler-types-test \
41 glsl/tests/uniform-initializer-test \
42 glsl/tests/warnings-test.sh
43
44 TESTS_ENVIRONMENT= \
45 export abs_builddir=$(abs_builddir); \
46 export PYTHON=$(PYTHON); \
47 export PYTHON_FLAGS=$(PYTHON_FLAGS);
48
49 check_PROGRAMS += \
50 glsl/glcpp/glcpp \
51 glsl/glsl_test \
52 glsl/tests/blob-test \
53 glsl/tests/cache-test \
54 glsl/tests/general-ir-test \
55 glsl/tests/sampler-types-test \
56 glsl/tests/uniform-initializer-test
57
58 noinst_PROGRAMS += glsl_compiler
59
60 glsl_tests_blob_test_SOURCES = \
61 glsl/tests/blob_test.c
62 glsl_tests_blob_test_LDADD = \
63 glsl/libglsl.la
64
65 glsl_tests_cache_test_SOURCES = \
66 glsl/tests/cache_test.c
67 glsl_tests_cache_test_CFLAGS = \
68 $(PTHREAD_CFLAGS)
69 glsl_tests_cache_test_LDADD = \
70 glsl/libglsl.la \
71 $(PTHREAD_LIBS) \
72 $(CLOCK_LIB)
73
74 glsl_tests_general_ir_test_SOURCES = \
75 glsl/tests/array_refcount_test.cpp \
76 glsl/tests/builtin_variable_test.cpp \
77 glsl/tests/invalidate_locations_test.cpp \
78 glsl/tests/general_ir_test.cpp \
79 glsl/tests/lower_int64_test.cpp \
80 glsl/tests/opt_add_neg_to_sub_test.cpp \
81 glsl/tests/varyings_test.cpp
82 glsl_tests_general_ir_test_CFLAGS = \
83 $(PTHREAD_CFLAGS)
84 glsl_tests_general_ir_test_LDADD = \
85 $(top_builddir)/src/gtest/libgtest.la \
86 glsl/libglsl.la \
87 glsl/libstandalone.la \
88 $(top_builddir)/src/libglsl_util.la \
89 $(PTHREAD_LIBS) \
90 $(CLOCK_LIB)
91
92 glsl_tests_uniform_initializer_test_SOURCES = \
93 glsl/tests/copy_constant_to_storage_tests.cpp \
94 glsl/tests/set_uniform_initializer_tests.cpp \
95 glsl/tests/uniform_initializer_utils.cpp \
96 glsl/tests/uniform_initializer_utils.h
97 glsl_tests_uniform_initializer_test_CFLAGS = \
98 $(PTHREAD_CFLAGS)
99 glsl_tests_uniform_initializer_test_LDADD = \
100 $(top_builddir)/src/gtest/libgtest.la \
101 glsl/libglsl.la \
102 $(top_builddir)/src/libglsl_util.la \
103 $(PTHREAD_LIBS)
104
105 glsl_tests_sampler_types_test_SOURCES = \
106 glsl/tests/sampler_types_test.cpp
107 glsl_tests_sampler_types_test_CFLAGS = \
108 $(PTHREAD_CFLAGS)
109 glsl_tests_sampler_types_test_LDADD = \
110 $(top_builddir)/src/gtest/libgtest.la \
111 glsl/libglsl.la \
112 $(top_builddir)/src/libglsl_util.la \
113 $(PTHREAD_LIBS)
114
115 noinst_LTLIBRARIES += glsl/libglsl.la glsl/libglcpp.la glsl/libstandalone.la
116
117 glsl_libglcpp_la_LIBADD = \
118 $(top_builddir)/src/util/libmesautil.la
119 glsl_libglcpp_la_SOURCES = \
120 glsl/glcpp/glcpp-lex.c \
121 glsl/glcpp/glcpp-parse.c \
122 glsl/glcpp/glcpp-parse.h \
123 $(LIBGLCPP_FILES)
124
125 glsl_glcpp_glcpp_SOURCES = \
126 glsl/glcpp/glcpp.c
127 glsl_glcpp_glcpp_LDADD = \
128 glsl/libglcpp.la \
129 $(top_builddir)/src/libglsl_util.la \
130 -lm
131
132 glsl_libglsl_la_LIBADD = \
133 nir/libnir.la \
134 glsl/libglcpp.la
135
136 glsl_libglsl_la_SOURCES = \
137 $(LIBGLSL_GENERATED_FILES) \
138 $(LIBGLSL_FILES) \
139 $(LIBGLSL_SHADER_CACHE_FILES)
140
141 glsl_libstandalone_la_SOURCES = \
142 $(GLSL_COMPILER_CXX_FILES)
143
144 glsl_libstandalone_la_LIBADD = \
145 glsl/libglsl.la \
146 $(top_builddir)/src/libglsl_util.la \
147 $(top_builddir)/src/util/libmesautil.la \
148 $(PTHREAD_LIBS)
149
150 glsl_compiler_SOURCES = \
151 glsl/main.cpp
152
153 glsl_compiler_LDADD = \
154 glsl/libstandalone.la \
155 $(CLOCK_LIB)
156
157 glsl_glsl_test_SOURCES = \
158 glsl/test.cpp \
159 glsl/test_optpass.cpp \
160 glsl/test_optpass.h
161
162 glsl_glsl_test_LDADD = \
163 glsl/libglsl.la \
164 glsl/libstandalone.la \
165 $(top_builddir)/src/libglsl_util.la \
166 $(PTHREAD_LIBS) \
167 $(CLOCK_LIB)
168
169 # We write our own rules for yacc and lex below. We'd rather use automake,
170 # but automake makes it especially difficult for a number of reasons:
171 #
172 # * < automake-1.12 generates .h files from .yy and .ypp files, but
173 # >=automake-1.12 generates .hh and .hpp files respectively. There's no
174 # good way of making a project that uses C++ yacc files compatible with
175 # both versions of automake. Strong work automake developers.
176 #
177 # * Since we're generating code from .l/.y files in a subdirectory (glcpp/)
178 # we'd like the resulting generated code to also go in glcpp/ for purposes
179 # of distribution. Automake gives no way to do this.
180 #
181 # * Since we're building multiple yacc parsers into one library (and via one
182 # Makefile) we have to use per-target YFLAGS. Using per-target YFLAGS causes
183 # automake to name the resulting generated code as <library-name>_filename.c.
184 # Frankly, that's ugly and we don't want a libglcpp_glcpp_parser.h file.
185
186 # In order to make build output print "LEX" and "YACC", we reproduce the
187 # automake variables below.
188
189 AM_V_LEX = $(am__v_LEX_$(V))
190 am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
191 am__v_LEX_0 = @echo " LEX " $@;
192 am__v_LEX_1 =
193
194 AM_V_YACC = $(am__v_YACC_$(V))
195 am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
196 am__v_YACC_0 = @echo " YACC " $@;
197 am__v_YACC_1 =
198
199 YACC_GEN = $(AM_V_YACC)$(YACC) $(YFLAGS)
200 LEX_GEN = $(AM_V_LEX)$(LEX) $(LFLAGS)
201
202 glsl/glsl_parser.cpp glsl/glsl_parser.h: glsl/glsl_parser.yy
203 $(MKDIR_GEN)
204 $(YACC_GEN) -o $@ -p "_mesa_glsl_" --defines=$(builddir)/glsl/glsl_parser.h $(srcdir)/glsl/glsl_parser.yy
205
206 glsl/glsl_lexer.cpp: glsl/glsl_lexer.ll
207 $(MKDIR_GEN)
208 $(LEX_GEN) -o $@ $(srcdir)/glsl/glsl_lexer.ll
209
210 glsl/glcpp/glcpp-parse.c glsl/glcpp/glcpp-parse.h: glsl/glcpp/glcpp-parse.y
211 $(MKDIR_GEN)
212 $(YACC_GEN) -o $@ -p "glcpp_parser_" --defines=$(builddir)/glsl/glcpp/glcpp-parse.h $(srcdir)/glsl/glcpp/glcpp-parse.y
213
214 glsl/glcpp/glcpp-lex.c: glsl/glcpp/glcpp-lex.l
215 $(MKDIR_GEN)
216 $(LEX_GEN) -o $@ $(srcdir)/glsl/glcpp/glcpp-lex.l
217
218 glsl/ir_expression_operation.h: glsl/ir_expression_operation.py
219 $(MKDIR_GEN)
220 $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py enum > $@ || ($(RM) $@; false)
221
222 glsl/ir_expression_operation_constant.h: glsl/ir_expression_operation.py
223 $(MKDIR_GEN)
224 $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py constant > $@ || ($(RM) $@; false)
225
226 glsl/ir_expression_operation_strings.h: glsl/ir_expression_operation.py
227 $(MKDIR_GEN)
228 $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py strings > $@ || ($(RM) $@; false)
229
230 glsl/float64_glsl.h: glsl/xxd.py glsl/float64.glsl
231 $(MKDIR_GEN)
232 $(PYTHON_GEN) $(srcdir)/glsl/xxd.py $(srcdir)/glsl/float64.glsl $@ -n float64_source || ($(RM) $@; false)
233
234 # Only the parsers (specifically the header files generated at the same time)
235 # need to be in BUILT_SOURCES. Though if we list the parser headers YACC is
236 # called for the .c/.cpp file and the .h files. By listing the .c/.cpp files
237 # YACC is only executed once for each parser. The rest of the generated code
238 # will be created at the appropriate times according to standard automake
239 # dependency rules.
240 BUILT_SOURCES += \
241 glsl/float64_glsl.h \
242 glsl/glsl_parser.cpp \
243 glsl/glsl_lexer.cpp \
244 glsl/ir_expression_operation.h \
245 glsl/ir_expression_operation_constant.h \
246 glsl/ir_expression_operation_strings.h \
247 glsl/glcpp/glcpp-parse.c \
248 glsl/glcpp/glcpp-lex.c
249 CLEANFILES += \
250 glsl/float64_glsl.h \
251 glsl/glcpp/glcpp-parse.h \
252 glsl/glsl_parser.h \
253 glsl/glsl_parser.cpp \
254 glsl/glsl_lexer.cpp \
255 glsl/ir_expression_operation.h \
256 glsl/ir_expression_operation_constant.h \
257 glsl/ir_expression_operation_strings.h \
258 glsl/glcpp/glcpp-parse.c \
259 glsl/glcpp/glcpp-lex.c
260
261 clean-local:
262 $(RM) glsl/tests/lower_jumps/*.opt_test
263 $(RM) glsl/tests/lower_jumps/*.expected
264 $(RM) glsl/tests/lower_jumps/*.out
265 $(RM) glsl/tests/warnings/*.out
266 $(RM) glsl/glcpp/tests/*.out
267 $(RM) -r glsl/glcpp/tests/subtest*/
268 $(RM) -r subtest-cr subtest-cr-lf subtest-lf subtest-lf-cr
269
270 dist-hook:
271 $(RM) glsl/glcpp/tests/*.out
272 $(RM) glsl/glcpp/tests/subtest*/*.out