From 905a01acd918f1580cace1ba70d672f624712d10 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Sat, 29 Aug 1998 07:55:55 +0000 Subject: Add option `-n', causing system headers not to be included in dependacy lists. This is needed when using a non-stock compiler. --- usr.bin/mkdep/Makefile | 1 + usr.bin/mkdep/mkdep.1 | 4 +++- usr.bin/mkdep/mkdep.gcc.sh | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'usr.bin/mkdep') 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 -- cgit v1.2.3