* doc/gen-examples-outputs-mk: New script.
* doc/examples/make.mk (PROGRAMS_examples):
Sort and remove duplicates.
(examples_dir): Remove variable.
(accu_right_instanciation_SOURCES)
(borderthickness_SOURCES)
(box2d_bbox_SOURCES)
(domain_display_SOURCES)
(dpoint_1_SOURCES)
(estim_sites_SOURCES)
(extend_SOURCES)
(extension_ignore_SOURCES)
(fill_SOURCES)
(fill_call_1_SOURCES)
(fill_imageif_cfun_SOURCES)
(fill_part_image_SOURCES)
(fill_subdomain_SOURCES)
(fill_subdomain_shorter_SOURCES)
(first_routine_SOURCES)
(forall_piter_SOURCES)
(fun_p2v_1_SOURCES)
(graph_data_SOURCES)
(graph_iter_SOURCES)
(ima2d_1_SOURCES)
(ima2d_2_SOURCES)
(ima2d_3_SOURCES)
(ima2d_4_SOURCES)
(ima2d_5_SOURCES)
(ima2d_6_clone_SOURCES)
(ima2d_7_SOURCES)
(ima2d_rot_SOURCES)
(ima_has_SOURCES)
(ima_save_SOURCES)
(ima_size_SOURCES)
(labeling_compute_SOURCES)
(logical_not_SOURCES)
(mln_var_SOURCES)
(parray_append_SOURCES)
(parray_bbox_SOURCES)
(paste_SOURCES)
(paste_call_1_SOURCES)
(point_1_SOURCES)
(predicate_1_SOURCES)
(win_create_1_SOURCES)
(win_create_2_SOURCES)
(tuto2_first_image_SOURCES)
(tuto3_rw_image_SOURCES)
(tuto4_genericity_and_algorithms_SOURCES)
(tuto3_colorize_SOURCES)
(tuto3_println_SOURCES)
(tuto3_trace_SOURCES)
(tuto4_point2d_SOURCES)
(tuto4_site_set_create_SOURCES):
Adjust.
(data-regen, examples, run-examples)
Remove (phony) targets.
(split-examples, split-outputs):
Likewise.
Superseded by...
($(srcdir)/split-examples.stamp, $(srcdir)/split-outputs.stamp):
...these (new) targets.
(OUTPUTS, EXAMPLES): New variable.
($(DOC_SRCDIR)/examples-outputs.mk): New target.
Include $(DOC_SRCDIR)/examples-outputs.mk.
(MAINTAINERCLEANFILES): Ad $(OUTPUTS).
(diff-data, fix-refdata): Remove these (phony) targets, as they
duplicate services provided by the SCM (Git).
(clean-local, clean-figures): Remove these targets and add their
actions...
* doc/Makefile.am (maintainer-clean-local): ...to this rule.
(EXTRA_DEPS): Remove variable.
Superseded by...
(refman_dependencies): ...this (new) variable.
($(srcdir)/user-refman.stamp)
($(srcdir)/devel-refman.stamp):
Adjust targets' dependencies.
(fig-convert): Remove (phony) target.
Clean up.
* milena/doc/examples-outputs.mk: New (generated file).
---
milena/ChangeLog | 84 ++++
milena/doc/Makefile.am | 61 ++--
milena/doc/examples-outputs.mk | 296 ++++++++++++++
milena/doc/examples/make.mk | 430 +++++++++++---------
.../Makefile.am => doc/gen-examples-outputs-mk} | 29 +-
5 files changed, 677 insertions(+), 223 deletions(-)
create mode 100644 milena/doc/examples-outputs.mk
copy milena/{tests/morpho/reconstruction/by_dilation/Makefile.am =>
doc/gen-examples-outputs-mk} (60%)
mode change 100644 => 100755
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 39f43ac..6c8a1fe 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,89 @@
2010-03-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Revamp the Makefile machinery in milena/doc/examples/.
+
+ * doc/gen-examples-outputs-mk: New script.
+ * doc/examples/make.mk (PROGRAMS_examples):
+ Sort and remove duplicates.
+ (examples_dir): Remove variable.
+ (accu_right_instanciation_SOURCES)
+ (borderthickness_SOURCES)
+ (box2d_bbox_SOURCES)
+ (domain_display_SOURCES)
+ (dpoint_1_SOURCES)
+ (estim_sites_SOURCES)
+ (extend_SOURCES)
+ (extension_ignore_SOURCES)
+ (fill_SOURCES)
+ (fill_call_1_SOURCES)
+ (fill_imageif_cfun_SOURCES)
+ (fill_part_image_SOURCES)
+ (fill_subdomain_SOURCES)
+ (fill_subdomain_shorter_SOURCES)
+ (first_routine_SOURCES)
+ (forall_piter_SOURCES)
+ (fun_p2v_1_SOURCES)
+ (graph_data_SOURCES)
+ (graph_iter_SOURCES)
+ (ima2d_1_SOURCES)
+ (ima2d_2_SOURCES)
+ (ima2d_3_SOURCES)
+ (ima2d_4_SOURCES)
+ (ima2d_5_SOURCES)
+ (ima2d_6_clone_SOURCES)
+ (ima2d_7_SOURCES)
+ (ima2d_rot_SOURCES)
+ (ima_has_SOURCES)
+ (ima_save_SOURCES)
+ (ima_size_SOURCES)
+ (labeling_compute_SOURCES)
+ (logical_not_SOURCES)
+ (mln_var_SOURCES)
+ (parray_append_SOURCES)
+ (parray_bbox_SOURCES)
+ (paste_SOURCES)
+ (paste_call_1_SOURCES)
+ (point_1_SOURCES)
+ (predicate_1_SOURCES)
+ (win_create_1_SOURCES)
+ (win_create_2_SOURCES)
+ (tuto2_first_image_SOURCES)
+ (tuto3_rw_image_SOURCES)
+ (tuto4_genericity_and_algorithms_SOURCES)
+ (tuto3_colorize_SOURCES)
+ (tuto3_println_SOURCES)
+ (tuto3_trace_SOURCES)
+ (tuto4_point2d_SOURCES)
+ (tuto4_site_set_create_SOURCES):
+ Adjust.
+ (data-regen, examples, run-examples)
+ Remove (phony) targets.
+ (split-examples, split-outputs):
+ Likewise.
+ Superseded by...
+ ($(srcdir)/split-examples.stamp, $(srcdir)/split-outputs.stamp):
+ ...these (new) targets.
+ (OUTPUTS, EXAMPLES): New variable.
+ ($(DOC_SRCDIR)/examples-outputs.mk): New target.
+ Include $(DOC_SRCDIR)/examples-outputs.mk.
+ (MAINTAINERCLEANFILES): Ad $(OUTPUTS).
+ (diff-data, fix-refdata): Remove these (phony) targets, as they
+ duplicate services provided by the SCM (Git).
+ (clean-local, clean-figures): Remove these targets and add their
+ actions...
+ * doc/Makefile.am (maintainer-clean-local): ...to this rule.
+ (EXTRA_DEPS): Remove variable.
+ Superseded by...
+ (refman_dependencies): ...this (new) variable.
+ ($(srcdir)/user-refman.stamp)
+ ($(srcdir)/devel-refman.stamp):
+ Adjust targets' dependencies.
+ (fig-convert): Remove (phony) target.
+ Clean up.
+ * milena/doc/examples-outputs.mk: New (generated file).
+
+2010-03-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Have documentation's examples not depend on hard-coded paths.
* doc/tools/data.hh.in: New file.
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index 49cf5a5..0018406 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -18,6 +18,9 @@
# FIXME: To be overhauled! (See ticket #134).
+# FIXME: Do not use includes if they're used only once: inline them
+# instead.
+
include $(top_srcdir)/milena/doc/doc.mk
DOXYGEN = doxygen
@@ -28,6 +31,7 @@ DOXYFILE = Doxyfile
EXTRA_DIST =
dist_doc_DATA =
CLEANFILES =
+MAINTAINERCLEANFILES =
# FIXME: Simplify all of this. ``Devel'' targets are really
# secondary. And we probably don't need so much target aliases!
@@ -53,18 +57,21 @@ doc-devel-html: tutorial-html ref-guide-html white-paper-html \
ref-doc-devel
-## -------------------------------------------------- ##
-## Shared dependencies on the products of tutorial/. ##
-## -------------------------------------------------- ##
-
-# FIXME: Maintaining dependencies across directories is too
-# complicated. Simplify.
-EXTRA_DEPS = $(srcdir)/tutorial/tutorial.hh $(srcdir)/ref_guide/ref_guide.hh
-
## ----------------------- ##
## Doxygen documentation. ##
## ----------------------- ##
+# FIXME: Check these dependencies.
+# 1. They might be redundant.
+# 2. It'd be better to depend on actual files rather than timestamps
+# correponding to a bunch of files.
+refman_dependencies = \
+ $(srcdir)/split-examples.stamp \
+ $(srcdir)/split-outputs.stamp \
+ $(srcdir)/figures.stamp \
+ $(srcdir)/tutorial/tutorial.hh \
+ $(srcdir)/ref_guide/ref_guide.hh
+
# ----------------------- #
# User reference manual. #
# ----------------------- #
@@ -113,11 +120,11 @@ $(srcdir)/$(USER_REFMAN_PDF): $(srcdir)/$(USER_REFMAN)
cd $(srcdir)/$(USER_REFMAN)/latex && $(MAKE) $(AM_MAKEFLAGS) pdf
cp -f $(srcdir)/$(USER_REFMAN)/latex/refman.pdf $@
-## FIXME: Are dependencies $(srcdir)/figures.stamp $(EXTRA_DEPS) set
-## on the right rule? Does Doxygen make a copy of figures, or does it
-## generate LaTeX inputs relying on the existence of such figures in
-## the initial location? Investigate.
-$(srcdir)/user-refman.stamp: $(srcdir)/$(DOXYFILE).in $(srcdir)/figures.stamp
$(EXTRA_DEPS)
+## FIXME: Are dependencies (`$(refman_dependencies)') set on the right
+## rule? Does Doxygen make a copy of figures, or does it generate
+## LaTeX inputs relying on the existence of such figures in the
+## initial location? Investigate.
+$(srcdir)/user-refman.stamp: $(srcdir)/$(DOXYFILE).in $(refman_dependencies)
@rm -f $@.tmp
@touch $@.tmp
-rm -rf $(USER_REFMAN).tmp
@@ -193,11 +200,11 @@ $(srcdir)/$(DEVEL_REFMAN_PDF): $(srcdir)/$(DEVEL_REFMAN)
cd $(srcdir)/$(DEVEL_REFMAN)/latex && $(MAKE) $(AM_MAKEFLAGS) pdf
cp -f $(srcdir)/$(DEVEL_REFMAN)/latex/refman.pdf $@
-## FIXME: Are dependencies $(srcdir)/figures.stamp $(EXTRA_DEPS) set
-## on the right rule? Does Doxygen make a copy of figures, or does it
-## generate LaTeX inputs relying on the existence of such figures in
-## the initial location? Investigate.
-$(srcdir)/devel-refman.stamp: $(srcdir)/$(DOXYFILE).in $(srcdir)/figures.stamp
$(EXTRA_DEPS)
+## FIXME: Are dependencies (`$(refman_dependencies)') set on the right
+## rule? Does Doxygen make a copy of figures, or does it generate
+## LaTeX inputs relying on the existence of such figures in the
+## initial location? Investigate.
+$(srcdir)/devel-refman.stamp: $(srcdir)/$(DOXYFILE).in $(refman_dependencies)
@rm -f $@.tmp
@touch $@.tmp
-rm -rf $(DEVEL_REFMAN).tmp
@@ -223,6 +230,12 @@ $(srcdir)/$(DEVEL_REFMAN): $(srcdir)/devel-refman.stamp
maintainer-clean-local:
-rm -rf $(USER_REFMAN).tmp $(srcdir)/$(USER_REFMAN)
-rm -rf $(DEVEL_REFMAN).tmp $(srcdir)/$(DEVEL_REFMAN)
+ -rm -f $(EXAMPLES_BUILDDIR)/*.cc
+# FIXME: If we remove a *directory*, we are supposed to know how to
+# recreate it later. I doubt our rules are all currently able to
+# handle this. See how `make maintainer-clean all' behaves.
+ -rm -rf $(OUTPUTS_BUILDDIR)
+ -rm -rf $(FIGURES_BUILDDIR)
## ------------------------- ##
@@ -257,15 +270,9 @@ include $(srcdir)/ref_guide/ref_guide.mk
## Figures. ##
## --------- ##
-# Make sure the figures are the first files in EXTRA_DIST.
-# Make the 'fake-doc' rule works correctly.
-EXTRA_DIST +=
$(srcdir)/figures/figures.mk: $(srcdir)/headers.stamp
include $(srcdir)/figures/figures.mk
-
-fig-convert: $(srcdir)/figures.stamp
-
EXTRA_DIST += figures.stamp
$(srcdir)/figures.stamp: $(FIGURES_SRCDIR)/*.p*m
rm -f $@.tmp
@@ -288,9 +295,11 @@ $(srcdir)/figures.stamp: $(FIGURES_SRCDIR)/*.p*m
include $(top_srcdir)/milena/doc/examples/make.mk
-# Regen files.
+# Regen Make helpers.
EXTRA_DIST += generate_dist_files.sh headers.stamp
include $(top_srcdir)/build-aux/regen-recursive.mk
+## FIXME: It'd probably be better to separate the rules generating
+## examples/examples.mk, outputs/outputs.mk and figures/figures.mk.
regen-am:
@rm -f $(srcdir)/headers.stamp.tmp
@touch $(srcdir)/headers.stamp.tmp
@@ -369,6 +378,6 @@ EXTRA_DIST += \
tools/split_sample.sh \
tools/todoxygen.sh
-MAINTAINERCLEANFILES = \
+MAINTAINERCLEANFILES += \
Doxyfile_user \
Doxyfile_devel
diff --git a/milena/doc/examples-outputs.mk b/milena/doc/examples-outputs.mk
new file mode 100644
index 0000000..6fdb543
--- /dev/null
+++ b/milena/doc/examples-outputs.mk
@@ -0,0 +1,296 @@
+## Generated by gen-examples-outputs-mk. Do not edit by hand.
+
+$(srcdir)/outputs/accu-right-instanciation.txt: accu-right-instanciation$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/borderthickness.txt: borderthickness$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/box2d-bbox.txt: box2d-bbox$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/domain-display.txt: domain-display$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/dpoint-1.txt: dpoint-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/estim-sites.txt: estim-sites$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/extend.txt: extend$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/extension-ignore.txt: extension-ignore$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill.txt: fill$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill-call-1.txt: fill-call-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill-imageif-cfun.txt: fill-imageif-cfun$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill-part-image.txt: fill-part-image$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill-subdomain.txt: fill-subdomain$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fill-subdomain-shorter.txt: fill-subdomain-shorter$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/first_routine.txt: first_routine$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/forall-piter.txt: forall-piter$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/fun-p2v-1.txt: fun-p2v-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/graph-data.txt: graph-data$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/graph-iter.txt: graph-iter$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima-has.txt: ima-has$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima-save.txt: ima-save$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima-size.txt: ima-size$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-1.txt: ima2d-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-2.txt: ima2d-2$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-3.txt: ima2d-3$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-4.txt: ima2d-4$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-5.txt: ima2d-5$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-6-clone.txt: ima2d-6-clone$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-7.txt: ima2d-7$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/ima2d-rot.txt: ima2d-rot$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/labeling-compute.txt: labeling-compute$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/logical-not.txt: logical-not$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/mln_var.txt: mln_var$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/parray-append.txt: parray-append$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/parray-bbox.txt: parray-bbox$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/paste.txt: paste$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/paste-call-1.txt: paste-call-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/point-1.txt: point-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/predicate-1.txt: predicate-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/win-create-1.txt: win-create-1$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/win-create-2.txt: win-create-2$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto2_first_image.txt: tuto2_first_image$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto3_rw_image.txt: tuto3_rw_image$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto4_genericity_and_algorithms.txt:
tuto4_genericity_and_algorithms$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto3_colorize.txt: tuto3_colorize$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto3_println.txt: tuto3_println$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto3_trace.txt: tuto3_trace$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto4_point2d.txt: tuto4_point2d$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
+$(srcdir)/outputs/tuto4_site_set_create.txt: tuto4_site_set_create$(EXEEXT)
+ rm -f $@.tmp
+ ./$< >$@.tmp
+ cp -f $@.tmp $@
+ rm -f $@.tmp
+
diff --git a/milena/doc/examples/make.mk b/milena/doc/examples/make.mk
index d83a742..91f21cb 100644
--- a/milena/doc/examples/make.mk
+++ b/milena/doc/examples/make.mk
@@ -15,13 +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/>.
-#
-
-## Process this file through Automake to create Makefile.in.
-examples_dir = $(doc_dir)/examples
-
-PROGRAMS_examples = \
+PROGRAMS_examples = \
accu-right-instanciation \
borderthickness \
box2d-bbox \
@@ -32,10 +27,10 @@ PROGRAMS_examples = \
extension-ignore \
fill \
fill-call-1 \
+ fill-imageif-cfun \
fill-part-image \
fill-subdomain \
fill-subdomain-shorter \
- fill-imageif-cfun \
first_routine \
forall-piter \
fun-p2v-1 \
@@ -52,14 +47,13 @@ PROGRAMS_examples = \
ima2d-6-clone \
ima2d-7 \
ima2d-rot \
- ima-size \
labeling-compute \
logical-not \
mln_var \
+ parray-append \
parray-bbox \
paste \
paste-call-1 \
- parray-append \
point-1 \
predicate-1 \
win-create-1 \
@@ -82,198 +76,262 @@ PROGRAMS_examples += \
tuto4_site_set_create
EXTRA_PROGRAMS = $(PROGRAMS_examples)
-
-# FIXME: Is this really needed?
CLEANFILES += $(PROGRAMS_examples)
-accu_right_instanciation_SOURCES = $(examples_dir)/accu-right-instanciation.cc
-borderthickness_SOURCES = $(examples_dir)/borderthickness.cc
-box2d_bbox_SOURCES = $(examples_dir)/box2d-bbox.cc
-domain_display_SOURCES = $(examples_dir)/domain-display.cc
-dpoint_1_SOURCES = $(examples_dir)/dpoint-1.cc
-estim_sites_SOURCES = $(examples_dir)/estim-sites.cc
-extend_SOURCES = $(examples_dir)/extend.cc
-extension_ignore_SOURCES = $(examples_dir)/extension-ignore.cc
-fill_SOURCES = $(examples_dir)/fill.cc
-fill_call_1_SOURCES = $(examples_dir)/fill-call-1.cc
-fill_part_image_SOURCES = $(examples_dir)/fill-part-image.cc
-fill_subdomain_SOURCES = $(examples_dir)/fill-subdomain.cc
-fill_subdomain_shorter_SOURCES = $(examples_dir)/fill-subdomain-shorter.cc
-fill_imageif_cfun_SOURCES = $(examples_dir)/fill-imageif-cfun.cc
-first_routine_SOURCES = $(examples_dir)/tuto3/first_routine.cc
-forall_piter_SOURCES = $(examples_dir)/forall-piter.cc
-fun_p2v_1_SOURCES = $(examples_dir)/fun-p2v-1.cc
-graph_data_SOURCES = $(examples_dir)/graph-data.cc
-graph_iter_SOURCES = $(examples_dir)/graph-iter.cc
-ima_has_SOURCES = $(examples_dir)/ima-has.cc
-ima_save_SOURCES = $(examples_dir)/ima-save.cc
-ima_size_SOURCES = $(examples_dir)/ima-size.cc
-ima2d_1_SOURCES = $(examples_dir)/ima2d-1.cc
-ima2d_2_SOURCES = $(examples_dir)/ima2d-2.cc
-ima2d_3_SOURCES = $(examples_dir)/ima2d-3.cc
-ima2d_4_SOURCES = $(examples_dir)/ima2d-4.cc
-ima2d_5_SOURCES = $(examples_dir)/ima2d-5.cc
-ima2d_6_clone_SOURCES = $(examples_dir)/ima2d-6-clone.cc
-ima2d_7_SOURCES = $(examples_dir)/ima2d-7.cc
-ima2d_rot_SOURCES = $(examples_dir)/ima2d-rot.cc
-labeling_compute_SOURCES = $(examples_dir)/labeling-compute.cc
-logical_not_SOURCES = $(examples_dir)/logical-not.cc
-mln_var_SOURCES = $(examples_dir)/mln_var.cc
-paste_SOURCES = $(examples_dir)/paste.cc
-paste_call_1_SOURCES = $(examples_dir)/paste-call-1.cc
-parray_append_SOURCES = $(examples_dir)/parray-append.cc
-parray_bbox_SOURCES = $(examples_dir)/parray-bbox.cc
-point_1_SOURCES = $(examples_dir)/point-1.cc
-predicate_1_SOURCES = $(examples_dir)/predicate-1.cc
-win_create_1_SOURCES = $(examples_dir)/win-create-1.cc
-win_create_2_SOURCES = $(examples_dir)/win-create-2.cc
+# FIXME: Careful, this will only work if this file is included by
+# `milena/doc/Makefile.am', since `examples/' is a subdirectory of
+# `milena/doc/'. Anyway, this file is to be eventually inlined in
+# `milena/doc/Makefile.am', so this is not a big deal.
+accu_right_instanciation_SOURCES = examples/accu-right-instanciation.cc
+borderthickness_SOURCES = examples/borderthickness.cc
+box2d_bbox_SOURCES = examples/box2d-bbox.cc
+domain_display_SOURCES = examples/domain-display.cc
+dpoint_1_SOURCES = examples/dpoint-1.cc
+estim_sites_SOURCES = examples/estim-sites.cc
+extend_SOURCES = examples/extend.cc
+extension_ignore_SOURCES = examples/extension-ignore.cc
+fill_SOURCES = examples/fill.cc
+fill_call_1_SOURCES = examples/fill-call-1.cc
+fill_imageif_cfun_SOURCES = examples/fill-imageif-cfun.cc
+fill_part_image_SOURCES = examples/fill-part-image.cc
+fill_subdomain_SOURCES = examples/fill-subdomain.cc
+fill_subdomain_shorter_SOURCES = examples/fill-subdomain-shorter.cc
+first_routine_SOURCES = examples/tuto3/first_routine.cc
+forall_piter_SOURCES = examples/forall-piter.cc
+fun_p2v_1_SOURCES = examples/fun-p2v-1.cc
+graph_data_SOURCES = examples/graph-data.cc
+graph_iter_SOURCES = examples/graph-iter.cc
+ima2d_1_SOURCES = examples/ima2d-1.cc
+ima2d_2_SOURCES = examples/ima2d-2.cc
+ima2d_3_SOURCES = examples/ima2d-3.cc
+ima2d_4_SOURCES = examples/ima2d-4.cc
+ima2d_5_SOURCES = examples/ima2d-5.cc
+ima2d_6_clone_SOURCES = examples/ima2d-6-clone.cc
+ima2d_7_SOURCES = examples/ima2d-7.cc
+ima2d_rot_SOURCES = examples/ima2d-rot.cc
+ima_has_SOURCES = examples/ima-has.cc
+ima_save_SOURCES = examples/ima-save.cc
+ima_size_SOURCES = examples/ima-size.cc
+labeling_compute_SOURCES = examples/labeling-compute.cc
+logical_not_SOURCES = examples/logical-not.cc
+mln_var_SOURCES = examples/mln_var.cc
+parray_append_SOURCES = examples/parray-append.cc
+parray_bbox_SOURCES = examples/parray-bbox.cc
+paste_SOURCES = examples/paste.cc
+paste_call_1_SOURCES = examples/paste-call-1.cc
+point_1_SOURCES = examples/point-1.cc
+predicate_1_SOURCES = examples/predicate-1.cc
+win_create_1_SOURCES = examples/win-create-1.cc
+win_create_2_SOURCES = examples/win-create-2.cc
-tuto2_first_image_SOURCES = $(examples_dir)/tuto2_first_image.cc
-tuto3_rw_image_SOURCES = $(examples_dir)/tuto3_rw_image.cc
-tuto4_genericity_and_algorithms_SOURCES =
$(examples_dir)/tuto4_genericity_and_algorithms.cc
+tuto2_first_image_SOURCES = examples/tuto2_first_image.cc
+tuto3_rw_image_SOURCES = examples/tuto3_rw_image.cc
+tuto4_genericity_and_algorithms_SOURCES = examples/tuto4_genericity_and_algorithms.cc
# Tuto 3
-tuto3_colorize_SOURCES = $(examples_dir)/tuto3/colorize.cc
-tuto3_println_SOURCES = $(examples_dir)/tuto3/println.cc
-tuto3_trace_SOURCES = $(examples_dir)/tuto3/trace.cc
+tuto3_colorize_SOURCES = examples/tuto3/colorize.cc
+tuto3_println_SOURCES = examples/tuto3/println.cc
+tuto3_trace_SOURCES = examples/tuto3/trace.cc
# Tuto 4
-tuto4_site_set_create_SOURCES = $(examples_dir)/tuto4/site_set_create.cc
-tuto4_point2d_SOURCES = $(examples_dir)/tuto4/point2d.cc
-
+tuto4_point2d_SOURCES = examples/tuto4/point2d.cc
+tuto4_site_set_create_SOURCES = examples/tuto4/site_set_create.cc
-.PHONY : examples run-examples diff-data fix-refdata \
- split-examples split-outputs
-examples: $(PROGRAMS_examples)
-
-run-examples: examples
- test -d $(top_builddir)/milena/doc/figures \
- || mkdir $(top_builddir)/milena/doc/figures; \
- failcom='exit 1'; \
- list='$(PROGRAMS_examples)'; for bin in $$list; do \
- echo "Running $$bin"; \
- ./$$bin > $(OUTPUTS_SRCDIR)/$$bin.txt || eval $$failcom; \
- done
+# FIXME: Try to avoid the use an extensive list: either use Make's
+# substitution rules or generate it. Actually this list is already
+# generated (see outputs/outputs.mk).
+OUTPUTS = \
+ $(srcdir)/outputs/accu-right-instanciation.txt \
+ $(srcdir)/outputs/borderthickness.txt \
+ $(srcdir)/outputs/box2d-bbox.txt \
+ $(srcdir)/outputs/domain-display.txt \
+ $(srcdir)/outputs/dpoint-1.txt \
+ $(srcdir)/outputs/estim-sites.txt \
+ $(srcdir)/outputs/extend.txt \
+ $(srcdir)/outputs/extension-ignore.txt \
+ $(srcdir)/outputs/fill-call-1.txt \
+ $(srcdir)/outputs/fill-imageif-cfun.txt \
+ $(srcdir)/outputs/fill-part-image.txt \
+ $(srcdir)/outputs/fill-subdomain-shorter.txt \
+ $(srcdir)/outputs/fill-subdomain.txt \
+ $(srcdir)/outputs/fill.txt \
+ $(srcdir)/outputs/first_routine.txt \
+ $(srcdir)/outputs/forall-piter.txt \
+ $(srcdir)/outputs/fun-p2v-1.txt \
+ $(srcdir)/outputs/graph-data.txt \
+ $(srcdir)/outputs/graph-iter.txt \
+ $(srcdir)/outputs/graph-output-1.txt \
+ $(srcdir)/outputs/ima2d-1.txt \
+ $(srcdir)/outputs/ima2d-2.txt \
+ $(srcdir)/outputs/ima2d-3.txt \
+ $(srcdir)/outputs/ima2d-4.txt \
+ $(srcdir)/outputs/ima2d-5.txt \
+ $(srcdir)/outputs/ima2d-6-clone.txt \
+ $(srcdir)/outputs/ima2d-7.txt \
+ $(srcdir)/outputs/ima2d-decl-2.txt \
+ $(srcdir)/outputs/ima2d-display-1.txt \
+ $(srcdir)/outputs/ima2d-display-2.txt \
+ $(srcdir)/outputs/ima2d-display-output-1.txt \
+ $(srcdir)/outputs/ima2d-display-output-2.txt \
+ $(srcdir)/outputs/ima2d-rot.txt \
+ $(srcdir)/outputs/ima-has.txt \
+ $(srcdir)/outputs/ima-save.txt \
+ $(srcdir)/outputs/ima-size.txt \
+ $(srcdir)/outputs/labeling-compute.txt \
+ $(srcdir)/outputs/logical-not.txt \
+ $(srcdir)/outputs/mln_var.txt \
+ $(srcdir)/outputs/parray-append.txt \
+ $(srcdir)/outputs/parray-bbox.txt \
+ $(srcdir)/outputs/parray-display-1.txt \
+ $(srcdir)/outputs/paste-call-1.txt \
+ $(srcdir)/outputs/paste.txt \
+ $(srcdir)/outputs/point-1.txt \
+ $(srcdir)/outputs/predicate-1.txt \
+ $(srcdir)/outputs/tuto2_first_image.txt \
+ $(srcdir)/outputs/tuto3_colorize.txt \
+ $(srcdir)/outputs/tuto3_println.txt \
+ $(srcdir)/outputs/tuto3_rw_image.txt \
+ $(srcdir)/outputs/tuto3_trace.txt \
+ $(srcdir)/outputs/tuto4_genericity_and_algorithms.txt \
+ $(srcdir)/outputs/tuto4_point2d.txt \
+ $(srcdir)/outputs/tuto4_site_set_create.txt \
+ $(srcdir)/outputs/win-create-1-display.txt \
+ $(srcdir)/outputs/win-create-1.txt \
+ $(srcdir)/outputs/win-create-2.txt
-## FIXME: This is wrong. Make is not an imperative language, and this
-## rule probably does not work as expected.
-data-regen: examples run-examples split-examples split-outputs diff-data
+## FIXME: Do not forget to turn the dependency
+## $(srcdir)/examples/make.mk into $(srcdir)/Makefile.am when the
+## former is merged into the latter.
+$(DOC_SRCDIR)/examples-outputs.mk: $(DOC_SRCDIR)/gen-examples-outputs-mk
$(srcdir)/examples/make.mk
+ $(DOC_SRCDIR)/gen-examples-outputs-mk $(PROGRAMS_examples) >$@.tmp
+ mv -f $@.tmp $@
+ chmod -w $@
+include $(DOC_SRCDIR)/examples-outputs.mk
+MAINTAINERCLEANFILES += $(OUTPUTS)
-diff-data: run-examples split-examples
- @failcom='exit 1'; \
- has_txt_diff=""; \
- txtlist="$(OUTPUTS_SRCDIR)/*.txt"; for txt in $$txtlist; do \
- echo "Diff `basename $$txt`"; \
- diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1 \
- || has_txt_diff="$$has_txt_diff `basename $$txt`"; \
- done; \
- has_fig_diff=""; \
- figlist="$(FIGURES_SRCDIR)/*.p*m"; for fig in $$figlist; do \
- echo "Diff `basename $$fig`"; \
- diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
- || has_fig_diff="$$has_fig_diff `basename $$fig`"; \
- done; \
- has_split_out_diff=""; \
- split_outlist="$(SPLIT_OUTPUTS_SRCDIR)/*"; for split_out in $$split_outlist;
do \
- echo "Diff `basename $$split_out`"; \
- diff $$split_out $(SPLIT_OUTPUTS_SRCDIR)/`basename $$split_out` >/dev/null
2>&1 \
- || has_split_out_diff="$$has_split_out_diff `basename $$split_out`"; \
- done; \
- has_split_ex_diff=""; \
- split_exlist="$(SPLIT_EXAMPLES_SRCDIR)/*"; for split_ex in $$split_exlist; do
\
- echo "Diff `basename $$split_ex`"; \
- diff $$split_ex $(SPLIT_EXAMPLES_SRCDIR)/`basename $$split_ex` >/dev/null
2>&1 \
- || has_split_ex_diff="$$has_split_ex_diff `basename $$split_ex`"; \
- done; \
- (test -z "$$has_txt_diff" && test -z "$$has_fig_diff"
&& \
- test -z "$$has_split_out_diff" && test -z
"$$has_split_ex_diff")\
- || (echo "--------"; \
- echo "ERROR: please check if the tutorial needs an update.";\
- echo " The following files differ from their \
-reference or their reference file does not exist:"; \
- echo "--------"; \
- echo "* Outputs:"; \
- echo ""; \
- echo "$$has_txt_diff"; \
- echo ""; \
- echo "--------"; \
- echo "* Figures:"; \
- echo ""; \
- echo "$$has_fig_diff"; \
- echo ""; \
- echo "--------"; \
- echo "* Split outputs:"; \
- echo ""; \
- echo "$$has_split_out_diff"; \
- echo ""; \
- echo "--------"; \
- echo "* Split examples:"; \
- echo ""; \
- echo "$$has_split_ex_diff"; \
- echo ""; \
- echo "--------"; \
- echo "* Please update manually the reference files located in:" \
- echo ""; \
- echo " $(OUTPUTS_SRCDIR)"; \
- echo " $(FIGURES_SRCDIR)"; \
- echo " $(SPLIT_EXAMPLES_SRCDIR)"; \
- echo " $(SPLIT_OUTPUTS_SRCDIR)"; \
- echo ""; \
- echo "* Reference files can updated automatically with 'make
fix-refdata'"; \
- echo ""; \
- echo ""; \
- eval $$failcom);
+# FIXME: Warning: $(SPLIT_EXAMPLES_SRCDIR) might not exist. Ensure it
+# exists.
+# FIXME: Try to avoid the use an extensive list: either use Make's
+# substitution rules or generate it.
+EXAMPLES = \
+ $(srcdir)/examples/ima-save.cc \
+ $(srcdir)/examples/accu-right-instanciation.cc \
+ $(srcdir)/examples/borderthickness.cc \
+ $(srcdir)/examples/box2d-bbox.cc \
+ $(srcdir)/examples/domain-display.cc \
+ $(srcdir)/examples/dpoint-1.cc \
+ $(srcdir)/examples/estim-sites.cc \
+ $(srcdir)/examples/extend.cc \
+ $(srcdir)/examples/extension-ignore.cc \
+ $(srcdir)/examples/fill-call-1.cc \
+ $(srcdir)/examples/fill-imageif-cfun.cc \
+ $(srcdir)/examples/fill-part-image.cc \
+ $(srcdir)/examples/fill-subdomain-shorter.cc \
+ $(srcdir)/examples/fill-subdomain.cc \
+ $(srcdir)/examples/fill.cc \
+ $(srcdir)/examples/forall-piter.cc \
+ $(srcdir)/examples/fun-p2v-1.cc \
+ $(srcdir)/examples/graph-data.cc \
+ $(srcdir)/examples/graph-iter.cc \
+ $(srcdir)/examples/ima-has.cc \
+ $(srcdir)/examples/ima-load.cc \
+ $(srcdir)/examples/ima-size.cc \
+ $(srcdir)/examples/ima2d-1.cc \
+ $(srcdir)/examples/ima2d-2.cc \
+ $(srcdir)/examples/ima2d-3.cc \
+ $(srcdir)/examples/ima2d-4.cc \
+ $(srcdir)/examples/ima2d-5.cc \
+ $(srcdir)/examples/ima2d-6-clone.cc \
+ $(srcdir)/examples/ima2d-7.cc \
+ $(srcdir)/examples/ima2d-rot.cc \
+ $(srcdir)/examples/labeling-compute.cc \
+ $(srcdir)/examples/logical-not.cc \
+ $(srcdir)/examples/mln_var.cc \
+ $(srcdir)/examples/parray-append.cc \
+ $(srcdir)/examples/parray-bbox.cc \
+ $(srcdir)/examples/paste-call-1.cc \
+ $(srcdir)/examples/paste.cc \
+ $(srcdir)/examples/point-1.cc \
+ $(srcdir)/examples/predicate-1.cc \
+ $(srcdir)/examples/trash/accu.cc \
+ $(srcdir)/examples/trash/box.cc \
+ $(srcdir)/examples/trash/cpp_issue.cc \
+ $(srcdir)/examples/trash/erosion.cc \
+ $(srcdir)/examples/trash/for_Z.cc \
+ $(srcdir)/examples/trash/graph.cc \
+ $(srcdir)/examples/trash/image2d.cc \
+ $(srcdir)/examples/trash/image_flat.cc \
+ $(srcdir)/examples/trash/image_if.cc \
+ $(srcdir)/examples/trash/image_plain.cc \
+ $(srcdir)/examples/trash/image_safe.cc \
+ $(srcdir)/examples/trash/labeling_algo.cc \
+ $(srcdir)/examples/trash/mk_graph.cc \
+ $(srcdir)/examples/trash/p_array.2.cc \
+ $(srcdir)/examples/trash/p_array.cc \
+ $(srcdir)/examples/trash/p_image.cc \
+ $(srcdir)/examples/trash/p_key.2.cc \
+ $(srcdir)/examples/trash/p_key.cc \
+ $(srcdir)/examples/trash/p_line2d.cc \
+ $(srcdir)/examples/trash/p_mutable_array_of.cc \
+ $(srcdir)/examples/trash/p_queue.cc \
+ $(srcdir)/examples/trash/p_run.cc \
+ $(srcdir)/examples/trash/p_vaccess.cc \
+ $(srcdir)/examples/trash/proxy.cc \
+ $(srcdir)/examples/trash/sub_image.cc \
+ $(srcdir)/examples/trash/sub_image_if.cc \
+ $(srcdir)/examples/trash/tuto_bis.cc \
+ $(srcdir)/examples/trash/tuto_one.cc \
+ $(srcdir)/examples/trash/vec.cc \
+ $(srcdir)/examples/trash/win_multiple.cc \
+ $(srcdir)/examples/trash/window.cc \
+ $(srcdir)/examples/tuto2_first_image.cc \
+ $(srcdir)/examples/tuto3/colorize.cc \
+ $(srcdir)/examples/tuto3/first_routine.cc \
+ $(srcdir)/examples/tuto3/println.cc \
+ $(srcdir)/examples/tuto3/trace.cc \
+ $(srcdir)/examples/tuto3_rw_image.cc \
+ $(srcdir)/examples/tuto4/image.cc \
+ $(srcdir)/examples/tuto4/point2d.cc \
+ $(srcdir)/examples/tuto4/site_set_create.cc \
+ $(srcdir)/examples/tuto4_genericity_and_algorithms.cc \
+ $(srcdir)/examples/win-create-1.cc \
+ $(srcdir)/examples/win-create-2.cc
-fix-refdata:
- @failcom='exit 1'; \
- txtlist="$(OUTPUTS_SRCDIR)/*.txt"; for txt in $$txtlist; do \
- diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1 \
- || echo "Updating reference file for $$txt"; \
- cp $$txt $(OUTPUTS_SRCDIR); \
- done; \
- figlist="$(FIGURES_SRCDIR)/*.p*m"; for fig in $$figlist; do \
- diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
- || echo "Updating reference file for $$fig"; \
- cp $$fig $(FIGURES_SRCDIR); \
- done; \
- split_outlist="$(SPLIT_OUTPUTS_SRCDIR)/*.txt"; for split_out in
$$split_outlist; do \
- diff $$split_out $(SPLIT_OUTPUTS_SRCDIR)/`basename $$split_out` >/dev/null
2>&1 \
- || echo "Updating reference file for $$split_out"; \
- cp $$split_out $(SPLIT_OUTPUTS_SRCDIR); \
- done; \
- split_exlist="$(SPLIT_EXAMPLES_SRCDIR)/*.cc"; for split_ex in $$split_exlist;
do \
- diff $$split_ex $(SPLIT_EXAMPLES_SRCDIR)/`basename $$split_ex` >/dev/null
2>&1 \
- || echo "Updating reference file for $$split_ex"; \
- cp $$split_ex $(SPLIT_EXAMPLES_SRCDIR); \
- done;
+# FIXME: Place split files in their own directory, e.g.: split
+# `examples/foo.cc' into `examples/split/foo.dir/foo-1.cc',
+# `examples/split/foo.dir/foo-2.cc', etc. It makes removal of these
+# files easier. We probably also nee a stamp file to keep track of
+# dependencies.
-
-split-examples:
- test -d $(SPLIT_EXAMPLES_SRCDIR) || mkdir $(SPLIT_EXAMPLES_SRCDIR)
- @failcom='exit 1'; \
- list=`find $(EXAMPLES_SRCDIR) -type f -name '*.cc'`; for file in $$list; do \
- $(DOC_SRCDIR)/tools/split_sample.sh $$file cc raw $(SPLIT_EXAMPLES_SRCDIR)\
- || eval $$failcom; \
+# FIXME: Loops are bad, as they prevent parallelism. And we prefer
+# data-driven actions anyway. This would imply that we know in
+# advance the list out outputs (here, split examples). Maybe we can
+# infer it from the LaTeX document.
+$(srcdir)/split-examples.stamp: $(EXAMPLES)
+ @rm -f $@.tmp
+ @touch $@.tmp
+ failcom='exit 1'; \
+ for file in $(EXAMPLES); do \
+ $(DOC_SRCDIR)/tools/split_sample.sh \
+ $$file cc raw $(SPLIT_EXAMPLES_SRCDIR) \
+ || eval $$failcom; \
done
+ @mv -f $@.tmp $@
-split-outputs:
- test -d $(SPLIT_OUTPUTS_SRCDIR) || mkdir $(SPLIT_OUTPUTS_SRCDIR)
- @failcom='exit 1'; \
- list='$(OUTPUTS_SRCDIR)/*.txt'; for file in $$list; do \
- $(DOC_SRCDIR)/tools/split_sample.sh $$file txt "" $(SPLIT_OUTPUTS_SRCDIR)\
- || eval $$failcom; \
+# FIXME: Loops are bad, as they prevent parallelism. And we prefer
+# data-driven actions anyway. This would imply that we know in
+# advance the list out outputs (here, split outputs). Maybe we can
+# infer it from the LaTeX document.
+$(srcdir)/split-outputs.stamp: $(OUTPUTS)
+ @rm -f $@.tmp
+ @touch $@.tmp
+ failcom='exit 1'; \
+ for file in $(OUTPUTS); do \
+ $(DOC_SRCDIR)/tools/split_sample.sh \
+ $$file txt "" $(SPLIT_OUTPUTS_SRCDIR) \
+ || eval $$failcom; \
done
-
-## FIXME: Generated products recored in the repository should be
-## listed in MAINTAINERCLEANFILES.
-clean-local: clean-figures
-## rm -Rf $(OUTPUTS_BUILDDIR)
-## rm -f $(EXAMPLES_BUILDDIR)/*.cc
-
-## FIXME: Generated products recored in the repository should be
-## listed in MAINTAINERCLEANFILES.
-clean-figures:
-## rm -Rf $(FIGURES_BUILDDIR)
+ @mv -f $@.tmp $@
diff --git a/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
b/milena/doc/gen-examples-outputs-mk
old mode 100644
new mode 100755
similarity index 60%
copy from milena/tests/morpho/reconstruction/by_dilation/Makefile.am
copy to milena/doc/gen-examples-outputs-mk
index e6e8ea3..10692a1
--- a/milena/tests/morpho/reconstruction/by_dilation/Makefile.am
+++ b/milena/doc/gen-examples-outputs-mk
@@ -1,4 +1,6 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+#! /bin/sh
+
+# Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -13,20 +15,25 @@
#
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-#
-
-## Process this file through Automake to create Makefile.in.
-
-include $(top_srcdir)/milena/tests/tests.mk
-
-check_PROGRAMS = \
- union_find
+# To be used from milena/doc/'s source directory.
+me=`basename $0`
-union_find_SOURCES = union_find.cc
+test $# -ne 0 || { echo "usage: $me PROGRAMS..."; exit 1; }
+cat<<EOF
+## Generated by $me. Do not edit by hand.
-TESTS = $(check_PROGRAMS)
+EOF
+for program; do
+cat<<EOF
+\$(srcdir)/outputs/$program.txt: $program\$(EXEEXT)
+ rm -f \$@.tmp
+ ./\$< >\$@.tmp
+ cp -f \$@.tmp \$@
+ rm -f \$@.tmp
+EOF
+done
--
1.5.6.5