[Mesa-dev] [PATCH 15/17] gallium/softpipe, llvmpipe: add automake target 'templates'

Emil Velikov emil.l.velikov at gmail.com
Sun Sep 21 16:44:12 PDT 2014


Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/drivers/llvmpipe/Automake.inc  |  7 +++++++
 src/gallium/drivers/softpipe/Automake.inc  | 15 +++++++++++++++
 src/gallium/targets/dri/Makefile.am        | 21 ++-------------------
 src/gallium/targets/egl-static/Makefile.am | 13 ++-----------
 4 files changed, 26 insertions(+), 30 deletions(-)
 create mode 100644 src/gallium/drivers/llvmpipe/Automake.inc
 create mode 100644 src/gallium/drivers/softpipe/Automake.inc

diff --git a/src/gallium/drivers/llvmpipe/Automake.inc b/src/gallium/drivers/llvmpipe/Automake.inc
new file mode 100644
index 0000000..0a0aa34
--- /dev/null
+++ b/src/gallium/drivers/llvmpipe/Automake.inc
@@ -0,0 +1,7 @@
+if HAVE_GALLIUM_LLVMPIPE
+
+TARGET_CPPFLAGS += -DGALLIUM_LLVMPIPE
+TARGET_LIB_DEPS += \
+	$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
+
+endif
diff --git a/src/gallium/drivers/softpipe/Automake.inc b/src/gallium/drivers/softpipe/Automake.inc
new file mode 100644
index 0000000..6455f3c
--- /dev/null
+++ b/src/gallium/drivers/softpipe/Automake.inc
@@ -0,0 +1,15 @@
+if HAVE_GALLIUM_SOFTPIPE
+
+TARGET_DRIVERS += swrast
+TARGET_CPPFLAGS += -DGALLIUM_SOFTPIPE
+TARGET_LIB_DEPS += \
+	$(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
+	$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
+
+if HAVE_DRI2
+TARGET_DRIVERS += kms_swrast
+TARGET_LIB_DEPS += \
+	$(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la
+
+endif
+endif
diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am
index fe9624f..b74c29e 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -84,25 +84,8 @@ include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/vc4/Automake.inc
 
-if HAVE_GALLIUM_SOFTPIPE
-MEGADRIVERS += swrast
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_SOFTPIPE
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
-	$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
-
-if HAVE_DRI2
-MEGADRIVERS += kms_swrast
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/winsys/sw/kms-dri/libswkmsdri.la
-endif
-endif
-
-if HAVE_GALLIUM_LLVMPIPE
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_LLVMPIPE
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
-endif
+include $(top_srcdir)/src/gallium/drivers/softpipe/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/llvmpipe/Automake.inc
 
 if HAVE_GALLIUM_STATIC_TARGETS
 
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index fdb1ba2..9e0b1f7 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -175,17 +175,8 @@ include $(top_srcdir)/src/gallium/drivers/svga/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
-if HAVE_GALLIUM_SOFTPIPE
-egl_gallium_la_CPPFLAGS += -DGALLIUM_SOFTPIPE
-egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
-endif
-
-if HAVE_GALLIUM_LLVMPIPE
-egl_gallium_la_CPPFLAGS += -DGALLIUM_LLVMPIPE
-egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
-endif
+include $(top_srcdir)/src/gallium/drivers/softpipe/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/llvmpipe/Automake.inc
 
 egl_gallium_la_CPPFLAGS += $(TARGET_CPPFLAGS)
 egl_gallium_la_LIBADD += $(TARGET_LIB_DEPS) \
-- 
2.1.0



More information about the mesa-dev mailing list