Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 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 \ |
Ian Romanick | 7d6af9e | 2015-04-15 16:59:43 -0700 | [diff] [blame] | 28 | glsl/ir_expression_operation.py \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 29 | glsl/glcpp/glcpp-lex.l \ |
| 30 | glsl/glcpp/glcpp-parse.y \ |
| 31 | SConscript.glsl |
| 32 | |
| 33 | TESTS += glsl/glcpp/tests/glcpp-test \ |
| 34 | glsl/glcpp/tests/glcpp-test-cr-lf \ |
| 35 | glsl/tests/blob-test \ |
Timothy Arceri | 87ab26b | 2016-09-28 08:55:02 +1000 | [diff] [blame] | 36 | glsl/tests/cache-test \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 37 | glsl/tests/general-ir-test \ |
| 38 | glsl/tests/optimization-test \ |
| 39 | glsl/tests/sampler-types-test \ |
Alejandro Piñeiro | eee0027 | 2016-04-19 21:03:07 +0200 | [diff] [blame] | 40 | glsl/tests/uniform-initializer-test \ |
| 41 | glsl/tests/warnings-test |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 42 | |
| 43 | TESTS_ENVIRONMENT= \ |
| 44 | export PYTHON2=$(PYTHON2); \ |
| 45 | export PYTHON_FLAGS=$(PYTHON_FLAGS); |
| 46 | |
| 47 | check_PROGRAMS += \ |
| 48 | glsl/glcpp/glcpp \ |
| 49 | glsl/glsl_test \ |
| 50 | glsl/tests/blob-test \ |
Timothy Arceri | 87ab26b | 2016-09-28 08:55:02 +1000 | [diff] [blame] | 51 | glsl/tests/cache-test \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 52 | glsl/tests/general-ir-test \ |
| 53 | glsl/tests/sampler-types-test \ |
| 54 | glsl/tests/uniform-initializer-test |
| 55 | |
| 56 | noinst_PROGRAMS = glsl_compiler |
| 57 | |
| 58 | glsl_tests_blob_test_SOURCES = \ |
| 59 | glsl/tests/blob_test.c |
| 60 | glsl_tests_blob_test_LDADD = \ |
| 61 | glsl/libglsl.la |
| 62 | |
Timothy Arceri | 87ab26b | 2016-09-28 08:55:02 +1000 | [diff] [blame] | 63 | glsl_tests_cache_test_SOURCES = \ |
| 64 | glsl/tests/cache_test.c |
Rhys Kidd | 5c73eca | 2016-10-26 00:13:24 -0400 | [diff] [blame] | 65 | glsl_tests_cache_test_CFLAGS = \ |
| 66 | $(PTHREAD_CFLAGS) |
Timothy Arceri | 87ab26b | 2016-09-28 08:55:02 +1000 | [diff] [blame] | 67 | glsl_tests_cache_test_LDADD = \ |
Rhys Kidd | 5c73eca | 2016-10-26 00:13:24 -0400 | [diff] [blame] | 68 | glsl/libglsl.la \ |
| 69 | $(PTHREAD_LIBS) |
Timothy Arceri | 87ab26b | 2016-09-28 08:55:02 +1000 | [diff] [blame] | 70 | |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 71 | glsl_tests_general_ir_test_SOURCES = \ |
Ian Romanick | b7053b8 | 2016-12-13 20:29:23 -0800 | [diff] [blame] | 72 | glsl/tests/array_refcount_test.cpp \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 73 | glsl/tests/builtin_variable_test.cpp \ |
| 74 | glsl/tests/invalidate_locations_test.cpp \ |
| 75 | glsl/tests/general_ir_test.cpp \ |
Ian Romanick | f45a2a9 | 2016-09-14 13:52:42 -0700 | [diff] [blame] | 76 | glsl/tests/opt_add_neg_to_sub_test.cpp \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 77 | glsl/tests/varyings_test.cpp |
| 78 | glsl_tests_general_ir_test_CFLAGS = \ |
| 79 | $(PTHREAD_CFLAGS) |
| 80 | glsl_tests_general_ir_test_LDADD = \ |
| 81 | $(top_builddir)/src/gtest/libgtest.la \ |
| 82 | glsl/libglsl.la \ |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 83 | glsl/libstandalone.la \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 84 | $(top_builddir)/src/libglsl_util.la \ |
| 85 | $(PTHREAD_LIBS) |
| 86 | |
| 87 | glsl_tests_uniform_initializer_test_SOURCES = \ |
| 88 | glsl/tests/copy_constant_to_storage_tests.cpp \ |
| 89 | glsl/tests/set_uniform_initializer_tests.cpp \ |
| 90 | glsl/tests/uniform_initializer_utils.cpp \ |
| 91 | glsl/tests/uniform_initializer_utils.h |
| 92 | glsl_tests_uniform_initializer_test_CFLAGS = \ |
| 93 | $(PTHREAD_CFLAGS) |
| 94 | glsl_tests_uniform_initializer_test_LDADD = \ |
| 95 | $(top_builddir)/src/gtest/libgtest.la \ |
| 96 | glsl/libglsl.la \ |
| 97 | $(top_builddir)/src/libglsl_util.la \ |
| 98 | $(PTHREAD_LIBS) |
| 99 | |
| 100 | glsl_tests_sampler_types_test_SOURCES = \ |
| 101 | glsl/tests/sampler_types_test.cpp |
| 102 | glsl_tests_sampler_types_test_CFLAGS = \ |
| 103 | $(PTHREAD_CFLAGS) |
| 104 | glsl_tests_sampler_types_test_LDADD = \ |
| 105 | $(top_builddir)/src/gtest/libgtest.la \ |
| 106 | glsl/libglsl.la \ |
| 107 | $(top_builddir)/src/libglsl_util.la \ |
| 108 | $(PTHREAD_LIBS) |
| 109 | |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 110 | noinst_LTLIBRARIES += glsl/libglsl.la glsl/libglcpp.la glsl/libstandalone.la |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 111 | |
| 112 | glsl_libglcpp_la_LIBADD = \ |
| 113 | $(top_builddir)/src/util/libmesautil.la |
| 114 | glsl_libglcpp_la_SOURCES = \ |
| 115 | glsl/glcpp/glcpp-lex.c \ |
| 116 | glsl/glcpp/glcpp-parse.c \ |
| 117 | glsl/glcpp/glcpp-parse.h \ |
| 118 | $(LIBGLCPP_FILES) |
| 119 | |
| 120 | glsl_glcpp_glcpp_SOURCES = \ |
| 121 | glsl/glcpp/glcpp.c |
| 122 | glsl_glcpp_glcpp_LDADD = \ |
| 123 | glsl/libglcpp.la \ |
| 124 | $(top_builddir)/src/libglsl_util.la \ |
| 125 | -lm |
| 126 | |
| 127 | glsl_libglsl_la_LIBADD = \ |
| 128 | nir/libnir.la \ |
| 129 | glsl/libglcpp.la |
| 130 | |
| 131 | glsl_libglsl_la_SOURCES = \ |
Ian Romanick | de71bc9 | 2016-07-13 18:02:10 -0700 | [diff] [blame] | 132 | $(LIBGLSL_GENERATED_FILES) \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 133 | $(LIBGLSL_FILES) |
| 134 | |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 135 | glsl_libstandalone_la_SOURCES = \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 136 | $(GLSL_COMPILER_CXX_FILES) |
| 137 | |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 138 | glsl_libstandalone_la_LIBADD = \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 139 | glsl/libglsl.la \ |
| 140 | $(top_builddir)/src/libglsl_util.la \ |
| 141 | $(top_builddir)/src/util/libmesautil.la \ |
| 142 | $(PTHREAD_LIBS) |
| 143 | |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 144 | glsl_compiler_SOURCES = \ |
| 145 | glsl/main.cpp |
| 146 | |
| 147 | glsl_compiler_LDADD = \ |
| 148 | glsl/libstandalone.la |
| 149 | |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 150 | glsl_glsl_test_SOURCES = \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 151 | glsl/test.cpp \ |
| 152 | glsl/test_optpass.cpp \ |
| 153 | glsl/test_optpass.h |
| 154 | |
| 155 | glsl_glsl_test_LDADD = \ |
| 156 | glsl/libglsl.la \ |
Rob Clark | 0f982bb | 2016-05-14 11:59:26 -0400 | [diff] [blame] | 157 | glsl/libstandalone.la \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 158 | $(top_builddir)/src/libglsl_util.la \ |
| 159 | $(PTHREAD_LIBS) |
| 160 | |
| 161 | # We write our own rules for yacc and lex below. We'd rather use automake, |
| 162 | # but automake makes it especially difficult for a number of reasons: |
| 163 | # |
| 164 | # * < automake-1.12 generates .h files from .yy and .ypp files, but |
| 165 | # >=automake-1.12 generates .hh and .hpp files respectively. There's no |
| 166 | # good way of making a project that uses C++ yacc files compatible with |
| 167 | # both versions of automake. Strong work automake developers. |
| 168 | # |
| 169 | # * Since we're generating code from .l/.y files in a subdirectory (glcpp/) |
| 170 | # we'd like the resulting generated code to also go in glcpp/ for purposes |
| 171 | # of distribution. Automake gives no way to do this. |
| 172 | # |
| 173 | # * Since we're building multiple yacc parsers into one library (and via one |
| 174 | # Makefile) we have to use per-target YFLAGS. Using per-target YFLAGS causes |
| 175 | # automake to name the resulting generated code as <library-name>_filename.c. |
| 176 | # Frankly, that's ugly and we don't want a libglcpp_glcpp_parser.h file. |
| 177 | |
| 178 | # In order to make build output print "LEX" and "YACC", we reproduce the |
| 179 | # automake variables below. |
| 180 | |
| 181 | AM_V_LEX = $(am__v_LEX_$(V)) |
| 182 | am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY)) |
| 183 | am__v_LEX_0 = @echo " LEX " $@; |
| 184 | am__v_LEX_1 = |
| 185 | |
| 186 | AM_V_YACC = $(am__v_YACC_$(V)) |
| 187 | am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY)) |
| 188 | am__v_YACC_0 = @echo " YACC " $@; |
| 189 | am__v_YACC_1 = |
| 190 | |
| 191 | YACC_GEN = $(AM_V_YACC)$(YACC) $(YFLAGS) |
| 192 | LEX_GEN = $(AM_V_LEX)$(LEX) $(LFLAGS) |
| 193 | |
| 194 | glsl/glsl_parser.cpp glsl/glsl_parser.h: glsl/glsl_parser.yy |
| 195 | $(MKDIR_GEN) |
| 196 | $(YACC_GEN) -o $@ -p "_mesa_glsl_" --defines=$(builddir)/glsl/glsl_parser.h $(srcdir)/glsl/glsl_parser.yy |
| 197 | |
| 198 | glsl/glsl_lexer.cpp: glsl/glsl_lexer.ll |
| 199 | $(MKDIR_GEN) |
| 200 | $(LEX_GEN) -o $@ $(srcdir)/glsl/glsl_lexer.ll |
| 201 | |
| 202 | glsl/glcpp/glcpp-parse.c glsl/glcpp/glcpp-parse.h: glsl/glcpp/glcpp-parse.y |
| 203 | $(MKDIR_GEN) |
| 204 | $(YACC_GEN) -o $@ -p "glcpp_parser_" --defines=$(builddir)/glsl/glcpp/glcpp-parse.h $(srcdir)/glsl/glcpp/glcpp-parse.y |
| 205 | |
| 206 | glsl/glcpp/glcpp-lex.c: glsl/glcpp/glcpp-lex.l |
| 207 | $(MKDIR_GEN) |
| 208 | $(LEX_GEN) -o $@ $(srcdir)/glsl/glcpp/glcpp-lex.l |
| 209 | |
Ian Romanick | 7d6af9e | 2015-04-15 16:59:43 -0700 | [diff] [blame] | 210 | glsl/ir_expression_operation.h: glsl/ir_expression_operation.py |
| 211 | $(MKDIR_GEN) |
Ian Romanick | fb44f69 | 2015-04-15 17:50:57 -0700 | [diff] [blame] | 212 | $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py enum > $@ || ($(RM) $@; false) |
| 213 | |
Ian Romanick | ee3cdac | 2016-07-12 16:42:36 -0700 | [diff] [blame] | 214 | glsl/ir_expression_operation_constant.h: glsl/ir_expression_operation.py |
| 215 | $(MKDIR_GEN) |
| 216 | $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py constant > $@ || ($(RM) $@; false) |
| 217 | |
Ian Romanick | fb44f69 | 2015-04-15 17:50:57 -0700 | [diff] [blame] | 218 | glsl/ir_expression_operation_strings.h: glsl/ir_expression_operation.py |
| 219 | $(MKDIR_GEN) |
| 220 | $(PYTHON_GEN) $(srcdir)/glsl/ir_expression_operation.py strings > $@ || ($(RM) $@; false) |
Ian Romanick | 7d6af9e | 2015-04-15 16:59:43 -0700 | [diff] [blame] | 221 | |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 222 | # Only the parsers (specifically the header files generated at the same time) |
| 223 | # need to be in BUILT_SOURCES. Though if we list the parser headers YACC is |
| 224 | # called for the .c/.cpp file and the .h files. By listing the .c/.cpp files |
| 225 | # YACC is only executed once for each parser. The rest of the generated code |
| 226 | # will be created at the appropriate times according to standard automake |
| 227 | # dependency rules. |
| 228 | BUILT_SOURCES += \ |
| 229 | glsl/glsl_parser.cpp \ |
| 230 | glsl/glsl_lexer.cpp \ |
Ian Romanick | 7d6af9e | 2015-04-15 16:59:43 -0700 | [diff] [blame] | 231 | glsl/ir_expression_operation.h \ |
Ian Romanick | ee3cdac | 2016-07-12 16:42:36 -0700 | [diff] [blame] | 232 | glsl/ir_expression_operation_constant.h \ |
Ian Romanick | fb44f69 | 2015-04-15 17:50:57 -0700 | [diff] [blame] | 233 | glsl/ir_expression_operation_strings.h \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 234 | glsl/glcpp/glcpp-parse.c \ |
| 235 | glsl/glcpp/glcpp-lex.c |
| 236 | CLEANFILES += \ |
| 237 | glsl/glcpp/glcpp-parse.h \ |
| 238 | glsl/glsl_parser.h \ |
| 239 | glsl/glsl_parser.cpp \ |
| 240 | glsl/glsl_lexer.cpp \ |
Ian Romanick | 7d6af9e | 2015-04-15 16:59:43 -0700 | [diff] [blame] | 241 | glsl/ir_expression_operation.h \ |
Ian Romanick | ee3cdac | 2016-07-12 16:42:36 -0700 | [diff] [blame] | 242 | glsl/ir_expression_operation_constant.h \ |
Ian Romanick | fb44f69 | 2015-04-15 17:50:57 -0700 | [diff] [blame] | 243 | glsl/ir_expression_operation_strings.h \ |
Emil Velikov | 9324afc | 2016-04-05 14:40:42 +0100 | [diff] [blame] | 244 | glsl/glcpp/glcpp-parse.c \ |
| 245 | glsl/glcpp/glcpp-lex.c |
| 246 | |
| 247 | clean-local: |
| 248 | $(RM) -r subtest-cr subtest-cr-lf subtest-lf subtest-lf-cr |
| 249 | |
| 250 | dist-hook: |
| 251 | $(RM) glsl/glcpp/tests/*.out |
| 252 | $(RM) glsl/glcpp/tests/subtest*/*.out |