[PATCH] testsuites/benchmarks: Merge benchmarks into a single Makefile.am

Chris Johns chrisj at rtems.org
Thu Apr 5 04:56:02 UTC 2018


This change is part of refactoring the testsuite's build system to
remove nested make builds for every test.

Update #3382
---
 testsuites/benchmarks/Makefile.am           | 50 ++++++++++++++++++++++++++---
 testsuites/benchmarks/configure.ac          | 13 ++++----
 testsuites/benchmarks/dhrystone/Makefile.am | 20 ------------
 testsuites/benchmarks/linpack/Makefile.am   | 21 ------------
 testsuites/benchmarks/whetstone/Makefile.am | 21 ------------
 5 files changed, 53 insertions(+), 72 deletions(-)
 delete mode 100644 testsuites/benchmarks/dhrystone/Makefile.am
 delete mode 100644 testsuites/benchmarks/linpack/Makefile.am
 delete mode 100644 testsuites/benchmarks/whetstone/Makefile.am

diff --git a/testsuites/benchmarks/Makefile.am b/testsuites/benchmarks/Makefile.am
index 6c5fe7fb27..d7f66f5925 100644
--- a/testsuites/benchmarks/Makefile.am
+++ b/testsuites/benchmarks/Makefile.am
@@ -1,9 +1,51 @@
+#
+# Beanchmarks
+#
+
 ACLOCAL_AMFLAGS = -I ../aclocal
 
-_SUBDIRS =
-_SUBDIRS += dhrystone
-_SUBDIRS += linpack
-_SUBDIRS += whetstone
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+beanchmarks =
+beanchmark_screens =
+beanchmark_docs =
+
+support_includes = \
+	-I$(top_srcdir)/../support/include
+
+if TEST_dhrystone
+beanchmarks += dhrystone
+beanchmark_screens += dhrystone/dhrystone.scn
+beanchmark_docs += dhrystone/dhrystone.doc
+dhrystone_SOURCES = dhrystone/init.c dhrystone/dhry_1.c dhrystone/dhry_2.c
+dhrystone_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dhrystone) $(support_includes) \
+	-fno-inline -fno-builtin
+endif
+
+if TEST_linpack
+beanchmarks += linpack
+beanchmark_screens += linpack/linpack.scn
+beanchmark_docs += linpack/linpack.doc
+linpack_SOURCES = linpack/init.c linpack/linpack-pc.c
+linpack_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_linpack) $(support_includes) \
+	-fno-inline -fno-builtin
+linpack_LDADD = -lm
+endif
+
+if TEST_whetstone
+beanchmarks += whetstone
+beanchmark_screens += whetstone/whetstone.scn
+beanchmark_docs += whetstone/whetstone.doc
+whetstone_SOURCES = whetstone/init.c whetstone/whetstone.c
+whetstone_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_whetstone) $(support_includes) \
+	-fno-inline -fno-builtin
+whetstone_LDADD = -lm
+endif
+
+rtems_tests_PROGRAMS = $(beanchmarks)
+dist_rtems_tests_DATA = $(beanchmark_screens) $(beanchmark_docs)
 
 include $(top_srcdir)/../automake/subdirs.am
 include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/benchmarks/configure.ac b/testsuites/benchmarks/configure.ac
index a9dbefccc8..5f8fbe0772 100644
--- a/testsuites/benchmarks/configure.ac
+++ b/testsuites/benchmarks/configure.ac
@@ -22,10 +22,11 @@ RTEMS_CANONICALIZE_TOOLS
 
 RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
 
-# Explicitly list all Makefiles here
-AC_CONFIG_FILES([Makefile
-dhrystone/Makefile
-linpack/Makefile
-whetstone/Makefile
-])
+# BSP Test configuration
+RTEMS_TEST_CHECK([dhrystone])
+RTEMS_TEST_CHECK([linpack])
+RTEMS_TEST_CHECK([whetstone])
+
+# Create output
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/testsuites/benchmarks/dhrystone/Makefile.am b/testsuites/benchmarks/dhrystone/Makefile.am
deleted file mode 100644
index 73b67212aa..0000000000
--- a/testsuites/benchmarks/dhrystone/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-rtems_tests_PROGRAMS = dhrystone
-dhrystone_SOURCES = init.c dhry_1.c dhry_2.c
-
-dist_rtems_tests_DATA = dhrystone.scn dhrystone.doc
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-
-AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-AM_CFLAGS += -fno-inline -fno-builtin
-
-LINK_OBJS = $(dhrystone_OBJECTS)
-LINK_LIBS = $(dhrystone_LDLIBS)
-
-dhrystone$(EXEEXT): $(dhrystone_OBJECTS) $(dhrystone_DEPENDENCIES)
-	@rm -f dhrystone$(EXEEXT)
-	$(make-exe)
-
-include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/benchmarks/linpack/Makefile.am b/testsuites/benchmarks/linpack/Makefile.am
deleted file mode 100644
index 2f5c25cf57..0000000000
--- a/testsuites/benchmarks/linpack/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-rtems_tests_PROGRAMS = linpack
-linpack_SOURCES = init.c linpack-pc.c
-linpack_LDADD = -lm
-
-dist_rtems_tests_DATA = linpack.scn linpack.doc
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-
-AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-AM_CFLAGS += -fno-inline -fno-builtin
-
-LINK_OBJS = $(linpack_OBJECTS) $(linpack_LDADD)
-LINK_LIBS = $(linpack_LDLIBS)
-
-linpack$(EXEEXT): $(linpack_OBJECTS) $(linpack_DEPENDENCIES)
-	@rm -f linpack$(EXEEXT)
-	$(make-exe)
-
-include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/benchmarks/whetstone/Makefile.am b/testsuites/benchmarks/whetstone/Makefile.am
deleted file mode 100644
index a325ddca46..0000000000
--- a/testsuites/benchmarks/whetstone/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-rtems_tests_PROGRAMS = whetstone
-whetstone_SOURCES = init.c whetstone.c
-whetstone_LDADD = -lm
-
-dist_rtems_tests_DATA = whetstone.scn whetstone.doc
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-
-AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-AM_CFLAGS += -fno-inline -fno-builtin
-
-LINK_OBJS = $(whetstone_OBJECTS) $(whetstone_LDADD)
-LINK_LIBS = $(whetstone_LDLIBS)
-
-whetstone$(EXEEXT): $(whetstone_OBJECTS) $(whetstone_DEPENDENCIES)
-	@rm -f whetstone$(EXEEXT)
-	$(make-exe)
-
-include $(top_srcdir)/../automake/local.am
-- 
2.15.1



More information about the devel mailing list