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 for f
in $
(ls -d filter
* 2>/dev
/null
)
89 if ! echo "${parsed_makefile}" 2>/dev
/null |
grep '^ *dist_noinst_SCRIPTS *=' |
92 echo "$m:1: error: $f is missing in dist_noinst_SCRIPTS"
97 for f
in $
(parse_makefile Makefile.am |
sed -n 's/^ *EXTRA_DIST *=//p')
99 if [ ! -e "$f" ]; then
100 echo "$m:1: error: $f is in EXTRA_DIST but doesn't exist"
105 for f
in $
(parse_makefile Makefile.am |
sed -n 's/^ *dist_noinst_SCRIPTS *=//p')
107 if [ ! -e "$f" ]; then
108 echo "$m:1: error: $f is in dist_noinst_SCRIPTS but doesn't exist"