Makefile: Add test scripts
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 22 Apr 2011 17:43:15 +0000 (19:43 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 21 Oct 2011 06:54:01 +0000 (23:54 -0700)
Makefile.am
configure.ac

index 339d2f3..717527d 100644 (file)
@@ -41,7 +41,16 @@ CLEANFILES = src/builtin.h $(local_headers)
 
 doc_files = doc/manager-api.txt doc/target-api.txt doc/adapter-api.txt
 
-EXTRA_DIST = src/genbuiltin $(test_scripts) $(doc_files)
+EXTRA_DIST = src/genbuiltin $(doc_files)
+
+test_scripts = test/list-adapters
+
+if TEST
+testdir = $(pkglibdir)/test
+test_SCRIPTS = $(test_scripts)
+endif
+
+EXTRA_DIST += $(test_scripts)
 
 MAINTAINERCLEANFILES = Makefile.in \
        aclocal.m4 configure config.h.in config.sub config.guess \
index 91d90b7..fe22d98 100644 (file)
@@ -78,4 +78,8 @@ PKG_CHECK_MODULES(NETLINK, libnl-2.0, dummy=yes,
 AC_SUBST(NETLINK_CFLAGS)
 AC_SUBST(NETLINK_LIBS)
 
+AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
+               [enable test/example scripts]), [enable_test=${enableval}])
+AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
+
 AC_OUTPUT(Makefile)