From 190489bd61b2a639e43fb0f6d23746073b1991e3 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sat, 2 Jan 1988 00:04:38 -0800 Subject: [PATCH] allow both -f and -p at the same time SCCS-vsn: usr.bin/mkdep/mkdep.sh 5.9 --- usr/src/usr.bin/mkdep/mkdep.sh | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/usr/src/usr.bin/mkdep/mkdep.sh b/usr/src/usr.bin/mkdep/mkdep.sh index acd6192b35..778d56c1e4 100644 --- a/usr/src/usr.bin/mkdep/mkdep.sh +++ b/usr/src/usr.bin/mkdep/mkdep.sh @@ -10,31 +10,36 @@ # software without specific prior written permission. This software # is provided ``as is'' without express or implied warranty. # -# @(#)mkdep.sh 5.8 (Berkeley) %G% +# @(#)mkdep.sh 5.9 (Berkeley) %G% # PATH=/bin:/usr/bin:/usr/ucb export PATH +MAKE=Makefile # default makefile name is "Makefile" + +while : + do case "$1" in + # -f allows you to select a makefile name + -f) + MAKE=$2 + shift; shift ;; + + # the -p flag produces "program: program.c" style dependencies + # so .o's don't get produced + -p) + SED='-e s;\.o;;' + shift ;; + *) + break ;; + esac +done + if [ $# = 0 ] ; then echo 'usage: mkdep [-p] [-f makefile] [flags] file ...' exit 1 fi -MAKE=Makefile # default makefile name is "Makefile" -case $1 in - # -f allows you to select a makefile name - -f) - MAKE=$2 - shift; shift ;; - - # the -p flag produces "program: program.c" style dependencies - # so .o's don't get produced - -p) - SED='-e s;\.o;;' - shift ;; -esac - if [ ! -w $MAKE ]; then echo "mkdep: no writeable file \"$MAKE\"" exit 1 -- 2.20.1