[Mesa-dev] [PATCH 6/6] libgallium: Convert to automake

Tom Stellard tstellar at gmail.com
Fri Jul 13 10:33:14 PDT 2012


---
 configure.ac                      |    2 +
 src/gallium/auxiliary/.gitignore  |    1 +
 src/gallium/auxiliary/Makefile    |   42 ---------------------------------
 src/gallium/auxiliary/Makefile.am |   47 +++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+), 42 deletions(-)
 create mode 100644 src/gallium/auxiliary/.gitignore
 delete mode 100644 src/gallium/auxiliary/Makefile
 create mode 100644 src/gallium/auxiliary/Makefile.am

diff --git a/configure.ac b/configure.ac
index 43cf072..4d9b9ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2105,6 +2105,7 @@ AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
+AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
 AC_SUBST([GALLIUM_MAKE_DIRS])
 
 AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
@@ -2132,6 +2133,7 @@ AC_CONFIG_FILES([configs/current
 		src/Makefile
 		src/gallium/Makefile
 		src/gallium/auxiliary/pipe-loader/Makefile
+		src/gallium/auxiliary/Makefile
 		src/gallium/state_trackers/clover/Makefile
 		src/gallium/drivers/Makefile
 		src/gallium/drivers/r300/Makefile
diff --git a/src/gallium/auxiliary/.gitignore b/src/gallium/auxiliary/.gitignore
new file mode 100644
index 0000000..f3c7a7c
--- /dev/null
+++ b/src/gallium/auxiliary/.gitignore
@@ -0,0 +1 @@
+Makefile
diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
deleted file mode 100644
index 3ba3f9c..0000000
--- a/src/gallium/auxiliary/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-TOP = ../../..
-include $(TOP)/configs/current
-
-LIBNAME = gallium
-
-# get source lists
-include Makefile.sources
-
-C_SOURCES += $(GENERATED_SOURCES)
-
-ifeq ($(MESA_LLVM),1)
-C_SOURCES += \
-	$(GALLIVM_SOURCES)
-CPP_SOURCES += \
-	$(GALLIVM_CPP_SOURCES)
-endif
-
-
-include ../Makefile.template
-
-default install clean: %: subdirs-%
-
-subdirs-%:
-	@for dir in $(SUBDIRS) ; do \
-		if [ -d $$dir ] ; then \
-			(cd $$dir && $(MAKE) $*) || exit 1; \
-		fi \
-	done
-
-indices/u_indices_gen.c: indices/u_indices_gen.py
-	$(PYTHON2) $< > $@
-
-indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
-	$(PYTHON2) $< > $@
-
-util/u_format_srgb.c: util/u_format_srgb.py
-	$(PYTHON2) $< > $@
-
-util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
-	$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
-
-# DO NOT DELETE
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
new file mode 100644
index 0000000..e4ce16a
--- /dev/null
+++ b/src/gallium/auxiliary/Makefile.am
@@ -0,0 +1,47 @@
+AUTOMAKE_OPTIONS = subdir-objects
+# get source lists
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
+SUBDIRS += pipebuffer
+noinst_LTLIBRARIES = libgallium.la
+
+libgallium_la_CFLAGS = \
+	$(GALLIUM_CFLAGS)
+
+libgallium_la_SOURCES = \
+	$(C_SOURCES) \
+	$(GENERATED_SOURCES)
+
+if HAVE_MESA_LLVM
+
+libgallium_la_CFLAGS += \
+	$(LLVM_CFLAGS)
+
+libgallium_la_CXXFLAGS = \
+	$(LLVM_CXXFLAGS) \
+	$(GALLIUM_CFLAGS)
+
+libgallium_la_SOURCES += \
+	$(GALLIVM_SOURCES) \
+	$(GALLIVM_CPP_SOURCES)
+
+endif
+
+indices/u_indices_gen.c: indices/u_indices_gen.py
+	$(PYTHON2) $< > $@
+
+indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
+	$(PYTHON2) $< > $@
+
+util/u_format_srgb.c: util/u_format_srgb.py
+	$(PYTHON2) $< > $@
+
+util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
+	$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
+
+#XXX: Delete this when all targets are converted to automake.
+all-local: libgallium.la
+	ln -f $(builddir)/.libs/libgallium.a $(builddir)/libgallium.a
+
+# DO NOT DELETE 
-- 
1.7.6.5



More information about the mesa-dev mailing list