summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-12-18 13:33:29 -0800
committerMatt Turner <mattst88@gmail.com>2015-01-23 14:28:44 -0800
commit145919b2ab737d3b390a6a8ab77d54719db1e6f8 (patch)
treeeb126491eb26cd23f94387d0f764646335800033
parenta37ae2ab922a0a7fceb9dba85dba11c26f4cf736 (diff)
downloadexternal_mesa3d-145919b2ab737d3b390a6a8ab77d54719db1e6f8.tar.gz
external_mesa3d-145919b2ab737d3b390a6a8ab77d54719db1e6f8.tar.bz2
external_mesa3d-145919b2ab737d3b390a6a8ab77d54719db1e6f8.zip
glsl: Build a libglsl_util library.
Rather than sourcing files with ../dir/file.c which leads to distclean wiping out ../dir's .deps directory.
-rw-r--r--src/Makefile.am17
-rw-r--r--src/glsl/Makefile.am23
2 files changed, 23 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 85b75a93b5..8edf33373e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,7 +19,9 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-SUBDIRS = gtest util mapi/glapi/gen mapi
+AUTOMAKE_OPTIONS = subdir-objects
+
+SUBDIRS = . gtest util mapi/glapi/gen mapi
if NEED_OPENGL_COMMON
SUBDIRS += glsl mesa
@@ -52,3 +54,16 @@ SUBDIRS += gallium
endif
EXTRA_DIST = egl/docs getopt hgl SConscript
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include/ \
+ -I$(top_srcdir)/src/mapi/ \
+ -I$(top_srcdir)/src/mesa/ \
+ $(DEFINES)
+
+noinst_LTLIBRARIES = libglsl_util.la
+
+libglsl_util_la_SOURCES = \
+ mesa/main/imports.c \
+ mesa/program/prog_hash_table.c \
+ mesa/program/symbol_table.c
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 3cd8e9ed88..78ccfee9a7 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -73,9 +73,6 @@ tests_blob_test_LDADD = \
$(top_builddir)/src/glsl/libglsl.la
tests_general_ir_test_SOURCES = \
- ../mesa/main/imports.c \
- ../mesa/program/prog_hash_table.c \
- ../mesa/program/symbol_table.c \
standalone_scaffolding.cpp \
tests/builtin_variable_test.cpp \
tests/invalidate_locations_test.cpp \
@@ -87,12 +84,10 @@ tests_general_ir_test_CFLAGS = \
tests_general_ir_test_LDADD = \
$(top_builddir)/src/gtest/libgtest.la \
$(top_builddir)/src/glsl/libglsl.la \
+ $(top_builddir)/src/libglsl_util.la \
$(PTHREAD_LIBS)
tests_uniform_initializer_test_SOURCES = \
- ../mesa/main/imports.c \
- ../mesa/program/prog_hash_table.c\
- ../mesa/program/symbol_table.c \
tests/copy_constant_to_storage_tests.cpp \
tests/set_uniform_initializer_tests.cpp \
tests/uniform_initializer_utils.cpp \
@@ -103,11 +98,10 @@ tests_uniform_initializer_test_CFLAGS = \
tests_uniform_initializer_test_LDADD = \
$(top_builddir)/src/gtest/libgtest.la \
$(top_builddir)/src/glsl/libglsl.la \
+ $(top_builddir)/src/libglsl_util.la \
$(PTHREAD_LIBS)
tests_sampler_types_test_SOURCES = \
- ../mesa/program/prog_hash_table.c\
- ../mesa/program/symbol_table.c \
tests/sampler_types_test.cpp \
tests/common.c
tests_sampler_types_test_CFLAGS = \
@@ -115,6 +109,7 @@ tests_sampler_types_test_CFLAGS = \
tests_sampler_types_test_LDADD = \
$(top_builddir)/src/gtest/libgtest.la \
$(top_builddir)/src/glsl/libglsl.la \
+ $(top_builddir)/src/libglsl_util.la \
$(PTHREAD_LIBS)
libglcpp_la_LIBADD = \
@@ -127,10 +122,10 @@ libglcpp_la_SOURCES = \
glcpp_glcpp_SOURCES = \
glcpp/glcpp.c \
- tests/common.c \
- ../mesa/program/prog_hash_table.c
+ tests/common.c
glcpp_glcpp_LDADD = \
libglcpp.la \
+ $(top_builddir)/src/libglsl_util.la \
-lm
libglsl_la_LIBADD = libglcpp.la
@@ -142,19 +137,14 @@ libglsl_la_SOURCES = \
$(NIR_FILES)
glsl_compiler_SOURCES = \
- ../mesa/main/imports.c \
- ../mesa/program/prog_hash_table.c \
- ../mesa/program/symbol_table.c \
$(GLSL_COMPILER_CXX_FILES)
glsl_compiler_LDADD = \
libglsl.la \
+ $(top_builddir)/src/libglsl_util.la \
$(PTHREAD_LIBS)
glsl_test_SOURCES = \
- ../mesa/main/imports.c \
- ../mesa/program/prog_hash_table.c \
- ../mesa/program/symbol_table.c \
standalone_scaffolding.cpp \
tests/common.c \
test.cpp \
@@ -163,6 +153,7 @@ glsl_test_SOURCES = \
glsl_test_LDADD = \
libglsl.la \
+ $(top_builddir)/src/libglsl_util.la \
$(PTHREAD_LIBS)
# We write our own rules for yacc and lex below. We'd rather use automake,