build/glsl: fix location of generated files.
authorChristopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Thu, 19 Jul 2012 02:30:10 +0000 (12:30 +1000)
committerMatt Turner <mattst88@gmail.com>
Mon, 13 Aug 2012 19:24:39 +0000 (12:24 -0700)
Like in src/mesa, use GLSL_BUILDDIR/GLSL_SRCDIR to unambiguously
distinguish between in-tree and generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
src/glsl/Makefile.am
src/glsl/Makefile.sources
src/glsl/glcpp/Makefile.am

index d86153c48bbcec0e424be542001d7b596051c573..0ab6672114de71ffedcab5e7bc9cfc83e0907386 100644 (file)
@@ -23,9 +23,6 @@
 # builtin_compiler is built before libglsl to generate builtin_function.cpp for libglsl.
 # For this to work, a dummy version of builtin_function.cpp, builtin_stubs.cpp, is used.
 
-# Hack to make some of the non-automake variables work.
-TOP=$(top_builddir)
-
 AM_CFLAGS = \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/src/mapi \
@@ -39,7 +36,6 @@ AM_CXXFLAGS = $(AM_CFLAGS)
 
 AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
 
-GLSL_SRCDIR=$(top_srcdir)/src/glsl
 include Makefile.sources
 
 noinst_LTLIBRARIES = libglslcommon.la libglsl.la
index 765f06a27cbb8b23e222e82f7e33f9a139a8120f..aafb53eaee0f8a05636b8b44250e71f0f6051662 100644 (file)
@@ -1,6 +1,7 @@
 # shared source lists for Makefile, SConscript, and Android.mk
 
-GLSL_SRCDIR ?= .
+GLSL_SRCDIR = $(top_srcdir)/src/glsl
+GLSL_BUILDDIR = $(top_builddir)/src/glsl
 
 # libglcpp
 
@@ -8,8 +9,8 @@ LIBGLCPP_FILES = \
        $(GLSL_SRCDIR)/glcpp/pp.c
 
 LIBGLCPP_GENERATED_FILES = \
-       $(GLSL_SRCDIR)/glcpp/glcpp-lex.c \
-       $(GLSL_SRCDIR)/glcpp/glcpp-parse.c
+       $(GLSL_BUILDDIR)/glcpp/glcpp-lex.c \
+       $(GLSL_BUILDDIR)/glcpp/glcpp-parse.c
 
 # libglsl
 
@@ -102,10 +103,10 @@ BUILTIN_COMPILER_CXX_FILES = \
        $(GLSL_SRCDIR)/builtin_stubs.cpp
 
 BUILTIN_COMPILER_GENERATED_CXX_FILES = \
-       $(GLSL_SRCDIR)/glsl_lexer.cc \
-       $(GLSL_SRCDIR)/glsl_parser.cc
+       $(GLSL_BUILDDIR)/glsl_lexer.cc \
+       $(GLSL_BUILDDIR)/glsl_parser.cc
 
 # libglsl generated sources
 LIBGLSL_GENERATED_CXX_FILES = \
-       $(GLSL_SRCDIR)/$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
-       $(GLSL_SRCDIR)/builtin_function.cpp
+       $(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
+       $(GLSL_BUILDDIR)/builtin_function.cpp
index e7d5d2ca346eadae730d62532e6d388ce778f9da..7a95b6848b9d0ece1af3fcaa81516fb955350dc8 100644 (file)
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-# Hack to make some of the non-automake variables work.
-TOP=$(top_builddir)
-
-GLSL_SRCDIR=$(top_srcdir)/src/glsl
 include ../Makefile.sources
 
 AM_CFLAGS = \