Mercurial > hg > octave-nkf
annotate scripts/mkdoc @ 11117:3cbc0d77db48 ss-3-3-53
update version info for snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 19 Oct 2010 02:25:32 -0400 |
parents | 4c681ff57bc3 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
3295 | 1 #! /bin/sh |
7019 | 2 # |
8920 | 3 # Copyright (C) 1999, 2002, 2005, 2007, 2009 John W. Eaton |
7019 | 4 # |
5 # This file is part of Octave. | |
6 # | |
7 # Octave is free software; you can redistribute it and/or modify it | |
8 # under the terms of the GNU General Public License as published by the | |
9 # Free Software Foundation; either version 3 of the License, or (at | |
10 # your option) any later version. | |
11 # | |
12 # Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 # for more details. | |
16 # | |
17 # You should have received a copy of the GNU General Public License | |
18 # along with Octave; see the file COPYING. If not, see | |
19 # <http://www.gnu.org/licenses/>. | |
3295 | 20 |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
21 ## Expecting arguments in this order: |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
22 ## |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
23 ## SRCDIR SRCDIR-FILES ... -- LOCAL-FILES ... |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
24 |
4098 | 25 set -e |
26 | |
8445
dd52e541418b
scripts/mkdoc: set defaults for FIND and PERL; check usage
John W. Eaton <jwe@octave.org>
parents:
8444
diff
changeset
|
27 PERL=${PERL:-'perl'} |
dd52e541418b
scripts/mkdoc: set defaults for FIND and PERL; check usage
John W. Eaton <jwe@octave.org>
parents:
8444
diff
changeset
|
28 |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
29 prefix="$1/" |
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
30 shift |
3295 | 31 |
4098 | 32 if test -f gethelp; then |
5333 | 33 cat << EOF |
34 ### DO NOT EDIT! | |
35 ### | |
36 ### This file is generated automatically from the Octave sources. | |
37 ### Edit those files instead and run make to update this file. | |
38 | |
39 EOF | |
9673
acf9952463c3
make mkdoc work on list of filenames
John W. Eaton <jwe@octave.org>
parents:
9014
diff
changeset
|
40 for arg |
acf9952463c3
make mkdoc work on list of filenames
John W. Eaton <jwe@octave.org>
parents:
9014
diff
changeset
|
41 do |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
42 if [ "$arg" = "--" ]; then |
9943
4c681ff57bc3
Modifications to makefiles to pass distcheck test
Rik <rdrider0-list@yahoo.com>
parents:
9927
diff
changeset
|
43 prefix="./" |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
44 else |
9927
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
45 $PERL -w -e ' |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
46 unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; } |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
47 ($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]); |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
48 $full_fname = $srcdir . $m_fname; |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
49 exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} ); |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
50 if ($2) { |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
51 $fcn = "$2$3/$4"; |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
52 } else { |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
53 $fcn = $4; |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
54 } |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
55 $re_srcdir = quotemeta($srcdir); |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
56 for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) { |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
57 s/^\s+\@/\@/ unless $in_example; |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
58 s/^\s+\@group/\@group/; |
9927
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
59 s/^\s+\@end\s+group/\@end group/; |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
60 s|\@c $re_srcdir|\@c scripts/|o; |
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
61 $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/); |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
62 print; |
9927
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
63 }' "$prefix" "$arg" |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9673
diff
changeset
|
64 fi |
9673
acf9952463c3
make mkdoc work on list of filenames
John W. Eaton <jwe@octave.org>
parents:
9014
diff
changeset
|
65 done |
4098 | 66 else |
67 echo "gethelp program seems to be missing!" 1>&2 | |
68 exit 1 | |
9927
ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
Rik <rdrider0-list@yahoo.com>
parents:
9891
diff
changeset
|
69 fi |