1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Add option `-n', causing system headers not to be included in dependacy

lists.

This is needed when using a non-stock compiler.
This commit is contained in:
David E. O'Brien 1998-08-29 07:55:55 +00:00
parent 9eb10afece
commit 905a01acd9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38615
3 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
BINDIR?= /usr/bin
MAN1= mkdep.1
beforeinstall:

View File

@ -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

View File

@ -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