add -a flag
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 25 Oct 1988 03:44:54 +0000 (19:44 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 25 Oct 1988 03:44:54 +0000 (19:44 -0800)
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
usr/src/usr.bin/mkdep/mkdep.sh

index 8473329..dfea56a 100644 (file)
@@ -15,7 +15,7 @@
 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
 # 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
 #
 
 # 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
 
 INCL=
 D=.depend
+append=0
+
 while :
        do case "$1" in
 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 ;;
                # -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)
                # 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
 
        print rec
 }' > $TMP
 
-mv $TMP $D
+if [ $append = 1 ]; then
+       cat $TMP >> $D
+       rm -f $TMP
+else
+       mv $TMP $D
+fi
 exit 0
 exit 0
index 874441c..c7feabf 100644 (file)
 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
 # 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
 #
 PATH=/bin:/usr/bin:/usr/ucb
 export PATH
 
 D=.depend                      # default dependency file is .depend
+append=0
 
 while :
        do case "$1" in
 
 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
                # -f allows you to select a makefile name
                -f)
                        D=$2
@@ -73,5 +79,10 @@ END {
        print rec
 }' > $TMP
 
        print rec
 }' > $TMP
 
-mv $TMP $D
+if [ $append = 1 ]; then
+       cat $TMP >> $D
+       rm -f $TMP
+else
+       mv $TMP $D
+fi
 exit 0
 exit 0