4 XCOMM makedepend which uses 'gcc -M'
6 XCOMM $XFree86: xc/config/util/gccmdep.cpp,v 3.3 1996/02/25 01:16:15 dawes Exp $
8 XCOMM Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com>
17 trap "$RM ${TMP}*; exit 1" 1 2 15
18 trap "$RM ${TMP}*; exit 0" 1 2 13
23 magic_string='# DO NOT DELETE'
29 if [ "$endmarker"x != x -a "$endmarker" = "$1" ]; then
39 if [ "$endmarker"x = x ]; then
41 XCOMM ignore these flags
59 endmarker=`echo $1 | sed 's/^\-\-//'`
60 if [ "$endmarker"x = x ]; then
68 echo "Unknown option '$1' ignored" 1>&2
81 if [ x"$files" = x ]; then
88 if [ -r makefile ]; then
90 elif [ -r Makefile ]; then
93 echo 'no makefile or Makefile found' 1>&2
99 if [ X"$makefile" != X- ]; then
100 if [ x"$append" = xn ]; then
101 sed -e "/^$magic_string/,\$d" < $makefile > $TMP
102 echo "$magic_string" >> $TMP
108 XCOMM need to link .s files to .S
113 base=`basename $i .s`
114 (cd $dir; $RM ${base}.S; $LN ${base}.s ${base}.S)
115 asmfiles="$asmfiles ${base}.S"
120 CMD="$CC -M $args `echo $files | sed -e 's,\.s$,\.S,g' -e 's,\.s ,\.S ,g'` | \
121 sed -e 's,\.S$,\.s,g' -e 's,\.S ,\.s ,g'"
122 if [ X"$makefile" != X- ]; then
126 if [ X"$makefile" != X- ]; then
128 $MV $makefile ${makefile}.bak
132 if [ x"$asmfiles" != x ]; then