* doc/examples/Makefile.am: fix 'data-regen' rule.
* doc/tools/split_sample.sh: add support for file name suffix.
---
milena/ChangeLog | 8 ++++++++
milena/doc/examples/Makefile.am | 9 +++++----
milena/doc/tools/split_sample.sh | 12 ++++++++----
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6ab45c8..17453d8 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2009-07-13 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+ Fix data-regen rule in documentation.
+
+ * doc/examples/Makefile.am: fix 'data-regen' rule.
+
+ * doc/tools/split_sample.sh: add support for file name suffix.
+
+2009-07-13 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+
Update a tutorial example.
* doc/outputs/tuto4_site_set_create.txt,
diff --git a/milena/doc/examples/Makefile.am b/milena/doc/examples/Makefile.am
index a0d812a..e0d14bc 100644
--- a/milena/doc/examples/Makefile.am
+++ b/milena/doc/examples/Makefile.am
@@ -143,8 +143,9 @@ tuto4_point2d_SOURCES = tuto4/point2d.cc
examples: $(EXTRA_PROGRAMS)
run-examples: examples
+ mkdir -p $(top_builddir)/milena/doc/figures; \
@failcom='exit 1'; \
- list='$(noinst_PROGRAMS)'; for bin in $$list; do \
+ list='$(EXTRA_PROGRAMS)'; for bin in $$list; do \
echo "Running $$bin"; \
./$$bin > $(OUTPUTS_SRCDIR)/$$bin.txt || eval $$failcom; \
done
@@ -241,14 +242,14 @@ fix-refdata:
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;
+ done;
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 $(SPLIT_EXAMPLES_SRCDIR)\
+ $(DOC_SRCDIR)/tools/split_sample.sh $$file cc raw $(SPLIT_EXAMPLES_SRCDIR)\
|| eval $$failcom; \
done
@@ -256,7 +257,7 @@ 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)\
+ $(DOC_SRCDIR)/tools/split_sample.sh $$file txt "" $(SPLIT_OUTPUTS_SRCDIR)\
|| eval $$failcom; \
done
diff --git a/milena/doc/tools/split_sample.sh b/milena/doc/tools/split_sample.sh
index 9712f40..aeb5e26 100755
--- a/milena/doc/tools/split_sample.sh
+++ b/milena/doc/tools/split_sample.sh
@@ -1,23 +1,27 @@
# /bin/sh
-if ! [ $# -eq 3 ]; then
- echo "Usage: $0 <file1> <file extension> <dst dir>"
+if ! [ $# -eq 4 ]; then
+ echo "Usage: $0 <file1> <file extension> <suffix> <dst
dir>"
exit 1;
fi
begins=`grep -n -R '//[[:space:]]*\\\{' $1 | cut -d ':' -f 1`
ends=`grep -n -R '//[[:space:]]*\\\}' $1 | cut -d ':' -f 1`
+if ! [ -z "$3" ]; then
+ suffix=".$3"
+fi
+
split=false
i=1
for begin in $begins; do
partend=$((`echo $ends | cut -d ' ' -f $i` - 1))
subdir=`basename \`dirname $1\``
- out_name="`basename $1 .$2`-$i.$2"
+ out_name="`basename $1 .$2`-$i.$2$suffix"
if [ "$subdir" != "examples" ] && [ "$subdir" !=
"outputs" ]; then
out_name="${subdir}_$out_name"
fi
- head -n $partend $1 | tail -n $(($partend - $begin)) > "$3/$out_name"
+ head -n $partend $1 | tail -n $(($partend - $begin)) > "$4/$out_name"
i=$((i+1))
split=true
done
--
1.5.6.5
Show replies by date