glsl: Build a libglsl_util library.

Rather than sourcing files with ../dir/file.c which leads to distclean
wiping out ../dir's .deps directory.
diff --git a/src/Makefile.am b/src/Makefile.am
index 85b75a9..8edf333 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 @@
 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