diff --git a/INSTALL b/INSTALL
--- a/INSTALL
+++ b/INSTALL
@@ -27,8 +27,8 @@
3. `make'
This command compiles the non-template part of LEMON into libemon.a
- file. It also compiles the programs in the tools and demo subdirectories
- when enabled.
+ file. It also compiles the programs in the tools subdirectory by
+ default.
4. `make check'
@@ -75,14 +75,6 @@
Set the installation prefix to PREFIX. By default it is /usr/local.
---enable-demo
-
- Build the examples in the demo subdirectory.
-
---disable-demo
-
- Do not build the examples in the demo subdirectory (default).
-
--enable-tools
Build the programs in the tools subdirectory (default).
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,9 +39,13 @@
include lemon/Makefile.am
include test/Makefile.am
include doc/Makefile.am
-include demo/Makefile.am
include tools/Makefile.am
+DIST_SUBDIRS = demo
+
+demo:
+ $(MAKE) $(AM_MAKEFLAGS) -C demo
+
MRPROPERFILES = \
aclocal.m4 \
config.h.in \
@@ -68,4 +72,4 @@
zcat $(PACKAGE)-$(VERSION).tar.gz | \
bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
-.PHONY: mrproper dist-bz2 distcheck-bz2
+.PHONY: demo mrproper dist-bz2 distcheck-bz2
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -64,19 +64,6 @@
AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
-dnl Disable/enable building the demo programs.
-AC_ARG_ENABLE([demo],
-AS_HELP_STRING([--enable-demo], [build the demo programs])
-AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
- [], [enable_demo=no])
-AC_MSG_CHECKING([whether to build the demo programs])
-if test x"$enable_demo" != x"no"; then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
-
dnl Disable/enable building the binary tools.
AC_ARG_ENABLE([tools],
AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
@@ -110,6 +97,7 @@
AC_CONFIG_FILES([
Makefile
+demo/Makefile
cmake/version.cmake
doc/Doxyfile
lemon/lemon.pc
@@ -132,7 +120,6 @@
echo SOPLEX support................ : $lx_soplex_found
echo CLP support................... : $lx_clp_found
echo
-echo Build demo programs........... : $enable_demo
echo Build additional tools........ : $enable_tools
echo
echo The packace will be installed in
diff --git a/demo/Makefile.am b/demo/Makefile.am
--- a/demo/Makefile.am
+++ b/demo/Makefile.am
@@ -1,16 +1,17 @@
-EXTRA_DIST += \
- demo/CMakeLists.txt \
- demo/digraph.lgf
+AM_CXXFLAGS = $(WARNINGCXXFLAGS)
-if WANT_DEMO
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
+LDADD = $(top_builddir)/lemon/libemon.la
-noinst_PROGRAMS += \
- demo/arg_parser_demo \
- demo/graph_to_eps_demo \
- demo/lgf_demo
+EXTRA_DIST = \
+ CMakeLists.txt \
+ digraph.lgf
-endif WANT_DEMO
+noinst_PROGRAMS = \
+ arg_parser_demo \
+ graph_to_eps_demo \
+ lgf_demo
-demo_arg_parser_demo_SOURCES = demo/arg_parser_demo.cc
-demo_graph_to_eps_demo_SOURCES = demo/graph_to_eps_demo.cc
-demo_lgf_demo_SOURCES = demo/lgf_demo.cc
+arg_parser_demo_SOURCES = arg_parser_demo.cc
+graph_to_eps_demo_SOURCES = graph_to_eps_demo.cc
+lgf_demo_SOURCES = lgf_demo.cc
diff --git a/doc/groups.dox b/doc/groups.dox
--- a/doc/groups.dox
+++ b/doc/groups.dox
@@ -671,8 +671,8 @@
Some demo programs are listed here. Their full source codes can be found in
the \c demo subdirectory of the source tree.
-It order to compile them, use --enable-demo configure option when
-build the library.
+In order to compile them, use the make demo or the
+make check commands.
*/
/**
diff --git a/scripts/mk-release.sh b/scripts/mk-release.sh
--- a/scripts/mk-release.sh
+++ b/scripts/mk-release.sh
@@ -14,7 +14,7 @@
echo '*****************************************************************'
autoreconf -vif
-./configure --enable-demo
+./configure
make
make html
diff --git a/test/Makefile.am b/test/Makefile.am
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -37,6 +37,8 @@
test/time_measure_test \
test/unionfind_test
+test_test_tools_pass_DEPENDENCIES = demo
+
if HAVE_LP
check_PROGRAMS += test/lp_test
endif HAVE_LP