#!/bin/sh
#
# This scipt is only for systems (such as the IBM AIX) that do _not_
# support "cc -M"
#
OPTIONS=
FILES=	
for param in $*; do
   case $param in
	-D*)	OPTIONS="$OPTIONS $param" ;;
	-I*)	OPTIONS="$OPTIONS $param" ;;
	-U*)	OPTIONS="$OPTIONS $param" ;;
	*.c)	FILES="$FILES $param" ;;
	*.s)	FILES="$FILES $param" ;;
	*)	;;
   esac
done
#echo options = $OPTIONS
#echo files = $FILES
for file in $FILES; do
#  create the output name for the file
   objname=`echo $file | sed s/[cs]$/o/`
   /lib/cpp $OPTIONS $file | egrep '# [0-9][0-9]* "' \
			   | sed 's/# [0-9][0-9]* "\([^"]*\)"/\1/' \
			   | sort | uniq \
			   | awk  '{ print name $1 }' name="$objname: "
done

