# This utility is a lightly editted version of the freed Berkeley
# script `mkdep'. The current script is intended to work for GNU G++.
# Here is the original BSD header:
# @(#)mkdep.sh 1.7 (Berkeley) 10/13/87
# PATH=/bin:/usr/bin:/usr/ucb:/usr/gnu:/usr/gnu/bin
echo 'usage: g++dep [-p] [-f makefile] [flags] file ...'
MAKE
=Makefile
# default makefile name is "Makefile"
# -f allows you to select a makefile name
# the -p flag produces "program: program.c" style dependencies
# so .o's don't get produced
echo "g++dep: no writeable file \"$MAKE\""
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP
# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
# put every dependency on one line
sed -e 's; \./; ;g' $SED | \
awk ' BEGIN { start = 1 }
/.* : .*.*/ { printf ("%s : %s \\\n", $1, $3) ; start = 4 }
{ for ( i = start; i < NF ; i++ )
if ( $i != "\\" ) print " ", $i, "\\"
if ( $i != "\\" ) print " ", $NF
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
# copy to preserve permissions