gallium/r300,r600,radeonsi: add automake target 'templates'
authorEmil Velikov <emil.l.velikov@gmail.com>
Tue, 23 Sep 2014 23:30:45 +0000 (00:30 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 24 Sep 2014 09:44:01 +0000 (10:44 +0100)
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@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
src/gallium/drivers/r300/Automake.inc [new file with mode: 0644]
src/gallium/drivers/r600/Automake.inc [new file with mode: 0644]
src/gallium/drivers/radeonsi/Automake.inc [new file with mode: 0644]
src/gallium/targets/dri/Makefile.am
src/gallium/targets/egl-static/Makefile.am
src/gallium/targets/gbm/Makefile.am
src/gallium/targets/omx/Makefile.am
src/gallium/targets/vdpau/Makefile.am
src/gallium/targets/xvmc/Makefile.am

diff --git a/src/gallium/drivers/r300/Automake.inc b/src/gallium/drivers/r300/Automake.inc
new file mode 100644 (file)
index 0000000..42614cb
--- /dev/null
@@ -0,0 +1,13 @@
+if HAVE_GALLIUM_R300
+
+TARGET_DRIVERS += r300
+TARGET_CPPFLAGS += -DGALLIUM_R300
+TARGET_LIB_DEPS += \
+       $(top_builddir)/src/gallium/drivers/r300/libr300.la \
+       $(RADEON_LIBS) \
+       $(INTEL_LIBS)
+
+TARGET_RADEON_WINSYS ?= \
+       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
+
+endif
diff --git a/src/gallium/drivers/r600/Automake.inc b/src/gallium/drivers/r600/Automake.inc
new file mode 100644 (file)
index 0000000..014f415
--- /dev/null
@@ -0,0 +1,16 @@
+if HAVE_GALLIUM_R600
+
+TARGET_DRIVERS += r600
+TARGET_CPPFLAGS += -DGALLIUM_R600
+TARGET_LIB_DEPS += \
+       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
+       $(RADEON_LIBS) \
+       $(LIBDRM_LIBS)
+
+TARGET_RADEON_WINSYS ?= \
+       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
+
+TARGET_RADEON_COMMON ?= \
+       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
+
+endif
diff --git a/src/gallium/drivers/radeonsi/Automake.inc b/src/gallium/drivers/radeonsi/Automake.inc
new file mode 100644 (file)
index 0000000..3f212b3
--- /dev/null
@@ -0,0 +1,16 @@
+if HAVE_GALLIUM_RADEONSI
+
+TARGET_DRIVERS += radeonsi
+TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
+TARGET_LIB_DEPS += \
+       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
+       $(RADEON_LIBS) \
+       $(LIBDRM_LIBS)
+
+TARGET_RADEON_WINSYS ?= \
+       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
+
+TARGET_RADEON_COMMON ?= \
+       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
+
+endif
index cf4a0252fb0ebb42bca27894e6224125701593a4..0143694171a2744fdd2d51ab241c8254dc2110db 100644 (file)
@@ -74,39 +74,9 @@ include $(top_srcdir)/src/gallium/drivers/ilo/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-if NEED_RADEON_DRM_WINSYS
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-endif
-
-if HAVE_GALLIUM_RADEON_COMMON
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
-endif
-
-if HAVE_GALLIUM_R300
-MEGADRIVERS += r300
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r300/libr300.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_R600
-MEGADRIVERS += r600
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_RADEONSI
-MEGADRIVERS += radeonsi
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r300/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/svga/Automake.inc
 
@@ -148,7 +118,8 @@ if HAVE_GALLIUM_STATIC_TARGETS
 
 gallium_dri_la_SOURCES += target.c
 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
-gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
+gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
 
index 507c9574d28568800ec32e8cf45f5ea5d178b1d2..472eea74b298fcf1d4b7acc78a5114d9b1d5993f 100644 (file)
@@ -167,36 +167,9 @@ include $(top_srcdir)/src/gallium/drivers/ilo/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-if NEED_RADEON_DRM_WINSYS
-egl_gallium_la_LIBADD += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-endif
-
-if HAVE_GALLIUM_RADEON_COMMON
-egl_gallium_la_LIBADD += \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
-endif
-
-if HAVE_GALLIUM_R300
-egl_gallium_la_CPPFLAGS += -DGALLIUM_R300
-egl_gallium_la_LIBADD += \
-       $(top_builddir)/src/gallium/drivers/r300/libr300.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_R600
-egl_gallium_la_CPPFLAGS += -DGALLIUM_R600
-egl_gallium_la_LIBADD += \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_RADEONSI
-egl_gallium_la_CPPFLAGS += -DGALLIUM_RADEONSI
-egl_gallium_la_LIBADD += \
-       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r300/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/svga/Automake.inc
 
@@ -215,7 +188,9 @@ egl_gallium_la_LIBADD += \
 endif
 
 egl_gallium_la_CPPFLAGS += $(TARGET_CPPFLAGS)
-egl_gallium_la_LIBADD += $(TARGET_LIB_DEPS)
+egl_gallium_la_LIBADD += $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
+
 
 #else # HAVE_GALLIUM_STATIC_TARGETS
 
index f1166f0d631d47ff3d1d9b5a20dc7acb376c97dc..ddd558ed38275c347acef9653fdffd1735a34890 100644 (file)
@@ -66,36 +66,9 @@ include $(top_srcdir)/src/gallium/drivers/ilo/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-if NEED_RADEON_DRM_WINSYS
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-endif
-
-if HAVE_GALLIUM_RADEON_COMMON
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
-endif
-
-if HAVE_GALLIUM_R300
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r300/libr300.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_R600
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_RADEONSI
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r300/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
 
 include $(top_srcdir)/src/gallium/drivers/svga/Automake.inc
 
@@ -103,7 +76,8 @@ 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)
-gbm_gallium_drm_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
+gbm_gallium_drm_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
 gbm_gallium_drm_la_LIBADD += \
