--- buildutils/makedepend-sh 1999-11-17 18:32:52.000000000 +0100 +++ buildutils/makedepend-sh 2002-10-09 17:22:18.000000000 +0200 @@ -475,8 +475,8 @@ { ckmatchfile="$1" depsfile="$2" - - if test -n "$ckmatchfile" ; then + + if test -n "$ckmatchfile" ; then $CKSUM "$ckmatchfile" > $CKS 2> /dev/null && \ test -s "$CKS" || return 1 @@ -645,6 +645,7 @@ xobjs=""; export xobjs ignobjs=""; export ignobjs cksumfile=""; export cksumfile +tmpdep=""; export tmpdep trap '/bin/rm /tmp/mkdep.$$.* > /dev/null 2>&1' 0 1 2 3 15 @@ -663,6 +664,7 @@ -m*) shift; mrules="$1" ;; # the make rules file -x*) shift; xobjs="$1" ;; # no rules for this list of objs -i*) shift; ignobjs="$1" ;; # list of objs to be ignored + -tmpdep*) shift; tmpdep="$1";; # our tmp file for depends file -a*) append=yes ;; -v*) verbose=`expr $verbose + 1` ;; --) incr_mode ;; @@ -684,7 +686,7 @@ fi if test "$append" = yes -a -n "$mrules"; then - echo $P: cannot use append mode if -m is specified >$2 + echo $P: cannot use append mode if -m is specified >&2 echo $P: since multiple action definitions are prohibited >&2 exit 1 fi @@ -711,6 +713,8 @@ # not changed. Ideally, make would have an include directive # but that is not universally the case. # +export TMP=$tmpdep + have_usable_depends "$cksumfile" && cp "$DEPEND_STORE" "$TMP" || gen_depends @@ -718,6 +722,7 @@ # if the marker is already in the file, do not put a second one in grep "^$MARKER" $MF > /dev/null 2>&1 || echo "$MARKER" >> $MF cat $TMP >> $MF + echo "$TMP >> $MF" else # # create the ed script that depends on $MARKER and on whether we are @@ -754,5 +759,8 @@ maybe_store_depends "$cksumfile" "$TMP" || \ echo $P: error storing dependencies for later use +if [ -z $tmpdep ]; then /bin/rm $TMP $ED > /dev/null 2>&1 - +else +/bin/rm $ED >/dev/null 2>&1 +fi