From 2e46d21a2093d8f37b7194a3c816e4e63731d91e Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Wed, 28 Jan 2015 13:01:36 +0100 Subject: [PATCH] build: directly avoid SUBDIRS on no tests Instead of not building the tests, directly skip the whole tests directories. --- src/Makefile.am | 9 +++++++-- src/adg/Makefile.am | 2 ++ src/adg/tests/Makefile.am | 16 +++------------- src/cpml/Makefile.am | 2 ++ src/cpml/tests/Makefile.am | 9 ++------- 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index fa7e83b1..5e753481 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,9 +1,14 @@ include $(top_srcdir)/build/Makefile.am.common -SUBDIRS= tests \ - cpml \ + +SUBDIRS= +if HAVE_TEST_FRAMEWORK +SUBDIRS+= tests +endif +SUBDIRS+= cpml \ adg + if HAVE_GLADE adg_catalogdir= $(GLADE_CATALOGDIR) adg_catalog_DATA= adg.xml diff --git a/src/adg/Makefile.am b/src/adg/Makefile.am index 3b067dcf..7fca2185 100644 --- a/src/adg/Makefile.am +++ b/src/adg/Makefile.am @@ -1,7 +1,9 @@ include $(top_srcdir)/build/Makefile.am.common +if HAVE_TEST_FRAMEWORK SUBDIRS= tests +endif AM_CFLAGS= $(CPML_CFLAGS) \ diff --git a/src/adg/tests/Makefile.am b/src/adg/tests/Makefile.am index bb5a360f..fc0b0671 100644 --- a/src/adg/tests/Makefile.am +++ b/src/adg/tests/Makefile.am @@ -2,18 +2,15 @@ include $(top_srcdir)/build/Makefile.am.common AM_CPPFLAGS= -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/tests \ -I$(top_builddir)/src \ + -I$(top_srcdir)/src/tests \ -DSRCDIR=\"$(srcdir)\" AM_CFLAGS= $(CAIRO_CFLAGS) \ $(GOBJECT_CFLAGS) LDADD= $(top_builddir)/src/adg/libadg-1.la \ - $(top_builddir)/src/cpml/libcpml-1.la - + $(top_builddir)/src/cpml/libcpml-1.la \ + $(top_builddir)/src/tests/libadgtest.la -if HAVE_TEST_FRAMEWORK - -LDADD+= $(top_builddir)/src/tests/libadgtest.la TEST_PROGS+= test-utils$(EXEEXT) test_utils_SOURCES= test-utils.c @@ -118,15 +115,12 @@ TEST_PROGS+= test-canvas$(EXEEXT) test_canvas_SOURCES= test-canvas.c if HAVE_PANGO - TEST_PROGS+= test-text$(EXEEXT) test_text_SOURCES= test-text.c AM_CFLAGS+= $(PANGO_CFLAGS) - endif if HAVE_GTK - TEST_PROGS+= test-gtk-area$(EXEEXT) test_gtk_area_SOURCES= test-gtk-area.c @@ -140,12 +134,8 @@ AM_CFLAGS+= $(GTK3_CFLAGS) \ $(GTK2_CFLAGS) LDADD+= $(GTK3_LIBS) \ $(GTK2_LIBS) - endif -endif - - LDADD+= $(CAIRO_LIBS) \ $(GOBJECT_LIBS) diff --git a/src/cpml/Makefile.am b/src/cpml/Makefile.am index eed96bf0..7b418b9a 100644 --- a/src/cpml/Makefile.am +++ b/src/cpml/Makefile.am @@ -1,7 +1,9 @@ include $(top_srcdir)/build/Makefile.am.common +if HAVE_TEST_FRAMEWORK SUBDIRS= tests +endif AM_CFLAGS= $(CPML_CFLAGS) diff --git a/src/cpml/tests/Makefile.am b/src/cpml/tests/Makefile.am index 71a8f866..951c2e5b 100644 --- a/src/cpml/tests/Makefile.am +++ b/src/cpml/tests/Makefile.am @@ -5,13 +5,10 @@ AM_CPPFLAGS= -I$(top_srcdir)/src \ -I$(top_srcdir)/src/tests AM_CFLAGS= $(CAIRO_CFLAGS) \ $(GOBJECT_CFLAGS) -LDADD= $(top_builddir)/src/cpml/libcpml-1.la +LDADD= $(top_builddir)/src/cpml/libcpml-1.la \ + $(top_builddir)/src/tests/libadgtest.la -if HAVE_TEST_FRAMEWORK - -LDADD+= $(top_builddir)/src/tests/libadgtest.la - TEST_PROGS+= test-pair$(EXEEXT) test_pair_SOURCES= test-pair.c @@ -27,8 +24,6 @@ test_primitive_SOURCES= test-primitive.c TEST_PROGS+= test-gobject$(EXEEXT) test_gobject_SOURCES= test-gobject.c -endif - LDADD+= $(CAIRO_LIBS) \ $(GOBJECT_LIBS) -- 2.11.4.GIT