3 # Verify consistency of the regression test files present in a directory with
4 # the contents of the EXTRA_DIST Makefile.am variable.
6 # Expand variables in a Makefile ($(NAME) syntax), evaluate $(add_suffix ...)
7 # and ignore $(noinst_SCRIPTS).
27 if (match($0, "^ *[A-Za-z_]* *= *.*$")) {
29 gsub("^ *", "", varname)
30 gsub(" *=.*", "", varname)
32 gsub("^ *[A-Za-z_]* *= *", "", value)
36 gsub("\\$\\( *" v " *\\)", var[v])
37 while ((pos = match($0, "\\$\\( *addsuffix *[^,)]*, *[^)]*\\)")) >= 1) {
38 suffix = substr($0, pos)
39 gsub("^\\$\\( *addsuffix *", "", suffix)
40 gsub(",.*", "", suffix)
41 names = substr($0, pos)
42 gsub("^\\$\\( *addsuffix *[^,)]*, *", "", names)
43 gsub("\\).*", "", names)
47 name_and_suff = name_and_suff " " name[n] suffix
48 sub("\\$\\( *addsuffix *[^,)]*, *[^)]*\\)", name_and_suff)
52 sed 's/\$(noinst_SCRIPTS)//'
56 echo "Error: tool name argument is missing."
62 # For all directories specified as an argument, find the Makefile.am files
63 # beneath and check the consistency of the files *.vgtest and *.exp* files
64 # in that directory with the filenames specified in EXTRA_DIST in Makefile.am.
67 find $t -name Makefile.am |
73 parsed_makefile
="$(parse_makefile Makefile.am)"
74 for f
in $
(ls -d *.exp
* *.gdb
*.vgtest
2>/dev
/null
)
76 if [ "$f" = "*.exp*" -o "$f" = "*.gdb" -o "$f" = "*.vgtest" ]; then
79 if ! echo "${parsed_makefile}" 2>/dev
/null |
grep '^ *EXTRA_DIST *=' |
82 echo "$m:1: error: $f is missing in EXTRA_DIST"
87 # check that filter files (but nor ones derived from filter*.in and emacs backup files)
88 # are in dist_noinst_SCRIPTS
89 for f
in $
(ls -d filter
* 2>/dev
/null |
grep -v -e \.
in -e '.*~$')
91 if [ ! -e "$f".
in ]; then
92 if ! echo "${parsed_makefile}" 2>/dev
/null |
grep '^ *dist_noinst_SCRIPTS *=' |
95 echo "$m:1: error: $f is missing in dist_noinst_SCRIPTS"
101 # check that filter files derived from filter*.in are in noinst_SCRIPTS
102 for f
in $
(ls -d filter
*\.
in 2>/dev
/null
)
104 f2
=`echo $f | sed 's/\.in//'`
105 if ! echo "${parsed_makefile}" 2>/dev
/null |
grep '^ *noinst_SCRIPTS *=' |
108 echo "$m:1: error: $f2 is missing in noinst_SCRIPTS"
113 for f
in $
(parse_makefile Makefile.am |
sed -n 's/^ *EXTRA_DIST *=//p')
115 if [ ! -e "$f" ]; then
116 echo "$m:1: error: $f is in EXTRA_DIST but doesn't exist"
121 for f
in $
(parse_makefile Makefile.am |
sed -n 's/^ *dist_noinst_SCRIPTS *=//p')
123 if [ ! -e "$f" ]; then
124 echo "$m:1: error: $f is in dist_noinst_SCRIPTS but doesn't exist"