* doc/figures.mk: New Make helper.
Include it...
* doc/Makefile.am: ...here.
---
milena/ChangeLog | 8 ++++
milena/doc/Makefile.am | 2 +
milena/doc/figures.mk | 110 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 120 insertions(+), 0 deletions(-)
create mode 100644 milena/doc/figures.mk
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 85d1c1c..66ed89f 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Handle dependencies of generated figures.
+
+ * doc/figures.mk: New Make helper.
+ Include it...
+ * doc/Makefile.am: ...here.
+
+2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+
* doc/examples-outputs.mk: Regen.
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index 6e2822f..feda59c 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -934,6 +934,8 @@ regen-examples-outputs-mk:
MAINTAINERCLEANFILES += $(OUTPUTS)
+include $(srcdir)/figures.mk
+
## --------------- ##
## Split outputs. ##
## --------------- ##
diff --git a/milena/doc/figures.mk b/milena/doc/figures.mk
new file mode 100644
index 0000000..e6ea731
--- /dev/null
+++ b/milena/doc/figures.mk
@@ -0,0 +1,110 @@
+## Figures' dependencies. -*- Makefile-Automake -*-
+
+## Copyright (C) 2010 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/>.
+
+## Figures depend on the timestamp associated with their generator.
+## See also examples-outputs.mk.
+
+## FIXME: Generate this file.
+##
+## It'd be cool if programs themselves could generate a list of their
+## outputs (as a side effect) or at least if the extraction of this
+## list from the source file was straightforward.
+
+$(srcdir)/figures/extend-1.ppm $(srcdir)/figures/extend-2.ppm $(srcdir)/figures/extend-3.ppm $(srcdir)/figures/extend-4.ppm $(srcdir)/figures/extend-5.ppm: $(srcdir)/examples/extend.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-1.ppm $(srcdir)/figures/fill-2.ppm: $(srcdir)/examples/fill.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-subdomain-1.pbm $(srcdir)/figures/fill-subdomain-2.ppm $(srcdir)/figures/fill-subdomain-3.ppm $(srcdir)/figures/fill-subdomain-4.ppm: $(srcdir)/examples/fill-subdomain.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-subimage-cfun-1.ppm: $(srcdir)/examples/fill-imageif-cfun.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/ima2d-rot-1.ppm $(srcdir)/figures/ima2d-rot-2.ppm: $(srcdir)/examples/ima2d-rot.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/ima_save.pbm: $(srcdir)/examples/ima-save.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/labeling-compute-1.pbm $(srcdir)/figures/labeling-compute-2.ppm: $(srcdir)/examples/labeling-compute.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/logical-not-1.pbm $(srcdir)/figures/logical-not-2.pbm $(srcdir)/figures/logical-not-3.pbm: $(srcdir)/examples/logical-not.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto2_first_image-1.pbm: $(srcdir)/examples/tuto2_first_image.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto3_colorize-1.pgm $(srcdir)/figures/tuto3_colorize-2.ppm: $(srcdir)/examples/tuto3/colorize.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto3_rw_image-1.ppm $(srcdir)/figures/tuto3_rw_image-3.ppm: $(srcdir)/examples/tuto3_rw_image.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto4_genericity_and_algorithms-1.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-2.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-3.pbm $(srcdir)/figures/tuto4_genericity_and_algorithms-4.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-5.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-6.ppm: $(srcdir)/examples/tuto4_genericity_and_algorithms.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
--
1.5.6.5
* doc/figures.mk: New Make helper.
Include it...
* doc/Makefile.am: ...here.
---
milena/ChangeLog | 8 ++++
milena/doc/Makefile.am | 2 +
milena/doc/figures.mk | 110 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 120 insertions(+), 0 deletions(-)
create mode 100644 milena/doc/figures.mk
diff --git a/milena/ChangeLog b/milena/ChangeLog
index e104118..3d0719a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Handle dependencies of generated figures.
+
+ * doc/figures.mk: New Make helper.
+ Include it...
+ * doc/Makefile.am: ...here.
+
+2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+
* doc/examples-outputs.mk: Regen.
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index 6e2822f..feda59c 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -934,6 +934,8 @@ regen-examples-outputs-mk:
MAINTAINERCLEANFILES += $(OUTPUTS)
+include $(srcdir)/figures.mk
+
## --------------- ##
## Split outputs. ##
## --------------- ##
diff --git a/milena/doc/figures.mk b/milena/doc/figures.mk
new file mode 100644
index 0000000..e6ea731
--- /dev/null
+++ b/milena/doc/figures.mk
@@ -0,0 +1,110 @@
+## Figures' dependencies. -*- Makefile-Automake -*-
+
+## Copyright (C) 2010 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/>.
+
+## Figures depend on the timestamp associated with their generator.
+## See also examples-outputs.mk.
+
+## FIXME: Generate this file.
+##
+## It'd be cool if programs themselves could generate a list of their
+## outputs (as a side effect) or at least if the extraction of this
+## list from the source file was straightforward.
+
+$(srcdir)/figures/extend-1.ppm $(srcdir)/figures/extend-2.ppm $(srcdir)/figures/extend-3.ppm $(srcdir)/figures/extend-4.ppm $(srcdir)/figures/extend-5.ppm: $(srcdir)/examples/extend.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-1.ppm $(srcdir)/figures/fill-2.ppm: $(srcdir)/examples/fill.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-subdomain-1.pbm $(srcdir)/figures/fill-subdomain-2.ppm $(srcdir)/figures/fill-subdomain-3.ppm $(srcdir)/figures/fill-subdomain-4.ppm: $(srcdir)/examples/fill-subdomain.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/fill-subimage-cfun-1.ppm: $(srcdir)/examples/fill-imageif-cfun.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/ima2d-rot-1.ppm $(srcdir)/figures/ima2d-rot-2.ppm: $(srcdir)/examples/ima2d-rot.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/ima_save.pbm: $(srcdir)/examples/ima-save.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/labeling-compute-1.pbm $(srcdir)/figures/labeling-compute-2.ppm: $(srcdir)/examples/labeling-compute.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/logical-not-1.pbm $(srcdir)/figures/logical-not-2.pbm $(srcdir)/figures/logical-not-3.pbm: $(srcdir)/examples/logical-not.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto2_first_image-1.pbm: $(srcdir)/examples/tuto2_first_image.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto3_colorize-1.pgm $(srcdir)/figures/tuto3_colorize-2.ppm: $(srcdir)/examples/tuto3/colorize.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto3_rw_image-1.ppm $(srcdir)/figures/tuto3_rw_image-3.ppm: $(srcdir)/examples/tuto3_rw_image.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+
+$(srcdir)/figures/tuto4_genericity_and_algorithms-1.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-2.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-3.pbm $(srcdir)/figures/tuto4_genericity_and_algorithms-4.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-5.ppm $(srcdir)/figures/tuto4_genericity_and_algorithms-6.ppm: $(srcdir)/examples/tuto4_genericity_and_algorithms.stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
--
1.5.6.5
* doc/gen-examples-outputs-mk: Split generated rules in two so
that they produce a timestamp that outputs (and soon generated
figures) depend on.
---
milena/ChangeLog | 8 ++++++
milena/doc/gen-examples-outputs-mk | 48 +++++++++++++++++++++++++++--------
2 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2f4606f..19a77c3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Prepare for the generation of multiple outputs from doc/ programs.
+
+ * doc/gen-examples-outputs-mk: Split generated rules in two so
+ that they produce a timestamp that outputs (and soon generated
+ figures) depend on.
+
+2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Generate doc/examples-outputs.mk using sources in lieu of programs.
* doc/gen-examples-outputs-mk: Take sources as input instead of
diff --git a/milena/doc/gen-examples-outputs-mk b/milena/doc/gen-examples-outputs-mk
index 2580072..440d960 100755
--- a/milena/doc/gen-examples-outputs-mk
+++ b/milena/doc/gen-examples-outputs-mk
@@ -24,22 +24,48 @@ test $# -ne 0 || { echo "usage: $me SOURCES..."; exit 1; }
cat<<EOF
## Generated by $me. Do not edit by hand.
-
EOF
for source; do
- program=`basename "$source" .cc`
- # Have outputs depend on sources rather than programs, and recompile
- # the latter to regen the former only when needed. This way, we can
- # ship generated outputs without forcing the user of the
+ base=`basename "$source" .cc`
+ source_dir=`dirname "$source"`
+ timestamp="\$(srcdir)/$source_dir/$base.stamp"
+ # FIXME: Programs of which sources are located in a subdirectory of
+ # examples/ take the path as prefix of their name. This is a pain.
+ # It'd be much simpler to have all sources in the same directory.
+ canonical_name=`echo "$source" \
+ | sed -e 's,examples/,,' \
+ -e 'y,/,_,' \
+ -e 's,\.cc$,,'`
+ program="$canonical_name\$(EXEEXT)"
+ output="\$(srcdir)/outputs/$canonical_name.txt"
+
+ # Programs generate a textual output, and possibly one or several
+ # images (as a ``side effect''). Use a timestamp to keep track of
+ # these multiple outputs.
+ #
+ # Also, have outputs depend on sources rather than programs, and
+ # recompile the latter to regen the former only when needed. This
+ # way, we can ship generated outputs without forcing the user of the
# distribution to recompile the programs.
cat<<EOF
-\$(srcdir)/outputs/$program.txt: $source
- rm -f \$@.tmp
- \$(MAKE) \$(AM_MAKEFLAGS) $program\$(EXEEXT)
- ./\$< >\$@.tmp
- cp -f \$@.tmp \$@
- rm -f \$@.tmp
+
+$timestamp: $source
+ @rm -f \$@.tmp
+ @touch \$@.tmp
+ \$(MAKE) \$(AM_MAKEFLAGS) $program
+ ./$program >$output.tmp
+ mv $output.tmp $output
+ @mv -f \$@.tmp \$@
+EXTRA_DIST += $timestamp
+MAINTAINERCLEANFILES += $timestamp
+
+$output: $timestamp
+## Recover from the removal of \$@
+ @if test -f \$@; then :; else \\
+ rm -f \$<; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) \$<; \\
+ fi
EOF
done
--
1.5.6.5
* doc/gen-examples-outputs-mk: Split generated rules in two so
that they produce a timestamp that outputs (and soon generated
figures) depend on.
---
milena/ChangeLog | 8 ++++++
milena/doc/gen-examples-outputs-mk | 48 +++++++++++++++++++++++++++--------
2 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 9f7f28b..536253c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Prepare for the generation of multiple outputs from doc/ programs.
+
+ * doc/gen-examples-outputs-mk: Split generated rules in two so
+ that they produce a timestamp that outputs (and soon generated
+ figures) depend on.
+
+2010-03-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Generate doc/examples-outputs.mk using sources in lieu of programs.
* doc/gen-examples-outputs-mk: Take sources as input instead of
diff --git a/milena/doc/gen-examples-outputs-mk b/milena/doc/gen-examples-outputs-mk
index 2580072..440d960 100755
--- a/milena/doc/gen-examples-outputs-mk
+++ b/milena/doc/gen-examples-outputs-mk
@@ -24,22 +24,48 @@ test $# -ne 0 || { echo "usage: $me SOURCES..."; exit 1; }
cat<<EOF
## Generated by $me. Do not edit by hand.
-
EOF
for source; do
- program=`basename "$source" .cc`
- # Have outputs depend on sources rather than programs, and recompile
- # the latter to regen the former only when needed. This way, we can
- # ship generated outputs without forcing the user of the
+ base=`basename "$source" .cc`
+ source_dir=`dirname "$source"`
+ timestamp="\$(srcdir)/$source_dir/$base.stamp"
+ # FIXME: Programs of which sources are located in a subdirectory of
+ # examples/ take the path as prefix of their name. This is a pain.
+ # It'd be much simpler to have all sources in the same directory.
+ canonical_name=`echo "$source" \
+ | sed -e 's,examples/,,' \
+ -e 'y,/,_,' \
+ -e 's,\.cc$,,'`
+ program="$canonical_name\$(EXEEXT)"
+ output="\$(srcdir)/outputs/$canonical_name.txt"
+
+ # Programs generate a textual output, and possibly one or several
+ # images (as a ``side effect''). Use a timestamp to keep track of
+ # these multiple outputs.
+ #
+ # Also, have outputs depend on sources rather than programs, and
+ # recompile the latter to regen the former only when needed. This
+ # way, we can ship generated outputs without forcing the user of the
# distribution to recompile the programs.
cat<<EOF
-\$(srcdir)/outputs/$program.txt: $source
- rm -f \$@.tmp
- \$(MAKE) \$(AM_MAKEFLAGS) $program\$(EXEEXT)
- ./\$< >\$@.tmp
- cp -f \$@.tmp \$@
- rm -f \$@.tmp
+
+$timestamp: $source
+ @rm -f \$@.tmp
+ @touch \$@.tmp
+ \$(MAKE) \$(AM_MAKEFLAGS) $program
+ ./$program >$output.tmp
+ mv $output.tmp $output
+ @mv -f \$@.tmp \$@
+EXTRA_DIST += $timestamp
+MAINTAINERCLEANFILES += $timestamp
+
+$output: $timestamp
+## Recover from the removal of \$@
+ @if test -f \$@; then :; else \\
+ rm -f \$<; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) \$<; \\
+ fi
EOF
done
--
1.5.6.5