summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.dep.mk
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-03-07 13:57:37 +0000
committerbde <bde@FreeBSD.org>1998-03-07 13:57:37 +0000
commit0dc53f4655849b02d833885f037e13dfd68a3f5a (patch)
treeb48dfccd3dd649ee5b1a6d763fd3743914132348 /share/mk/bsd.dep.mk
parent59afc2283176380d44679c483c3fe8923f8c0480 (diff)
downloadFreeBSD-src-0dc53f4655849b02d833885f037e13dfd68a3f5a.zip
FreeBSD-src-0dc53f4655849b02d833885f037e13dfd68a3f5a.tar.gz
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.
Diffstat (limited to 'share/mk/bsd.dep.mk')
-rw-r--r--share/mk/bsd.dep.mk31
1 files changed, 15 insertions, 16 deletions
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 <bsd.dep.mk> 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
OpenPOWER on IntegriCloud