* tests/tests.mk (AM_CPPFLAGS): Move general flags...
* common.mk (AM_CPPFLAGS): ...here.
Include it...
* doc/Makefile.am: ...here, to factor common parts.
* milena/apps/apps.mk: New file.
Include it...
* apps/constrained-connectivity/Makefile.am,
* apps/generic-skel/Makefile.am,
* apps/graph-morpho/Makefile.am,
* apps/morphers/Makefile.am,
* apps/papers/levillain.09.ismm/Makefile.am:
...here, to factor common parts.
* apps/mesh-segm-skel/Makefile.am: Likewise.
(noinst_HEADERS): Add save_bin_alt.hh.
(mesh_complex_skel_SOURCES)
(mesh_complex_max_curv_skel_SOURCES)
(mesh_complex_pinv_curv_skel_SOURCES):
Remove.
* tools/tools.mk: Remove this file and move its contents...
* tools/Makefile.am: ...here.
---
milena/ChangeLog | 25 ++++++++++++++++++++++
milena/{tests/tests.mk => apps/apps.mk} | 15 ++++++-------
milena/apps/constrained-connectivity/Makefile.am | 9 +-------
milena/apps/generic-skel/Makefile.am | 9 +-------
milena/apps/graph-morpho/Makefile.am | 9 +-------
milena/apps/mesh-segm-skel/Makefile.am | 16 +++-----------
milena/apps/morphers/Makefile.am | 9 +-------
milena/apps/papers/levillain.09.ismm/Makefile.am | 9 +-------
milena/common.mk | 5 ++++-
milena/doc/Makefile.am | 3 +--
milena/tests/tests.mk | 2 --
milena/tools/Makefile.am | 5 ++++-
milena/tools/tools.mk | 23 --------------------
13 files changed, 48 insertions(+), 91 deletions(-)
copy milena/{tests/tests.mk => apps/apps.mk} (72%)
delete mode 100644 milena/tools/tools.mk
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f9b9cec..7e3593b 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,28 @@
+2013-09-13 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Milena: Factor Makefiles a bit more using file inclusion.
+
+ * tests/tests.mk (AM_CPPFLAGS): Move general flags...
+ * common.mk (AM_CPPFLAGS): ...here.
+ Include it...
+ * doc/Makefile.am: ...here, to factor common parts.
+ * milena/apps/apps.mk: New file.
+ Include it...
+ * apps/constrained-connectivity/Makefile.am,
+ * apps/generic-skel/Makefile.am,
+ * apps/graph-morpho/Makefile.am,
+ * apps/morphers/Makefile.am,
+ * apps/papers/levillain.09.ismm/Makefile.am:
+ ...here, to factor common parts.
+ * apps/mesh-segm-skel/Makefile.am: Likewise.
+ (noinst_HEADERS): Add save_bin_alt.hh.
+ (mesh_complex_skel_SOURCES)
+ (mesh_complex_max_curv_skel_SOURCES)
+ (mesh_complex_pinv_curv_skel_SOURCES):
+ Remove.
+ * tools/tools.mk: Remove this file and move its contents...
+ * tools/Makefile.am: ...here.
+
2013-09-12 Roland Levillain <roland(a)lrde.epita.fr>
Milena: Remove `return 0;' statements at end of main().
diff --git a/milena/tests/tests.mk b/milena/apps/apps.mk
similarity index 72%
copy from milena/tests/tests.mk
copy to milena/apps/apps.mk
index dc6e80d..22a4e6c 100644
--- a/milena/tests/tests.mk
+++ b/milena/apps/apps.mk
@@ -1,9 +1,8 @@
-## tests.mk -*- Makefile-Automake -*-
+## apps.mk -*- Makefile-Automake -*-
-## Shared configuration for tests.
+## Shared configuration for apps.
-## Copyright (C) 2007, 2008, 2009, 2010, 2013 EPITA Research and Development
-## Laboratory (LRDE)
+## Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
##
## This file is part of Olena.
##
@@ -21,12 +20,10 @@
include $(top_srcdir)/milena/common.mk
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find test/data.hh (generated header).
+# Find apps/data.hh (generated header).
AM_CPPFLAGS += -I$(top_builddir)/milena
-
-AM_CXXFLAGS = $(TESTS_CXXFLAGS)
+# Produce fast code.
+AM_CXXFLAGS = $(APPS_CXXFLAGS)
# Inject rules to compile tests (recursively), without running them.
include $(top_srcdir)/build-aux/tests-recursive.mk
diff --git a/milena/apps/constrained-connectivity/Makefile.am
b/milena/apps/constrained-connectivity/Makefile.am
index 0ccb4c9..20d1619 100644
--- a/milena/apps/constrained-connectivity/Makefile.am
+++ b/milena/apps/constrained-connectivity/Makefile.am
@@ -15,14 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
noinst_PROGRAMS = constrained-connectivity
constrained_connectivity_CXXFLAGS = $(AM_CXXFLAGS) $(STRICT_ALIASING_CXXFLAGS)
diff --git a/milena/apps/generic-skel/Makefile.am b/milena/apps/generic-skel/Makefile.am
index 7736788..3e2743a 100644
--- a/milena/apps/generic-skel/Makefile.am
+++ b/milena/apps/generic-skel/Makefile.am
@@ -14,14 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
generated_checked_tests =
generated_tests = $(generated_checked_tests)
diff --git a/milena/apps/graph-morpho/Makefile.am b/milena/apps/graph-morpho/Makefile.am
index bc725aa..91a5076 100644
--- a/milena/apps/graph-morpho/Makefile.am
+++ b/milena/apps/graph-morpho/Makefile.am
@@ -15,14 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
noinst_HEADERS = convert.hh debug.hh make.hh morpho.hh make_complex2d.hh
diff --git a/milena/apps/mesh-segm-skel/Makefile.am
b/milena/apps/mesh-segm-skel/Makefile.am
index 7c58008..72f610a 100644
--- a/milena/apps/mesh-segm-skel/Makefile.am
+++ b/milena/apps/mesh-segm-skel/Makefile.am
@@ -15,14 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
noinst_PROGRAMS =
generated_checked_tests =
@@ -170,9 +163,10 @@ MOSTLYCLEANFILES += \
## More complex skeletonization chains.
## ------------------------------------
+noinst_HEADERS += save_bin_alt.hh
+
# Skeletonization program working on precomputed meshes with curvatures data.
noinst_PROGRAMS += mesh-complex-skel
-mesh_complex_skel_SOURCES = mesh-complex-skel.cc save_bin_alt.hh
TESTS += test-mesh-complex-skel
MOSTLYCLEANFILES += \
socket-max-curv-skel.off \
@@ -181,8 +175,6 @@ MOSTLYCLEANFILES += \
bunny-holefilled-pinv-curv-skel.off
noinst_PROGRAMS += mesh-complex-max-curv-skel
-mesh_complex_max_curv_skel_SOURCES = \
- mesh-complex-max-curv-skel.cc save_bin_alt.hh
TESTS += test-mesh-complex-max-curv-skel
MOSTLYCLEANFILES += \
socket-complex-max-curv-skel.off \
@@ -190,8 +182,6 @@ MOSTLYCLEANFILES += \
bunny-holefilled-complex-max-curv-skel.off
noinst_PROGRAMS += mesh-complex-pinv-curv-skel
-mesh_complex_pinv_curv_skel_SOURCES = \
- mesh-complex-pinv-curv-skel.cc save_bin_alt.hh
TESTS += test-mesh-complex-pinv-curv-skel
MOSTLYCLEANFILES += \
socket-complex-pinv-curv-skel.off \
diff --git a/milena/apps/morphers/Makefile.am b/milena/apps/morphers/Makefile.am
index 989ee59..bdff9c1 100644
--- a/milena/apps/morphers/Makefile.am
+++ b/milena/apps/morphers/Makefile.am
@@ -17,14 +17,7 @@
# Illustrations of morphers.
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
noinst_PROGRAMS = \
mask+channel \
diff --git a/milena/apps/papers/levillain.09.ismm/Makefile.am
b/milena/apps/papers/levillain.09.ismm/Makefile.am
index db9ce42..db94f24 100644
--- a/milena/apps/papers/levillain.09.ismm/Makefile.am
+++ b/milena/apps/papers/levillain.09.ismm/Makefile.am
@@ -17,14 +17,7 @@
# Illustrations from the ISMM 2009 paper and presentation (slides).
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-# Find apps/data.hh (generated header).
-AM_CPPFLAGS += -I$(top_builddir)/milena
-# Produce fast code.
-AM_CXXFLAGS = $(APPS_CXXFLAGS)
+include $(top_srcdir)/milena/apps/apps.mk
noinst_HEADERS = chain.hh io.hh influence_zones.hh
diff --git a/milena/common.mk b/milena/common.mk
index 3623290..0cb8c07 100644
--- a/milena/common.mk
+++ b/milena/common.mk
@@ -2,7 +2,7 @@
## Common Automake parameters.
-## Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE).
+## Copyright (C) 2010, 2013 EPITA Research and Development Laboratory (LRDE).
##
## This file is part of Olena.
##
@@ -20,3 +20,6 @@
# C++ sources.
AM_DEFAULT_SOURCE_EXT = .cc
+
+# Find Milena headers.
+AM_CPPFLAGS = -I$(top_srcdir)/milena
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index f0532a2..fbb6d5f 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -15,9 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+include $(top_srcdir)/milena/common.mk
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
# Find tests/data.hh and doc/tools/data.hh (generated headers).
AM_CPPFLAGS += -I$(top_builddir)/milena
diff --git a/milena/tests/tests.mk b/milena/tests/tests.mk
index dc6e80d..bfff07a 100644
--- a/milena/tests/tests.mk
+++ b/milena/tests/tests.mk
@@ -21,8 +21,6 @@
include $(top_srcdir)/milena/common.mk
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
# Find test/data.hh (generated header).
AM_CPPFLAGS += -I$(top_builddir)/milena
diff --git a/milena/tools/Makefile.am b/milena/tools/Makefile.am
index 0cbe661..bb7a35f 100644
--- a/milena/tools/Makefile.am
+++ b/milena/tools/Makefile.am
@@ -15,7 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/milena/tools/tools.mk
+include $(top_srcdir)/milena/common.mk
+
+# Produce fast code.
+AM_CXXFLAGS = $(TOOLS_CXXFLAGS)
# FIXME: Add some tests for these tools.
bin_PROGRAMS = \
diff --git a/milena/tools/tools.mk b/milena/tools/tools.mk
deleted file mode 100644
index a60f4d0..0000000
--- a/milena/tools/tools.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development
-# Laboratory (LRDE)
-#
-# This file is part of Olena.
-#
-# Olena is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, version 2 of the License.
-#
-# Olena is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/milena/common.mk
-
-# Find Milena headers.
-AM_CPPFLAGS = -I$(top_srcdir)/milena
-
-AM_CXXFLAGS = $(TOOLS_CXXFLAGS)
--
1.7.10.4