From 4db60ccdb38e9405d52323bb8f5b17e7e6b5002f Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Mon, 24 Oct 1988 19:44:54 -0800 Subject: [PATCH] add -a flag SCCS-vsn: usr.bin/mkdep/mkdep.sh 5.17 SCCS-vsn: usr.bin/mkdep/mkdep.old.compiler 5.2 --- usr/src/usr.bin/mkdep/mkdep.old.compiler | 17 +++++++++++++++-- usr/src/usr.bin/mkdep/mkdep.sh | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/usr/src/usr.bin/mkdep/mkdep.old.compiler b/usr/src/usr.bin/mkdep/mkdep.old.compiler index 8473329e71..dfea56aeb0 100644 --- a/usr/src/usr.bin/mkdep/mkdep.old.compiler +++ b/usr/src/usr.bin/mkdep/mkdep.old.compiler @@ -15,7 +15,7 @@ # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#)mkdep.old.compiler 5.1 (Berkeley) %G% +# @(#)mkdep.old.compiler 5.2 (Berkeley) %G% # # This is a version of mkdep that works pretty well @@ -25,12 +25,20 @@ PATH=/bin:/usr/bin:/usr/ucb:/lib:/usr/lib INCL= D=.depend +append=0 + while : do case "$1" in + # -a appends to the depend file + -a) + append=1 + shift ;; + # -f allows you to select a makefile name -f) D=$2 shift; shift ;; + # the -p flag produces "program: program.c" style dependencies # so .o's don't get produced -p) @@ -98,5 +106,10 @@ END { print rec }' > $TMP -mv $TMP $D +if [ $append = 1 ]; then + cat $TMP >> $D + rm -f $TMP +else + mv $TMP $D +fi exit 0 diff --git a/usr/src/usr.bin/mkdep/mkdep.sh b/usr/src/usr.bin/mkdep/mkdep.sh index 874441cffc..c7feabfd07 100644 --- a/usr/src/usr.bin/mkdep/mkdep.sh +++ b/usr/src/usr.bin/mkdep/mkdep.sh @@ -15,15 +15,21 @@ # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#)mkdep.sh 5.16 (Berkeley) %G% +# @(#)mkdep.sh 5.17 (Berkeley) %G% # PATH=/bin:/usr/bin:/usr/ucb export PATH D=.depend # default dependency file is .depend +append=0 while : do case "$1" in + # -a appends to the depend file + -a) + append=1 + shift ;; + # -f allows you to select a makefile name -f) D=$2 @@ -73,5 +79,10 @@ END { print rec }' > $TMP -mv $TMP $D +if [ $append = 1 ]; then + cat $TMP >> $D + rm -f $TMP +else + mv $TMP $D +fi exit 0 -- 2.20.1