Net2/usr/src/usr.bin/gdb/grot/munch

#! /bin/sh

# create an initialization procedure from a list of .o files

echo '/* Do not modify this file.  It is created automatically by "munch". */'
echo 'void initialize_all_files () {'

if test "$1" = "-DSYSV" ; then
    shift;
    nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
	sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
else
    nm -p $* | egrep 'T *__initialize_' | \
	sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
fi

echo '}'