[Mesa-dev] [PATCH 08/17] gallium/freedreno: add automake target 'template'

Emil Velikov emil.l.velikov at gmail.com
Sun Sep 21 16:44:05 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/freedreno/Automake.inc | 11 +++++++++++
 src/gallium/targets/dri/Makefile.am        | 10 +---------
 src/gallium/targets/egl-static/Makefile.am |  9 +--------
 src/gallium/targets/gbm/Makefile.am        |  9 +--------
 src/gallium/targets/xa/Makefile.am         |  9 +--------
 5 files changed, 15 insertions(+), 33 deletions(-)
 create mode 100644 src/gallium/drivers/freedreno/Automake.inc

diff --git a/src/gallium/drivers/freedreno/Automake.inc b/src/gallium/drivers/freedreno/Automake.inc
new file mode 100644
index 0000000..1fdf91c
--- /dev/null
+++ b/src/gallium/drivers/freedreno/Automake.inc
@@ -0,0 +1,11 @@
+if HAVE_GALLIUM_FREEDRENO
+
+TARGET_DRIVERS += msm kgsl
+TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
+TARGET_LIB_DEPS += \
+	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
+	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
+	$(FREEDRENO_LIBS) \
+	$(LIBDRM_LIBS)
+
+endif
diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am
index b75d7b0..6f4bf2a 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -130,15 +130,7 @@ STATIC_TARGET_LIB_DEPS += \
 	$(top_builddir)/src/gallium/drivers/svga/libsvga.la
 endif
 
-if HAVE_GALLIUM_FREEDRENO
-MEGADRIVERS += msm kgsl
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
-	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
-	$(FREEDRENO_LIBS)
-
-endif
+include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 if HAVE_GALLIUM_VC4
 MEGADRIVERS += vc4
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 85d2005..af7dbc3 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -222,14 +222,7 @@ egl_gallium_la_LIBADD += \
 	$(top_builddir)/src/gallium/drivers/svga/libsvga.la
 endif
 
-if HAVE_GALLIUM_FREEDRENO
-egl_gallium_la_CPPFLAGS += -DGALLIUM_FREEDRENO
-egl_gallium_la_LIBADD += \
-	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
-	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
-	$(FREEDRENO_LIBS)
-
-endif
+include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 if HAVE_GALLIUM_SOFTPIPE
 egl_gallium_la_CPPFLAGS += -DGALLIUM_SOFTPIPE
diff --git a/src/gallium/targets/gbm/Makefile.am b/src/gallium/targets/gbm/Makefile.am
index 7b40cc1..6ffab18 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -117,14 +117,7 @@ STATIC_TARGET_LIB_DEPS += \
 	$(top_builddir)/src/gallium/drivers/svga/libsvga.la
 endif
 
-if HAVE_GALLIUM_FREEDRENO
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
-	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
-	$(FREEDRENO_LIBS)
-
-endif
+include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 gbm_gallium_drm_la_SOURCES += target.c
 gbm_gallium_drm_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
diff --git a/src/gallium/targets/xa/Makefile.am b/src/gallium/targets/xa/Makefile.am
index 4cd820b..04f56c0 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -86,14 +86,7 @@ STATIC_TARGET_LIB_DEPS += \
 	$(top_builddir)/src/gallium/drivers/svga/libsvga.la
 endif
 
-if HAVE_GALLIUM_FREEDRENO
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
-STATIC_TARGET_LIB_DEPS += \
-	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
-	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
-	$(FREEDRENO_LIBS)
-
-endif
+include $(top_srcdir)/src/gallium/drivers/freedreno/Automake.inc
 
 libxatracker_la_SOURCES += target.c
 libxatracker_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
-- 
2.1.0



More information about the mesa-dev mailing list