* doc/gen-figures-mk: New script.
* doc/Makefile.am (EXTRA_DIST): Add gen-figures-mk.
---
milena/ChangeLog | 7 ++
milena/doc/Makefile.am | 2 +
milena/doc/gen-figures-mk | 156 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 165 insertions(+), 0 deletions(-)
create mode 100755 milena/doc/gen-figures-mk
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 9f7c752..cc5a1cf 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2010-03-20 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a script to generate doc/figures.mk.
+
+ * doc/gen-figures-mk: New script.
+ * doc/Makefile.am (EXTRA_DIST): Add gen-figures-mk.
+
+2010-03-20 Roland Levillain <roland(a)lrde.epita.fr>
+
Use a more uniform style in doc/figures.mk.
* doc/figures.mk: Here.
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index b8999bf..ff962ce 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -94,6 +94,8 @@ DOC_PACKAGES = doxyfuns.sty milena.sty
## Figures. ##
## --------- ##
+EXTRA_DIST += gen-figures-mk
+
# Generated figures.
include $(srcdir)/figures.mk
# FIXME: $(FIGURES) is not added to EXTRA_DIST (though it is added to
diff --git a/milena/doc/gen-figures-mk b/milena/doc/gen-figures-mk
new file mode 100755
index 0000000..cdbffbf
--- /dev/null
+++ b/milena/doc/gen-figures-mk
@@ -0,0 +1,156 @@
+#! /bin/sh
+
+# 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/>.
+
+me=`basename $0`
+
+# Use the C locale to have a deterministic sort.
+export LC_ALL=C
+
+# Get this list as argument?
+inputs()
+{
+ # Remove the .cc extension before sorting file names.
+ find examples -name \*.cc -a \! -path examples/trash/\* \
+ | sed 's/.cc$//' \
+ | sort \
+ | sed 's/$/.cc/'
+}
+
+# get_outputs FILE
+# ----------------
+get_outputs()
+{
+ local outputs=
+ local i=1
+ # Use Perl instead of sed for portability reasons.
+ for output in `perl -ne \
+ "print if s|^\\s*doc::(p.m)save\\s*\\([^;]+,\\s*\"([^\"]+)\"\\);\$|\\2.\\1|" \
+ "$1"`
+ do
+ # Add a number to the file name.
+ # FIXME: Maybe we should let the Perl script above do this...
+ num_output=`echo $output | sed "s,\\(.p.m\\),-$i\\1,"`
+ if test -z "$outputs"; then
+ outputs="$num_output"
+ else
+ outputs="$outputs $num_output"
+ fi
+ i=`expr $i + 1`
+ done
+ echo "$outputs"
+}
+
+# upcase STRING
+# -------------
+upcase()
+{
+ # Use enumerated sets to be portable.
+ echo "$1" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
+}
+
+# canonicalize STRING
+# -------------------
+canonicalize()
+{
+ echo "$1" | tr .- _
+}
+
+# backslashify
+# ------------
+# Read lines from the standard input and write them on the standard
+# output with an extra trailing backslash, except for the last line.
+backslashify()
+{
+ # Set IFS to nothing to prevent `read' from trimming spaces or tabs.
+ IFS= read last_line
+ while IFS= read line; do
+ echo "$last_line \\"
+ last_line=$line
+ done
+ echo "$last_line"
+}
+
+# Empty FIG_VARS.
+fig_vars=
+
+cat<<EOF
+## Generated by $me. Do not edit by hand.
+
+## Figures depend on the timestamp associated with their generator.
+## See also examples-outputs.mk.
+
+EOF
+
+for file in `inputs`; do
+ # FIXME: Ugly hack to handle the case of examples/ima-save.cc, since
+ # this program does not use a `doc::p?msave' routine...
+ if test "X$file" = "Xexamples/ima-save.cc"; then
+ # Hard-coded value.
+ figures="ima_save.pbm"
+ else
+ figures=`get_outputs "$file"`
+ fi
+
+ if test -n "$figures"; then
+
+ # 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 "$file" \
+ | sed -e 's,examples/,,' \
+ -e 'y,/,_,' \
+ -e 's,\.cc$,,'`
+ canonical_var=`canonicalize "$canonical_name"`
+ fig_var="`upcase "$canonical_var"`_FIGURES"
+ # Populate the list of variables of figures.
+ if test -z "$fig_vars"; then
+ fig_vars="$fig_var"
+ else
+ fig_vars="$fig_vars $fig_var"
+ fi
+ {
+ echo "$fig_var ="
+ for figure in $figures; do
+ echo " \$(srcdir)/figures/$figure"
+ done
+ } | backslashify
+ base=`basename "$file" .cc`
+ dir=`dirname "$file"`
+ timestamp="\$(srcdir)/$dir/$base.stamp"
+ cat <<EOF
+\$($fig_var): $timestamp
+## Recover from the removal of \$@
+ @if test -f \$@; then :; else \\
+ rm -f \$<; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) \$<; \\
+ fi
+
+EOF
+
+ fi
+done
+
+
+# Output the list of figures.
+echo "# The list of all generated figures."
+{
+ echo "FIGURES ="
+ for v in $fig_vars; do
+ echo " \$($v)"
+ done
+} | backslashify
--
1.5.6.5
* doc/gen-figures-mk: New script.
* doc/Makefile.am (EXTRA_DIST): Add gen-figures-mk.
---
milena/ChangeLog | 7 ++
milena/doc/Makefile.am | 2 +
milena/doc/gen-figures-mk | 156 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 165 insertions(+), 0 deletions(-)
create mode 100755 milena/doc/gen-figures-mk
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6fa44d5..43ab816 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2010-03-20 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a script to generate doc/figures.mk.
+
+ * doc/gen-figures-mk: New script.
+ * doc/Makefile.am (EXTRA_DIST): Add gen-figures-mk.
+
+2010-03-20 Roland Levillain <roland(a)lrde.epita.fr>
+
Use a more uniform style in doc/figures.mk.
* doc/figures.mk: Here.
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index b8999bf..ff962ce 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -94,6 +94,8 @@ DOC_PACKAGES = doxyfuns.sty milena.sty
## Figures. ##
## --------- ##
+EXTRA_DIST += gen-figures-mk
+
# Generated figures.
include $(srcdir)/figures.mk
# FIXME: $(FIGURES) is not added to EXTRA_DIST (though it is added to
diff --git a/milena/doc/gen-figures-mk b/milena/doc/gen-figures-mk
new file mode 100755
index 0000000..cdbffbf
--- /dev/null
+++ b/milena/doc/gen-figures-mk
@@ -0,0 +1,156 @@
+#! /bin/sh
+
+# 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/>.
+
+me=`basename $0`
+
+# Use the C locale to have a deterministic sort.
+export LC_ALL=C
+
+# Get this list as argument?
+inputs()
+{
+ # Remove the .cc extension before sorting file names.
+ find examples -name \*.cc -a \! -path examples/trash/\* \
+ | sed 's/.cc$//' \
+ | sort \
+ | sed 's/$/.cc/'
+}
+
+# get_outputs FILE
+# ----------------
+get_outputs()
+{
+ local outputs=
+ local i=1
+ # Use Perl instead of sed for portability reasons.
+ for output in `perl -ne \
+ "print if s|^\\s*doc::(p.m)save\\s*\\([^;]+,\\s*\"([^\"]+)\"\\);\$|\\2.\\1|" \
+ "$1"`
+ do
+ # Add a number to the file name.
+ # FIXME: Maybe we should let the Perl script above do this...
+ num_output=`echo $output | sed "s,\\(.p.m\\),-$i\\1,"`
+ if test -z "$outputs"; then
+ outputs="$num_output"
+ else
+ outputs="$outputs $num_output"
+ fi
+ i=`expr $i + 1`
+ done
+ echo "$outputs"
+}
+
+# upcase STRING
+# -------------
+upcase()
+{
+ # Use enumerated sets to be portable.
+ echo "$1" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
+}
+
+# canonicalize STRING
+# -------------------
+canonicalize()
+{
+ echo "$1" | tr .- _
+}
+
+# backslashify
+# ------------
+# Read lines from the standard input and write them on the standard
+# output with an extra trailing backslash, except for the last line.
+backslashify()
+{
+ # Set IFS to nothing to prevent `read' from trimming spaces or tabs.
+ IFS= read last_line
+ while IFS= read line; do
+ echo "$last_line \\"
+ last_line=$line
+ done
+ echo "$last_line"
+}
+
+# Empty FIG_VARS.
+fig_vars=
+
+cat<<EOF
+## Generated by $me. Do not edit by hand.
+
+## Figures depend on the timestamp associated with their generator.
+## See also examples-outputs.mk.
+
+EOF
+
+for file in `inputs`; do
+ # FIXME: Ugly hack to handle the case of examples/ima-save.cc, since
+ # this program does not use a `doc::p?msave' routine...
+ if test "X$file" = "Xexamples/ima-save.cc"; then
+ # Hard-coded value.
+ figures="ima_save.pbm"
+ else
+ figures=`get_outputs "$file"`
+ fi
+
+ if test -n "$figures"; then
+
+ # 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 "$file" \
+ | sed -e 's,examples/,,' \
+ -e 'y,/,_,' \
+ -e 's,\.cc$,,'`
+ canonical_var=`canonicalize "$canonical_name"`
+ fig_var="`upcase "$canonical_var"`_FIGURES"
+ # Populate the list of variables of figures.
+ if test -z "$fig_vars"; then
+ fig_vars="$fig_var"
+ else
+ fig_vars="$fig_vars $fig_var"
+ fi
+ {
+ echo "$fig_var ="
+ for figure in $figures; do
+ echo " \$(srcdir)/figures/$figure"
+ done
+ } | backslashify
+ base=`basename "$file" .cc`
+ dir=`dirname "$file"`
+ timestamp="\$(srcdir)/$dir/$base.stamp"
+ cat <<EOF
+\$($fig_var): $timestamp
+## Recover from the removal of \$@
+ @if test -f \$@; then :; else \\
+ rm -f \$<; \\
+ \$(MAKE) \$(AM_MAKEFLAGS) \$<; \\
+ fi
+
+EOF
+
+ fi
+done
+
+
+# Output the list of figures.
+echo "# The list of all generated figures."
+{
+ echo "FIGURES ="
+ for v in $fig_vars; do
+ echo " \$($v)"
+ done
+} | backslashify
--
1.5.6.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch revamp-doc-build has been updated
via 05b14084768907f50860a979aea5d22fe4502c16 (commit)
via b6d23f203d39ba22ec47a805f53f9be73f3bdeea (commit)
via 4c961ee6e2d3a1dec66ca14e3c344ae147a30933 (commit)
via cc8f9baae01d2527b0379e83ff48c0c093526a43 (commit)
via f86b1e780ef05765643405e5b9456c145cd2e96d (commit)
via fc7196b54aaeec4d381b72c298247147fbffad89 (commit)
via 84ab03d11b10f40d7cc3f8562823f89a43e35c64 (commit)
via eb37b34cfef8029a47401313f885f020af1d1b3a (commit)
via 65274cb0cb687be4167a6d3c303d643273e5feae (commit)
via 2efbcf38e5783f19dde0179971b90a7f2d4e4c8c (commit)
via 019eafb15442bac71aa18877205c1850f21216b4 (commit)
via 487066b2c2222f329557aa5084b185ce78d9e78d (commit)
via 412e1c2498db7ea51f721a4976230f087e98f930 (commit)
via d7477b4738064ec3f0285c49fd7a0e2d5a0fdcfb (commit)
via 08596c436254c3bc72df79c602c1a52d088488a1 (commit)
via 8c468bfe4da53ffa905fa964db75e2a919aded01 (commit)
via 5333046f0b1c5e8e9f6c7efff3275ff8c3d9857f (commit)
via deef3451fe6bdf2742c80441f4053fa5d5a4eb38 (commit)
via b435aaefc7a8ced8781ab8802f80cc47e9b5dfdc (commit)
via 9995f2f0f79d27df67c5fe22d0e9ba5e3a19319e (commit)
via f380d4a41bfc75328426c23a4e6403c502613522 (commit)
via 530dab561cbb732eff6bfcfcfd8c1ef670c35976 (commit)
via d4d289f688767b9fdb8eb6cf463b448145fdf1b0 (commit)
via ef57579e4b9cabb6a8740923781404106205c260 (commit)
via f31fd9910bc48e521131d9d40f585789b07da887 (commit)
via e5d6ed0790d5127e3152aabd6c32cf459610ff84 (commit)
via 16b19b728d660cd7628941d3c02a6bf986f11bc8 (commit)
via 57871627ea6df97224ef39b8015d13ce09ee634a (commit)
via 1168f5242f804cecf1a089f982eb5d993928f917 (commit)
via db2104b01afe59e7f9cf72eb0eacbe87d1a65527 (commit)
via 0176b4b2eef3a76141ad58ae1fa80a2925ca86d8 (commit)
via 247e151000cbab8c3c8e5c625adb793738c886f2 (commit)
via b7fc1e76cf4d629def68b7260eb057357a5d50d1 (commit)
via 120298149142b9c6c0a7aaabd79d2b3030115855 (commit)
from dc54b19cb5b39de46f62d04edd7859cb0b35b74a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
05b1408 Typo in doc/.
b6d23f2 Fix dependencies in doc/.
4c961ee Distribute non generated figures in the documentation.
cc8f9ba Distribute non generated examples in the documentation.
f86b1e7 Have ``make maintainer-clean'' remove generated figures in doc/.
fc7196b bootstrap: Regen the list of split outputs of the documentation.
84ab03d Generate the list of split outputs in the documentation.
eb37b34 Prepare doc source files for the automation of output splitting.
65274cb Have split_sample.sh announce the right number of output files.
2efbcf3 Fix programs in doc/examples/.
019eafb bootstrap: Be terser.
487066b bootstrap: Don't remove the automatically collected temp dir.
412e1c2 Update PNG-to-EPS conversion rule.
d7477b4 Remove useless paths in texi2dvi invocations.
08596c4 Update cleaning rules in doc/.
8c468bf Add missing dependencies.
5333046 Ship non generated outputs.
deef345 bootstrap: Regen the list of outputs of the documentation.
b435aae Generate the list of outputs in the documentation.
9995f2f Handle dependencies of generated figures.
f380d4a doc/examples-outputs.mk: Regen.
530dab5 Prepare for the generation of multiple outputs from doc/ programs.
d4d289f bootstrap: Regen the list of outputs rules and timestamps.
ef57579 Generate doc/examples-outputs.mk using sources in lieu of programs.
f31fd99 Move bits about programs out of doc/Makefile.am to improve readability.
e5d6ed0 bootstrap: Regen the list of split examples of the documentation.
16b19b7 Generate the list of split examples in the documentation.
5787162 bootstrap: Regen the list of examples of the documentation.
1168f52 Generate the list of examples in the documentation.
db2104b Catch up with milena/doc generators.
0176b4b Revamp the conversion of images in the documentation.
247e151 Add a rule to forcefully regen doc/examples-outputs.mk.
b7fc1e7 Ship doc/gen-examples-outputs-mk.
1202981 Fix the regeneration of HTML outputs.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 34 +
bootstrap | 42 +-
milena/ChangeLog | 387 +++++++
milena/doc/Makefile.am | 694 +++++-------
milena/doc/examples-outputs.mk | 1209 +++++++++++++++-----
milena/doc/examples.mk | 85 ++
...nstanciation.cc => accu-right-instantiation.cc} | 0
...tion.cc.raw => accu-wrong-instantiation.cc.raw} | 0
milena/doc/examples/examples.mk | 125 --
milena/doc/examples/fill-imageif-cfun.cc | 2 +-
milena/doc/examples/ima-load.cc | 8 +-
milena/doc/examples/ima-save.cc | 3 +
...-1.cc.raw => accu-right-instantiation-1.cc.raw} | 0
milena/doc/examples/split/ima-load-1.cc.raw | 2 +-
milena/doc/examples/tuto3/println.cc | 10 +-
milena/doc/examples/tuto4/image.cc | 4 +-
milena/doc/examples/tuto4/site_set_create.cc | 14 +-
milena/doc/figures.mk | 165 +++
milena/doc/figures/figures.mk | 41 -
milena/doc/gen-examples-outputs-mk | 50 +-
milena/doc/gen-make-variable | 52 +
milena/doc/gen-split-examples-mk | 129 +++
milena/doc/gen-split-outputs-mk | 133 +++
milena/doc/img/small.pbm | 1 +
milena/doc/outputs.mk | 54 +
...tanciation.txt => accu-right-instantiation.txt} | 0
milena/doc/outputs/outputs.mk | 69 --
milena/doc/pbm-figures.mk | 11 +
milena/doc/pgm-figures.mk | 7 +
milena/doc/ppm-figures.mk | 29 +
milena/doc/programs-examples.mk | 147 +++
milena/doc/ref_guide/ref_guide.tex | 4 +-
milena/doc/split-examples.mk | 916 +++++++++++++++
milena/doc/split-outputs.mk | 60 +
milena/doc/tools/split_sample.sh | 4 +-
35 files changed, 3525 insertions(+), 966 deletions(-)
create mode 100644 milena/doc/examples.mk
rename milena/doc/examples/{accu-right-instanciation.cc => accu-right-instantiation.cc} (100%)
rename milena/doc/examples/{accu-wrong-instanciation.cc.raw => accu-wrong-instantiation.cc.raw} (100%)
delete mode 100644 milena/doc/examples/examples.mk
rename milena/doc/examples/split/{accu-right-instanciation-1.cc.raw => accu-right-instantiation-1.cc.raw} (100%)
create mode 100644 milena/doc/figures.mk
delete mode 100644 milena/doc/figures/figures.mk
create mode 100755 milena/doc/gen-make-variable
create mode 100755 milena/doc/gen-split-examples-mk
create mode 100755 milena/doc/gen-split-outputs-mk
create mode 120000 milena/doc/img/small.pbm
create mode 100644 milena/doc/outputs.mk
rename milena/doc/outputs/{accu-right-instanciation.txt => accu-right-instantiation.txt} (100%)
delete mode 100644 milena/doc/outputs/outputs.mk
create mode 100644 milena/doc/pbm-figures.mk
create mode 100644 milena/doc/pgm-figures.mk
create mode 100644 milena/doc/ppm-figures.mk
create mode 100644 milena/doc/programs-examples.mk
create mode 100644 milena/doc/split-examples.mk
create mode 100644 milena/doc/split-outputs.mk
hooks/post-receive
--
Olena, a generic and efficient image processing platform