Mercurial > hg > octave-lyh
annotate libcruft/mkf77def.in @ 14535:8150ccfffa22
Apply broadcasting to inputs of line().
* __line__.m: Use broadcasting the match the sizes of inputs.
* line.m: Add demo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 06 Apr 2012 19:21:16 -0400 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
6102 | 1 #! /bin/sh |
7019 | 2 # |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12174
diff
changeset
|
3 # Copyright (C) 2006-2012 John W. Eaton |
7019 | 4 # |
5 # This file is part of Octave. | |
12174 | 6 # |
7019 | 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. | |
12174 | 11 # |
7019 | 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. | |
12174 | 16 # |
7019 | 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/>. | |
6102 | 20 |
21 SED=${SED:-'sed'} | |
22 AWK=${AWK:-'awk'} | |
23 | |
9817
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
24 F77_TOLOWER="@F77_APPEND_UNDERSCORE@" |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
25 F77_APPEND_UNDERSCORE="@F77_APPEND_UNDERSCORE@" |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
26 F77_APPEND_EXTRA_UNDERSCORE="@F77_APPEND_EXTRA_UNDERSCORE@" |
6102 | 27 |
28 if $F77_TOLOWER; then | |
29 case_cmd="tolower"; | |
30 else | |
31 case_cmd="toupper"; | |
32 fi | |
33 | |
34 if $F77_APPEND_UNDERSCORE; then | |
35 uscore="_"; | |
36 else | |
37 uscore=""; | |
38 fi | |
39 | |
40 if $F77_APPEND_EXTRA_UNDERSCORE; then | |
41 awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'" | |
42 else | |
43 awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'" | |
44 fi | |
45 | |
9817
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
46 if [ $# -gt 1 ]; then |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
47 srcdir="$1" |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
48 shift |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
49 fi |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
50 |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
51 echo EXPORTS |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
52 for arg |
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
53 do |
9822
64270d3ad469
mkf77def.in: only process *.f files
John W. Eaton <jwe@octave.org>
parents:
9817
diff
changeset
|
54 case "$arg" in |
64270d3ad469
mkf77def.in: only process *.f files
John W. Eaton <jwe@octave.org>
parents:
9817
diff
changeset
|
55 *.f) |
12174 | 56 ## There are TABS in this sed command. |
9822
64270d3ad469
mkf77def.in: only process *.f files
John W. Eaton <jwe@octave.org>
parents:
9817
diff
changeset
|
57 $SED -n -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/; s/^\( \| \)[ ]*\(.*function\|subroutine\|entry\)[ ]*\([^ (]*\).*$/\3/p' "$srcdir/$arg" | eval $awkcmd |
64270d3ad469
mkf77def.in: only process *.f files
John W. Eaton <jwe@octave.org>
parents:
9817
diff
changeset
|
58 ;; |
64270d3ad469
mkf77def.in: only process *.f files
John W. Eaton <jwe@octave.org>
parents:
9817
diff
changeset
|
59 esac |
9817
932b0efeb81b
restore rules to create libcruft/cruft.def
John W. Eaton <jwe@octave.org>
parents:
7019
diff
changeset
|
60 done |