Commit 95ca51bf authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

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.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4282 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 0d241a45
2009-07-13 Guillaume Lazzara <guillaume.lazzara@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@lrde.epita.fr>
 
Update a tutorial example.
......@@ -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
......
# /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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment