26 |
# "-" (at least, that is what the documentation implies). |
# "-" (at least, that is what the documentation implies). |
27 |
# |
# |
28 |
# $XFree86: xc/config/util/mdepend.cpp,v 3.2 1997/06/29 07:54:20 dawes Exp $ |
# $XFree86: xc/config/util/mdepend.cpp,v 3.2 1997/06/29 07:54:20 dawes Exp $ |
|
# |
|
29 |
|
|
30 |
CPPARGS="-Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE " |
CPPARGS="-Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE " |
31 |
CPPARGS="-traditional -P $CPPARGS" |
CPPARGS="-traditional $CPPARGS" |
32 |
|
|
33 |
CC="cpp $CPPARGS" |
CC="cpp $CPPARGS" |
34 |
if test -x /lib/cpp ; then |
if test -x /lib/cpp ; then |
38 |
silent='-' |
silent='-' |
39 |
|
|
40 |
TMP=./mdep$$ |
TMP=./mdep$$ |
41 |
|
#- try to put temporary files in system-local /tmp dir |
42 |
|
#TMP=/tmp/mdep$$ |
43 |
|
#touch $TMP ; retVal=$? |
44 |
|
#if [ $retVal -eq 0 ] ; then |
45 |
|
# if test ! -r $TMP ; then TMP=./mdep$$ ; fi |
46 |
|
#else |
47 |
|
# TMP=./mdep$$ |
48 |
|
#fi |
49 |
|
#rm -f $TMP |
50 |
|
##echo "temp files: $TMP" |
51 |
|
|
52 |
CPPCMD=${TMP}a |
CPPCMD=${TMP}a |
53 |
DEPENDLINES=${TMP}b |
DEPENDLINES=${TMP}b |
54 |
TMPMAKEFILE=${TMP}c |
TMPMAKEFILE=${TMP}c |
198 |
} |
} |
199 |
}' | sort -u | awk ' |
}' | sort -u | awk ' |
200 |
|
|
|
|
|
201 |
{ |
{ |
202 |
newrec = rec " " $2 |
newrec = rec " " $2 |
203 |
if ($1 != old1) |
if ($1 != old1) |
221 |
print rec |
print rec |
222 |
}' | egrep -v '^[^:]*:[ ]*$' >> $DEPENDLINES |
}' | egrep -v '^[^:]*:[ ]*$' >> $DEPENDLINES |
223 |
|
|
|
|
|
224 |
trap "" 1 2 13 15 # Now we are committed |
trap "" 1 2 13 15 # Now we are committed |
225 |
case "$makefile" in |
case "$makefile" in |
226 |
$TMPMAKEFILE) |
$TMPMAKEFILE) |
232 |
;; |
;; |
233 |
esac |
esac |
234 |
|
|
|
# |
|
235 |
# If not -a, append the magic string and a blank line so that |
# If not -a, append the magic string and a blank line so that |
236 |
# /^$magic_string/+1,\$d can be used to delete everything from after |
# /^$magic_string/+1,\$d can be used to delete everything from after |
237 |
# the magic string to the end of the file. Then, append a blank |
# the magic string to the end of the file. Then, append a blank |
238 |
# line again and then the dependencies. |
# line again and then the dependencies. |
|
# |
|
239 |
if [ "$append" = "n" ] |
if [ "$append" = "n" ] |
240 |
then |
then |
241 |
cat >> $makefile << END_OF_APPEND |
cat >> $makefile << END_OF_APPEND |