Pass -MD through to cpp so that it can generate a depend file.

(Actually pass any -M <arg> through, but -MD is most useful.)
This commit is contained in:
dsl 2004-01-26 21:51:11 +00:00
parent 36af2f9f0c
commit c08c3c342b
2 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: lint.1,v 1.27 2003/04/08 21:09:40 wiz Exp $
.\" $NetBSD: lint.1,v 1.28 2004/01/26 21:51:11 dsl Exp $
.\"
.\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
.\" Copyright (c) 1994, 1995 Jochen Pohl
@ -46,6 +46,9 @@
.Op Fl i | Fl nu
.Ek
.Bk -words
.Op Fl MD
.Ek
.Bk -words
.Op Fl D Ar name Ns Op =def
.Ek
.Bk -words
@ -79,6 +82,9 @@
.Op Fl s | Fl t | Fl S
.Ek
.Bk -words
.Op Fl MD
.Ek
.Bk -words
.Fl C Ar library
.Ek
.Bk -words
@ -389,6 +395,13 @@ If a complaint stems from an included file
.Nm
prints the name of the included file instead of the source file name
followed by a question mark.
.It Fl MD
Pass
.Fl MD
to
.Xr cpp 1
causing cpp to create files containing dependency information for
each source file.
.It Fl o Ns Ar outputfile
Name the output file
.Ar outputfile .

View File

@ -1,4 +1,4 @@
/* $NetBSD: xlint.c,v 1.33 2003/10/27 00:12:44 lukem Exp $ */
/* $NetBSD: xlint.c,v 1.34 2004/01/26 21:51:11 dsl Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: xlint.c,v 1.33 2003/10/27 00:12:44 lukem Exp $");
__RCSID("$NetBSD: xlint.c,v 1.34 2004/01/26 21:51:11 dsl Exp $");
#endif
#include <sys/param.h>
@ -363,7 +363,7 @@ main(int argc, char *argv[])
(void)signal(SIGINT, terminate);
(void)signal(SIGQUIT, terminate);
(void)signal(SIGTERM, terminate);
while ((c = getopt(argc, argv, "abcd:eghil:no:prstuvwxzB:C:D:FHI:L:SU:VX:")) != -1) {
while ((c = getopt(argc, argv, "abcd:eghil:no:prstuvwxzB:C:D:FHI:L:M:SU:VX:")) != -1) {
switch (c) {
case 'a':
@ -473,6 +473,7 @@ main(int argc, char *argv[])
case 'D':
case 'I':
case 'M':
case 'U':
(void)sprintf(flgbuf, "-%c", c);
appstrg(&cflags, concat2(flgbuf, optarg));