Makefile.am revision 85d355f1220443c9efdf2d759f23512a7c691a3e
12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# Copyright © 2012 Jon TURNEY 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# Permission is hereby granted, free of charge, to any person obtaining a 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# copy of this software and associated documentation files (the "Software"), 5c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)# to deal in the Software without restriction, including without limitation 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# the rights to use, copy, modify, merge, publish, distribute, sublicense, 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# and/or sell copies of the Software, and to permit persons to whom the 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# Software is furnished to do so, subject to the following conditions: 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# 10ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch# The above copyright notice and this permission notice (including the next 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# paragraph) shall be included in all copies or substantial portions of the 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# Software. 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# IN THE SOFTWARE. 21c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 22c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 23c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)# builtin_compiler is built before libglsl to generate builtin_function.cpp for libglsl. 24c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)# For this to work, a dummy version of builtin_function.cpp, builtin_stubs.cpp, is used. 25c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 26c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)AM_CFLAGS = \ 27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) -I$(top_srcdir)/include \ 28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) -I$(top_srcdir)/src/mapi \ 29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) -I$(top_srcdir)/src/mesa/ \ 30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) $(LIBRARY_INCLUDES) \ 31868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) $(DEFINES) \ 32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) $(LIBRARY_DEFINES) \ 33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) $(API_DEFINES) 34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)AM_CXXFLAGS = $(AM_CFLAGS) 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 37b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 39b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)include Makefile.sources 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)noinst_LTLIBRARIES = libglslcommon.la libglsl.la 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)noinst_PROGRAMS = glsl_compiler glsl_test builtin_compiler 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# common sources for builtin_compiler and libglsl 452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)libglslcommon_la_SOURCES = \ 462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) glsl_lexer.ll \ 47b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) glsl_parser.cc \ 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(LIBGLSL_FILES) \ 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(LIBGLSL_CXX_FILES) 50c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)libglslcommon_la_LIBADD = glcpp/libglcpp.la 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 530f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# common sources for builtin_compiler and glsl_compiler 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)GLSL2_SOURCES = \ 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(top_srcdir)/src/mesa/program/hash_table.c \ 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(top_srcdir)/src/mesa/program/symbol_table.c \ 57c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) $(GLSL_COMPILER_CXX_FILES) 582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)libglsl_la_SOURCES = \ 602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) builtin_function.cpp 612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)libglsl_la_LIBADD = libglslcommon.la 632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)libglsl_la_LDFLAGS = 640f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)glsl_compiler_SOURCES = \ 660f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) $(GLSL2_SOURCES) 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)glsl_compiler_LDADD = libglsl.la 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)glsl_test_SOURCES = \ 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(top_srcdir)/src/mesa/program/hash_table.c \ 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(top_srcdir)/src/mesa/program/symbol_table.c \ 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) $(GLSL_SRCDIR)/standalone_scaffolding.cpp \ 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) test.cpp \ 752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) test_optpass.cpp 762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)glsl_test_LDADD = libglsl.la 782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)builtin_compiler_SOURCES = \ 802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) $(GLSL2_SOURCES) \ 81c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) builtin_stubs.cpp 82c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 83c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)builtin_compiler_LDADD = libglslcommon.la 84c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# automake <=1.11 and automake >=1.12 have different conventions for naming C++ header files 862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# made by yacc. To work with both, we write our own rule rather than using automake's. 870f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# When (if) we require automake >=1.12 in configure.ac, this can be removed, and we can use 882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)# the automake rule. 890f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)glsl_parser.cc glsl_parser.h: glsl_parser.yy 902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) $(AM_V_GEN) $(YACC) -v -o glsl_parser.cc -p "_mesa_glsl_" --defines=glsl_parser.h $< 912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 920f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)BUILT_SOURCES = glsl_parser.h builtin_function.cpp 930f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)CLEANFILES = glsl_lexer.cc glsl_parser.cc $(BUILT_SOURCES) 940f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler$(EXEEXT) 962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp 972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)glcpp/libglcpp.la: 99c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) cd glcpp ; $(MAKE) $(AM_MAKEFLAGS) 100c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 101c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)SUBDIRS = glcpp 102c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)# Provide compatibility with scripts for the old Mesa build system for 1040f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# a while by putting a link to the library in the current directory. 1052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)all-local: libglsl.la 1060f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) ln -f .libs/libglsl.a . 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)CLEANFILES += libglsl.a 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)