index c99777e2782704cf8d80037cd7ac6401785d82b3..db6500c945091bb2f6b5f7fa826d7d3309331175 100644 (file)
@@ -42,39 +42,13 @@ TARGET_LIB_DEPS =
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-# Radeon winsys chaos
-if HAVE_GALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-else
-if HAVE_GALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-endif
-endif
-
-if HAVE_GALLIUM_RADEON_COMMON
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
-endif
-
-if HAVE_GALLIUM_R600
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_RADEONSI
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
 
 libomx_mesa_la_SOURCES += target.c
 libomx_mesa_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
-libomx_mesa_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
+libomx_mesa_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
 
index 27af05e094acd862528f9031fddfec709a8de8be..8f5d66d4da8547cb916a2a215e8f8c7c3bcaa12d 100644 (file)
@@ -48,43 +48,15 @@ TARGET_LIB_DEPS =
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-# Radeon winsys chaos
-if HAVE_GALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-else
-if HAVE_GALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
-endif
-endif
-
-if HAVE_GALLIUM_RADEON_COMMON
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
-endif
-
-if HAVE_GALLIUM_R600
-MEGADRIVERS += r600
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
-
-if HAVE_GALLIUM_RADEONSI
-MEGADRIVERS += radeonsi
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
+include $(top_srcdir)/src/gallium/drivers/radeonsi/Automake.inc
 
 if HAVE_GALLIUM_STATIC_TARGETS
 
 libvdpau_gallium_la_SOURCES += target.c
 libvdpau_gallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
-libvdpau_gallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
+libvdpau_gallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS
 
index 041d920ed3e308d483c08280d54e43d319e9b373..812e597a277250e4677deb0fb2d9b1dd3a598c2a 100644 (file)
@@ -43,21 +43,14 @@ TARGET_LIB_DEPS =
 
 include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc
 
-if HAVE_GALLIUM_R600
-MEGADRIVERS += r600
-STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
-STATIC_TARGET_LIB_DEPS += \
-       $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-       $(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
-       $(top_builddir)/src/gallium/drivers/r600/libr600.la \
-       $(RADEON_LIBS)
-endif
+include $(top_srcdir)/src/gallium/drivers/r600/Automake.inc
 
 if HAVE_GALLIUM_STATIC_TARGETS
 
 libXvMCgallium_la_SOURCES += target.c
 libXvMCgallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS)
-libXvMCgallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS)
+libXvMCgallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) \
+       $(TARGET_RADEON_WINSYS) $(TARGET_RADEON_COMMON)
 
 else # HAVE_GALLIUM_STATIC_TARGETS