Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/mk create mkdep output with a temporary file so that f...
details: https://anonhg.NetBSD.org/src/rev/983fc26233e8
branches: trunk
changeset: 791015:983fc26233e8
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Oct 31 01:55:03 2013 +0000
description:
create mkdep output with a temporary file so that failures in
complation during .d creation don't leave an empty (stale) .d
file around to break future builds.
(hmm, probably could use .PRECIOUS here.)
diffstat:
share/mk/bsd.dep.mk | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diffs (60 lines):
diff -r 0cb945cef727 -r 983fc26233e8 share/mk/bsd.dep.mk
--- a/share/mk/bsd.dep.mk Thu Oct 31 00:59:17 2013 +0000
+++ b/share/mk/bsd.dep.mk Thu Oct 31 01:55:03 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.dep.mk,v 1.78 2013/10/28 01:47:13 mrg Exp $
+# $NetBSD: bsd.dep.mk,v 1.79 2013/10/31 01:55:03 mrg Exp $
##### Basic targets
realdepend: beforedepend .depend afterdepend
@@ -60,37 +60,41 @@
.c.d:
${_MKTARGET_CREATE}
- ${MKDEP} -f ${.TARGET} ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
+ ${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
- ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
+ ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
+ mv ${.TARGET}.tmp ${.TARGET}
.m.d:
${_MKTARGET_CREATE}
- ${MKDEP} -f ${.TARGET} ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
+ ${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
- ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
+ ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
+ mv ${.TARGET}.tmp ${.TARGET}
.s.d .S.d:
${_MKTARGET_CREATE}
- ${MKDEP} -f ${.TARGET} ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
+ ${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${AFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} \
- ${__acpp_flags} ${.IMPSRC}
+ ${__acpp_flags} ${.IMPSRC} && \
+ mv ${.TARGET}.tmp ${.TARGET}
.C.d .cc.d .cpp.d .cxx.d:
${_MKTARGET_CREATE}
- ${MKDEPCXX} -f ${.TARGET} ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
+ ${MKDEPCXX} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
- ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
+ ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
+ mv ${.TARGET}.tmp ${.TARGET}
.endif # defined(SRCS) && !empty(SRCS) # }
##### Clean rules
.if defined(SRCS) && !empty(SRCS)
-CLEANDIRFILES+= .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
+CLEANDIRFILES+= .depend ${__DPSRCS.d} ${__DPSRCS.d:.d=.d.tmp} ${.CURDIR}/tags ${CLEANDEPEND}
.endif
##### Custom rules
Home |
Main Index |
Thread Index |
Old Index