aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1998-09-13 09:39:39 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1998-09-13 09:39:39 +0000
commit2b1470681afa6e6232e0316bd156dff9ed1430d0 (patch)
treeab37f7e68d7cac48abf5969d43073710e44557ea
parent05f6e7a230595ad18eb493a741c32ca78f5a912e (diff)
Notes
-rw-r--r--usr.bin/mkdep/mkdep.123
-rw-r--r--usr.bin/mkdep/mkdep.gcc.sh19
2 files changed, 25 insertions, 17 deletions
diff --git a/usr.bin/mkdep/mkdep.1 b/usr.bin/mkdep/mkdep.1
index 2add91dc4103..8116f47907f8 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 anp
+.Op Fl ap
.Op Fl f Ar file
.Op Ar flags
.Ar file ...
@@ -60,6 +60,15 @@ depend:
where the macro SRCS is the list of C source files and the macro
CFLAGS is the list of flags for the C compiler.
.Pp
+The user has the ability to change the preprocessor and preprocessor options
+used. For instance, to use Gcc as the preprocessor and to ignore system
+headers, one would use
+.Bd -literal -offset indent
+depend:
+ env MKDEP_CPP="gcc -E" MKDEP_CPP_OPTS=-MM mkdep \\
+ ${CFLAGS} ${SRCS}
+.Ed
+.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl a
@@ -71,8 +80,6 @@ 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
@@ -88,6 +95,16 @@ directly from its C module rather than using an intermediate
module.
This is useful for programs whose source is contained in a single
module.
+.Sh ENVIRONMENT
+.Bl -tag -width MKDEP_CPP_OPTS
+.It Ev CC
+Specifies the C compiler to use. The specified compiler is expected to have
+options consistant with the Gnu C compiler.
+.It Ev MKDEP_CPP
+Specifies the preprocessor to use. The default is "${CC} -E".
+.It Ev MKDEP_CPP_OPTS
+Specifie the non-CFLAGS options for the preprocessor. The default is
+"-M".
.El
.Sh SEE ALSO
.Xr cc 1 ,
diff --git a/usr.bin/mkdep/mkdep.gcc.sh b/usr.bin/mkdep/mkdep.gcc.sh
index 907a9f322b00..ff4e2f360131 100644
--- a/usr.bin/mkdep/mkdep.gcc.sh
+++ b/usr.bin/mkdep/mkdep.gcc.sh
@@ -32,11 +32,10 @@
# SUCH DAMAGE.
#
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
-# $Id: mkdep.gcc.sh,v 1.15 1998/08/29 07:55:55 obrien 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 :
@@ -51,11 +50,6 @@ 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)
@@ -78,16 +72,13 @@ trap 'rm -f $TMP' 0
# For C sources, mkdep must use exactly the same cpp and predefined flags
# as the compiler would. This is easily arranged by letting the compiler
# pick the cpp. mkdep must be told the cpp to use for exceptional cases.
-MKDEP_CPP=${MKDEP_CPP-"cc -E"}
-
-case $nosyshdrs in
- 0) CC_MKDEP_OPT="-M";;
- *) CC_MKDEP_OPT="-MM -w";;
-esac
+CC=${CC-"cc"}
+MKDEP_CPP=${MKDEP_CPP-"${CC} -E"}
+MKDEP_CPP_OPTS=${MKDEP_CPP_OPTS-"-M"};
echo "# $@" > $TMP # store arguments for debugging
-if $MKDEP_CPP $CC_MKDEP_OPT "$@" >> $TMP; then :
+if $MKDEP_CPP $MKDEP_CPP_OPTS "$@" >> $TMP; then :
else
echo 'mkdep: compile failed' >&2
exit 1