diff options
author | Emil Velikov <[email protected]> | 2014-09-21 15:20:11 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-09-24 10:44:00 +0100 |
commit | 0e59153229f6e04296ee938d084e9d6f522fd146 (patch) | |
tree | ee397c07118c6382ec8b73ee0eea9c20de02e3ee | |
parent | 6e1f846ce09e93d2a6157da1587b546080e48211 (diff) |
gallium/nouveau: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Matt Turner <[email protected]>
-rw-r--r-- | src/gallium/drivers/nouveau/Automake.inc | 11 | ||||
-rw-r--r-- | src/gallium/targets/dri/Makefile.am | 21 | ||||
-rw-r--r-- | src/gallium/targets/egl-static/Makefile.am | 15 | ||||
-rw-r--r-- | src/gallium/targets/gbm/Makefile.am | 16 | ||||
-rw-r--r-- | src/gallium/targets/omx/Makefile.am | 16 | ||||
-rw-r--r-- | src/gallium/targets/vdpau/Makefile.am | 21 | ||||
-rw-r--r-- | src/gallium/targets/xa/Makefile.am | 16 | ||||
-rw-r--r-- | src/gallium/targets/xvmc/Makefile.am | 19 |
8 files changed, 66 insertions, 69 deletions
diff --git a/src/gallium/drivers/nouveau/Automake.inc b/src/gallium/drivers/nouveau/Automake.inc new file mode 100644 index 00000000000..1d383fcb7b1 --- /dev/null +++ b/src/gallium/drivers/nouveau/Automake.inc @@ -0,0 +1,11 @@ +if HAVE_GALLIUM_NOUVEAU + +TARGET_DRIVERS += nouveau +TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU +TARGET_LIB_DEPS += \ + $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ + $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ + $(NOUVEAU_LIBS) \ + $(LIBDRM_LIBS) + +endif diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index 7c1bcf039df..b75d7b09ee3 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -64,6 +64,10 @@ STATIC_TARGET_CPPFLAGS = STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + if HAVE_GALLIUM_I915 MEGADRIVERS += i915 STATIC_TARGET_CPPFLAGS += -DGALLIUM_I915 @@ -82,14 +86,7 @@ STATIC_TARGET_LIB_DEPS += \ $(INTEL_LIBS) endif -if HAVE_GALLIUM_NOUVEAU -MEGADRIVERS += nouveau -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc if NEED_RADEON_DRM_WINSYS STATIC_TARGET_LIB_DEPS += \ @@ -178,8 +175,8 @@ endif if HAVE_GALLIUM_STATIC_TARGETS gallium_dri_la_SOURCES += target.c -AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS) -gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS @@ -200,7 +197,7 @@ if HAVE_COMPAT_SYMLINKS all-local: $(dri_LTLIBRARIES) $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \ $(MKDIR_P) $${link_dir}; \ - for i in $(MEGADRIVERS); do \ + for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \ j=gallium_dri.so; \ k=$${i}_dri.so; \ ln -f .libs/$${j} \ @@ -212,7 +209,7 @@ endif # gallium_dri.so in the set of final installed files. install-data-hook: $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \ - for i in $(MEGADRIVERS); do \ + for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \ j=gallium_dri.so; \ k=$${i}_dri.so; \ ln -f $${dest_dir}/$${j} \ diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am index a428be5ba83..16c457b3380 100644 --- a/src/gallium/targets/egl-static/Makefile.am +++ b/src/gallium/targets/egl-static/Makefile.am @@ -157,6 +157,10 @@ endif egl_gallium_la_LDFLAGS = $(AM_LDFLAGS) egl_gallium_la_CPPFLAGS = $(AM_CPPFLAGS) +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + if HAVE_GALLIUM_I915 egl_gallium_la_CPPFLAGS += -DGALLIUM_I915 egl_gallium_la_LIBADD += \ @@ -173,13 +177,7 @@ egl_gallium_la_LIBADD += \ $(INTEL_LIBS) endif -if HAVE_GALLIUM_NOUVEAU -egl_gallium_la_CPPFLAGS += -DGALLIUM_NOUVEAU -egl_gallium_la_LIBADD += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc if NEED_RADEON_DRM_WINSYS egl_gallium_la_LIBADD += \ @@ -240,6 +238,9 @@ egl_gallium_la_LIBADD += \ $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la endif +egl_gallium_la_CPPFLAGS += $(TARGET_CPPFLAGS) +egl_gallium_la_LIBADD += $(TARGET_LIB_DEPS) + #else # HAVE_GALLIUM_STATIC_TARGETS #egl_gallium_la_LIBADD += \ diff --git a/src/gallium/targets/gbm/Makefile.am b/src/gallium/targets/gbm/Makefile.am index 34fd24379c0..1271825f96b 100644 --- a/src/gallium/targets/gbm/Makefile.am +++ b/src/gallium/targets/gbm/Makefile.am @@ -56,6 +56,10 @@ STATIC_TARGET_CPPFLAGS = STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + if HAVE_GALLIUM_I915 STATIC_TARGET_CPPFLAGS += -DGALLIUM_I915 STATIC_TARGET_LIB_DEPS += \ @@ -72,13 +76,7 @@ STATIC_TARGET_LIB_DEPS += \ $(INTEL_LIBS) endif -if HAVE_GALLIUM_NOUVEAU -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc if NEED_RADEON_DRM_WINSYS STATIC_TARGET_LIB_DEPS += \ @@ -128,8 +126,8 @@ STATIC_TARGET_LIB_DEPS += \ endif gbm_gallium_drm_la_SOURCES += target.c -gbm_gallium_drm_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) -gbm_gallium_drm_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +gbm_gallium_drm_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +gbm_gallium_drm_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS gbm_gallium_drm_la_LIBADD += \ diff --git a/src/gallium/targets/omx/Makefile.am b/src/gallium/targets/omx/Makefile.am index 88b0711d961..c99777e2782 100644 --- a/src/gallium/targets/omx/Makefile.am +++ b/src/gallium/targets/omx/Makefile.am @@ -36,13 +36,11 @@ STATIC_TARGET_CPPFLAGS = -DGALLIUM_STATIC_TARGETS=1 STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la -if HAVE_GALLIUM_NOUVEAU -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc # Radeon winsys chaos if HAVE_GALLIUM_R600 @@ -75,8 +73,8 @@ STATIC_TARGET_LIB_DEPS += \ endif libomx_mesa_la_SOURCES += target.c -libomx_mesa_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) -libomx_mesa_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +libomx_mesa_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +libomx_mesa_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS diff --git a/src/gallium/targets/vdpau/Makefile.am b/src/gallium/targets/vdpau/Makefile.am index 96ad039a9d9..27af05e094a 100644 --- a/src/gallium/targets/vdpau/Makefile.am +++ b/src/gallium/targets/vdpau/Makefile.am @@ -42,14 +42,11 @@ STATIC_TARGET_CPPFLAGS = -DGALLIUM_STATIC_TARGETS=1 STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la -if HAVE_GALLIUM_NOUVEAU -MEGADRIVERS += nouveau -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc # Radeon winsys chaos if HAVE_GALLIUM_R600 @@ -86,8 +83,8 @@ endif if HAVE_GALLIUM_STATIC_TARGETS libvdpau_gallium_la_SOURCES += target.c -libvdpau_gallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) -libvdpau_gallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +libvdpau_gallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +libvdpau_gallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS @@ -112,7 +109,7 @@ if HAVE_COMPAT_SYMLINKS all-local: $(vdpau_LTLIBRARIES) $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \ $(MKDIR_P) $${link_dir}; \ - for i in $(MEGADRIVERS); do \ + for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \ j=libvdpau_gallium.$(LIB_EXT); \ k=libvdpau_$${i}.$(LIB_EXT); \ l=$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0; \ @@ -131,7 +128,7 @@ endif # libvdpau_gallium.so in the set of final installed files. install-data-hook: $(AM_V_GEN)dest_dir=$(DESTDIR)/$(vdpaudir); \ - for i in $(MEGADRIVERS); do \ + for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \ j=libvdpau_gallium.$(LIB_EXT); \ k=libvdpau_$${i}.$(LIB_EXT); \ l=$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0; \ diff --git a/src/gallium/targets/xa/Makefile.am b/src/gallium/targets/xa/Makefile.am index 1a37b9af330..4cd820b18ce 100644 --- a/src/gallium/targets/xa/Makefile.am +++ b/src/gallium/targets/xa/Makefile.am @@ -57,6 +57,10 @@ STATIC_TARGET_CPPFLAGS = STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + if HAVE_GALLIUM_I915 STATIC_TARGET_CPPFLAGS += -DGALLIUM_I915 STATIC_TARGET_LIB_DEPS += \ @@ -73,13 +77,7 @@ STATIC_TARGET_LIB_DEPS += \ $(INTEL_LIBS) endif -if HAVE_GALLIUM_NOUVEAU -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc if HAVE_GALLIUM_SVGA STATIC_TARGET_CPPFLAGS += -DGALLIUM_VMWGFX @@ -98,8 +96,8 @@ STATIC_TARGET_LIB_DEPS += \ endif libxatracker_la_SOURCES += target.c -libxatracker_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) -libxatracker_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +libxatracker_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +libxatracker_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS diff --git a/src/gallium/targets/xvmc/Makefile.am b/src/gallium/targets/xvmc/Makefile.am index 0c8f87cd2c5..041d920ed3e 100644 --- a/src/gallium/targets/xvmc/Makefile.am +++ b/src/gallium/targets/xvmc/Makefile.am @@ -37,14 +37,11 @@ STATIC_TARGET_CPPFLAGS = -DGALLIUM_STATIC_TARGETS=1 STATIC_TARGET_LIB_DEPS = \ $(top_builddir)/src/loader/libloader.la -if HAVE_GALLIUM_NOUVEAU -MEGADRIVERS += nouveau -STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU -STATIC_TARGET_LIB_DEPS += \ - $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \ - $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \ - $(NOUVEAU_LIBS) -endif +TARGET_DRIVERS = +TARGET_CPPFLAGS = +TARGET_LIB_DEPS = + +include $(top_srcdir)/src/gallium/drivers/nouveau/Automake.inc if HAVE_GALLIUM_R600 MEGADRIVERS += r600 @@ -59,8 +56,8 @@ endif if HAVE_GALLIUM_STATIC_TARGETS libXvMCgallium_la_SOURCES += target.c -libXvMCgallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) -libXvMCgallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) +libXvMCgallium_la_CPPFLAGS = $(STATIC_TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) +libXvMCgallium_la_LIBADD += $(STATIC_TARGET_LIB_DEPS) $(TARGET_LIB_DEPS) else # HAVE_GALLIUM_STATIC_TARGETS @@ -85,7 +82,7 @@ endif # libXvMCgallium.so in the set of final installed files. install-data-hook: $(AM_V_GEN)dest_dir=$(DESTDIR)/$(xvmcdir); \ - for i in $(MEGADRIVERS); do \ + for i in $(MEGADRIVERS) $(TARGET_DRIVERS); do \ j=libXvMCgallium.$(LIB_EXT); \ k=libXvMC$${i}.$(LIB_EXT); \ l=$${k}.$(XVMC_MAJOR).$(XVMC_MINOR).0; \ |