annotate libinterp/find-defun-files.sh @ 21276:3b4bb843ffcd

maint: Ensure source files exist when searching for patterns during build * find-files-with-tests.sh: Test for file existence to avoid spurious warnings on not-yet-generated sources. * find-defun-files.sh: Likewise.
author Mike Miller <mtmiller@octave.org>
date Tue, 16 Feb 2016 17:57:07 -0800
parents 39096b290a2f
children 1bca6c72d2b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #! /bin/sh
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 set -e
10016
3275dda012f7 find-defun-files.sh: use sed and egrep as found by configure
Rob Mahurin <octave@tertiarysource.net>
parents: 9906
diff changeset
4 SED=${SED:-sed}
3275dda012f7 find-defun-files.sh: use sed and egrep as found by configure
Rob Mahurin <octave@tertiarysource.net>
parents: 9906
diff changeset
5 EGREP=${EGREP:-egrep}
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 # Some stupid egreps don't like empty elements in alternation patterns,
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 # so we have to repeat ourselves because some stupid egreps don't like
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 # empty elements in alternation patterns.
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 DEFUN_PATTERN="^[ \t]*DEF(CONSTFUN|CMD|UN|UN_DLD|UNX_DLD|UN_TEXT)[ \t]*\\("
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 srcdir="$1"
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 shift
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 for arg
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 do
9906
8d20fb66a0dc more automake fixes
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
18 if [ -f "$arg" ]; then
8d20fb66a0dc more automake fixes
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
19 file="$arg"
8d20fb66a0dc more automake fixes
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
20 else
8d20fb66a0dc more automake fixes
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
21 file="$srcdir/$arg"
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 fi
21276
3b4bb843ffcd maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents: 16174
diff changeset
23 if [ -f "$file" ]; then
3b4bb843ffcd maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents: 16174
diff changeset
24 if [ "`$EGREP -l "$DEFUN_PATTERN" $file`" ]; then
3b4bb843ffcd maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents: 16174
diff changeset
25 echo "$file" | $SED "s,\\$srcdir/,," | $SED 's/\.cc$/.df/; s/\.ll$/.df/; s/\.in.yy$/.df/'
3b4bb843ffcd maint: Ensure source files exist when searching for patterns during build
Mike Miller <mtmiller@octave.org>
parents: 16174
diff changeset
26 fi
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 fi
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 done