summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkdep
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1998-08-29 07:55:55 +0000
committerobrien <obrien@FreeBSD.org>1998-08-29 07:55:55 +0000
commit78e95f775c29ac8f5a2a68a414d93f853abcc91e (patch)
treef17c7411c95913557580b1d4d8b7734b6a1fd09c /usr.bin/mkdep
parent6deeb3dc120596bf1e5dbc28cf463941115f4a12 (diff)
downloadFreeBSD-src-78e95f775c29ac8f5a2a68a414d93f853abcc91e.zip
FreeBSD-src-78e95f775c29ac8f5a2a68a414d93f853abcc91e.tar.gz
Add option `-n', causing system headers not to be included in dependacy
lists. This is needed when using a non-stock compiler.
Diffstat (limited to 'usr.bin/mkdep')
-rw-r--r--usr.bin/mkdep/Makefile1
-rw-r--r--usr.bin/mkdep/mkdep.14
-rw-r--r--usr.bin/mkdep/mkdep.gcc.sh15
3 files changed, 17 insertions, 3 deletions
diff --git a/usr.bin/mkdep/Makefile b/usr.bin/mkdep/Makefile
index a094bc5..3d63e58 100644
--- a/usr.bin/mkdep/Makefile
+++ b/usr.bin/mkdep/Makefile
@@ -1,5 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+BINDIR?= /usr/bin
MAN1= mkdep.1
beforeinstall:
diff --git a/usr.bin/mkdep/mkdep.1 b/usr.bin/mkdep/mkdep.1
index 59daef4..2add91d 100644
--- a/usr.bin/mkdep/mkdep.1
+++ b/usr.bin/mkdep/mkdep.1
@@ -39,7 +39,7 @@
.Nd construct Makefile dependency list
.Sh SYNOPSIS
.Nm
-.Op Fl ap
+.Op Fl anp
.Op Fl f Ar file
.Op Ar flags
.Ar file ...
@@ -71,6 +71,8 @@ may be run from a single Makefile.
Write the include file dependencies to
.Ar file ,
instead of the default ``.depend''.
+.It Fl n
+Don't make dependencies on system headers. I.e. anything in <>'s.
.It Fl p
Cause
.Nm
diff --git a/usr.bin/mkdep/mkdep.gcc.sh b/usr.bin/mkdep/mkdep.gcc.sh
index 157210a..9a07c9d 100644
--- a/usr.bin/mkdep/mkdep.gcc.sh
+++ b/usr.bin/mkdep/mkdep.gcc.sh
@@ -32,10 +32,11 @@
# SUCH DAMAGE.
#
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
-# $Id: mkdep.gcc.sh,v 1.13 1998/08/17 11:43:25 jb Exp $
+# $Id: mkdep.gcc.sh,v 1.14 1998/08/24 10:16:39 cracauer Exp $
D=.depend # default dependency file is .depend
append=0
+nosyshdrs=0
pflag=
while :
@@ -50,6 +51,11 @@ while :
D=$2
shift; shift ;;
+ # -n does not make dependencies on system headers
+ -n)
+ nosyshdrs=1
+ shift ;;
+
# the -p flag produces "program: program.c" style dependencies
# so .o's don't get produced
-p)
@@ -74,9 +80,14 @@ trap 'rm -f $TMP' 0
# pick the cpp. mkdep must be told the cpp to use for exceptional cases.
MKDEP_CPP=${MKDEP_CPP-"cc -E"}
+case $append in
+ 0) CC_MKDEP_OPT="-M";;
+ *) CC_MKDEP_OPT="-MM -w";;
+esac
+
echo "# $@" > $TMP # store arguments for debugging
-if $MKDEP_CPP -M "$@" >> $TMP; then :
+if $MKDEP_CPP $CC_MKDEP_OPT "$@" >> $TMP; then :
else
echo 'mkdep: compile failed' >&2
exit 1
OpenPOWER on IntegriCloud