build: fix location of generated files in src/mesa (v4)
authorChristopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Thu, 19 Jul 2012 02:30:06 +0000 (12:30 +1000)
committerMatt Turner <mattst88@gmail.com>
Mon, 13 Aug 2012 19:24:04 +0000 (12:24 -0700)
Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
    top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
    These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
src/glx/apple/Makefile
src/mesa/Makefile.am
src/mesa/libdricore/Makefile.am
src/mesa/sources.mak

index 35edb09ad5ba9c13c8d27cb56e502cb38491fd4a..ef12eb0e299eebd15ce03d325475074e622f25ba 100644 (file)
@@ -1,4 +1,8 @@
 TOP = ../../..
+top_builddir = $(TOP)
+# This can be a filthy lie. But it doesn't currently build out-of-tree
+# anyway, so it's no worse than what we've got now.
+top_srcdir = $(TOP)
 
 include $(TOP)/configs/current
 
index bb70ed6ea36544ec8ea710495e4285d729437c08..85cdc1a6559801e8da594515c63cb9159eee7fca 100644 (file)
@@ -42,8 +42,7 @@ main/git_sha1.h: main/git_sha1.h.tmp
        fi
 
 # include glapi_gen.mk for generating glapi headers for GLES
-TOP = $(top_srcdir)
-GLAPI = $(TOP)/src/mapi/glapi/gen
+GLAPI = $(top_srcdir)/src/mapi/glapi/gen
 include $(GLAPI)/glapi_gen.mk
 
 BUILT_SOURCES = \
@@ -96,6 +95,7 @@ program/lex.yy.c: program/program_lexer.l
 noinst_LTLIBRARIES = libmesa.la libmesagallium.la
 
 SRCDIR = $(top_srcdir)/src/mesa/
+BUILDDIR = $(top_builddir)/src/mesa/
 include sources.mak
 
 AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS)
@@ -107,12 +107,21 @@ MESA_ASM_FILES_FOR_ARCH =
 
 if HAVE_X86_ASM
 MESA_ASM_FILES_FOR_ARCH += $(X86_FILES)
+AM_CPPFLAGS += \
+        -I$(top_builddir)/src/mesa/x86 \
+        -I$(top_srcdir)/src/mesa/x86
 endif
 if HAVE_X86_64_ASM
 MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES)
+AM_CPPFLAGS += \
+        -I$(top_builddir)/src/mesa/x86-64 \
+        -I$(top_srcdir)/src/mesa/x86-64
 endif
 if HAVE_SPARC_ASM
 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
+AM_CPPFLAGS += \
+        -I$(top_builddir)/src/mesa/sparc \
+        -I$(top_srcdir)/src/mesa/sparc
 endif
 
 libmesa_la_SOURCES = \
index 0b18fc0ce0a8327c4d2b97402087742fd1c08487..367d8c038ea0b50268dfa9a50e040d8dbcadef7a 100644 (file)
@@ -20,9 +20,9 @@
 # IN THE SOFTWARE.
 
 TOP=$(top_srcdir)
-SRCDIR = $(srcdir)/../
+SRCDIR=$(top_srcdir)/src/mesa/
+BUILDDIR=$(top_builddir)/src/mesa/
 include ../sources.mak
-GLSL_SRCDIR = $(srcdir)/../../glsl
 include ../../glsl/Makefile.sources
 
 noinst_PROGRAMS =
index ce248dea144c9078f2efdf476bbaff06ef3db076..74744c4dc7bfa07f7c710c34c2e0f5cb58b8e5f8 100644 (file)
@@ -5,8 +5,8 @@
 
 # this is part of MAIN_FILES
 MAIN_ES_FILES = \
-       $(SRCDIR)main/api_exec_es1.c \
-       $(SRCDIR)main/api_exec_es2.c
+       $(BUILDDIR)main/api_exec_es1.c \
+       $(BUILDDIR)main/api_exec_es2.c
 
 MAIN_FILES = \
        $(SRCDIR)main/api_arrayelt.c \
@@ -35,7 +35,6 @@ MAIN_FILES = \
        $(SRCDIR)main/drawpix.c \
        $(SRCDIR)main/drawtex.c \
        $(SRCDIR)main/enable.c \
-       $(SRCDIR)main/enums.c \
        $(SRCDIR)main/errors.c \
        $(SRCDIR)main/eval.c \
        $(SRCDIR)main/execmem.c \
@@ -107,6 +106,7 @@ MAIN_FILES = \
        $(SRCDIR)main/version.c \
        $(SRCDIR)main/viewport.c \
        $(SRCDIR)main/vtxfmt.c \
+       $(BUILDDIR)main/enums.c \
        $(MAIN_ES_FILES)
 
 MAIN_CXX_FILES = \
@@ -251,11 +251,9 @@ STATETRACKER_FILES = \
 PROGRAM_FILES = \
        $(SRCDIR)program/arbprogparse.c \
        $(SRCDIR)program/hash_table.c \
-       $(SRCDIR)program/lex.yy.c \
        $(SRCDIR)program/nvfragparse.c \
        $(SRCDIR)program/nvvertparse.c \
        $(SRCDIR)program/program.c \
-       $(SRCDIR)program/program_parse.tab.c \
        $(SRCDIR)program/program_parse_extra.c \
        $(SRCDIR)program/prog_cache.c \
        $(SRCDIR)program/prog_execute.c \
@@ -269,7 +267,9 @@ PROGRAM_FILES = \
        $(SRCDIR)program/prog_statevars.c \
        $(SRCDIR)program/programopt.c \
        $(SRCDIR)program/register_allocate.c \
-       $(SRCDIR)program/symbol_table.c
+       $(SRCDIR)program/symbol_table.c \
+       $(BUILDDIR)program/lex.yy.c \
+       $(BUILDDIR)program/program_parse.tab.c
 
 
 SHADER_CXX_FILES = \
@@ -375,15 +375,20 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_FILES:.c=.o)
 ### Other archives/libraries
 
 GLSL_LIBS = \
-       $(TOP)/src/glsl/libglsl.a
+       $(top_builddir)/src/glsl/libglsl.a
 
 
 ### Include directories
 
 INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/glsl \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mapi \
-       -I$(TOP)/src/gallium/include \
-       -I$(TOP)/src/gallium/auxiliary
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src/glsl \
+       -I$(top_builddir)/src/glsl \
+       -I$(top_srcdir)/src/mesa \
+       -I$(top_builddir)/src/mesa \
+       -I$(top_srcdir)/src/mesa/main \
+       -I$(top_builddir)/src/mesa/main \
+       -I$(top_srcdir)/src/mapi \
+       -I$(top_builddir)/src/mapi \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary