aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/mkdep
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1998-08-29 07:55:55 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1998-08-29 07:55:55 +0000
commit905a01acd918f1580cace1ba70d672f624712d10 (patch)
tree016d978e238d122d3d444334ed53fba2489f6be4 /usr.bin/mkdep
parent9eb10afece550507125529ae397aaf9945aa7b60 (diff)
downloadsrc-905a01acd918f1580cace1ba70d672f624712d10.tar.gz
src-905a01acd918f1580cace1ba70d672f624712d10.zip
Add option `-n', causing system headers not to be included in dependacy
lists. This is needed when using a non-stock compiler.
Notes
Notes: svn path=/head/; revision=38615
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 a094bc5bacec..3d63e58bc6af 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 59daef4f4ae7..2add91dc4103 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 157210a6743f..9a07c9dae0d3 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