From 0dc53f4655849b02d833885f037e13dfd68a3f5a Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 7 Mar 1998 13:57:37 +0000 Subject: Pass -nostdinc to mkdep for assembler and C files (it was already passed for C++ files). Don't pass -nostdlib to mkdep for C++ files. Don't use temporary variables to obfuscate the main rule. --- share/mk/bsd.dep.mk | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'share/mk/bsd.dep.mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 00ff459..c513d26 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -1,4 +1,4 @@ -# $Id: bsd.dep.mk,v 1.16 1997/12/14 15:38:47 wosch Exp $ +# $Id: bsd.dep.mk,v 1.17 1998/02/20 14:32:30 bde Exp $ # # The include file handles Makefile dependencies. # @@ -31,30 +31,29 @@ MKDEPCMD?= mkdep DEPENDFILE?= .depend -# some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR -# .if defined ${SRCS:M*.[sS]} does not work -__depend_s= ${SRCS:M*.[sS]} -__depend_c= ${SRCS:M*.c} -__depend_cc= ${SRCS:M*.cc} ${SRCS:M*.C} ${SRCS:M*.cxx} - +# Different types of sources are compiled with slightly different flags. +# Split up the sources, and filter out headers and non-applicable flags. ${DEPENDFILE}: ${SRCS} rm -f ${DEPENDFILE} -.if defined(__depend_s) && !empty(__depend_s) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[BID]*} ${AINC} \ - ${.ALLSRC:M*.[sS]} +.if ${SRCS:M*.[sS]} != "" + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ + ${AINC} \ + ${.ALLSRC:M*.[sS]} .endif -.if defined(__depend_c) && !empty(__depend_c) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[BID]*} \ - ${.ALLSRC:M*.c} +.if ${SRCS:M*.c} != "" + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ + ${.ALLSRC:M*.c} .endif -.if defined(__depend_cc) && !empty(__depend_cc) +.if ${SRCS:M*.cc} != "" || ${SRCS:M*.C} != "" || ${SRCS:M*.cxx} != "" ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ - ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[BID]*} \ - ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx} + ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*} \ + ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx} .endif .if target(_EXTRADEPEND) cd ${.CURDIR}; ${MAKE} _EXTRADEPEND -- cgit v1.1