Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/conf Clean up some rules and make them less error prone.



details:   https://anonhg.NetBSD.org/src/rev/484bd2a64c08
branches:  trunk
changeset: 810514:484bd2a64c08
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Wed Sep 02 03:22:41 2015 +0000

description:
Clean up some rules and make them less error prone.

diffstat:

 sys/conf/Makefile.kern.inc |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (68 lines):

diff -r 221663a71a5a -r 484bd2a64c08 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Tue Sep 01 23:04:35 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Wed Sep 02 03:22:41 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.218 2015/09/01 23:04:35 uebayasi Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.219 2015/09/02 03:22:41 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -397,8 +397,9 @@
 .if !target(${_s:T:R}.d)
 ${_s:T:R}.d: ${_s} assym.h
        ${_MKTARGET_CREATE}
-       ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
+       ${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_AFLAGS} \
            ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
+       mv -f ${.TARGET}.tmp ${.TARGET}
 .endif
 .endfor
 
@@ -406,8 +407,9 @@
 .if !target(${_s:T:R}.d)
 ${_s:T:R}.d: ${_s}
        ${_MKTARGET_CREATE}
-       ${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
+       ${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_CFLAGS} \
            ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
+       mv -f ${.TARGET}.tmp ${.TARGET}
 .endif
 .endfor
 
@@ -523,28 +525,27 @@
 .SUFFIXES: .genassym .assym.h
 .genassym.assym.h:
        ${_MKTARGET_CREATE}
-       cat $< | \
-           ${GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
-           ${GENASSYM_CPPFLAGS} > $@.tmp && \
+       ${GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
+           ${GENASSYM_CPPFLAGS} < $< > $@
        mv -f $@.tmp $@
 
 .SUFFIXES: .s .d
 .s.d:
        ${_MKTARGET_CREATE}
-       ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
-           ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       ${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       mv -f $@.tmp $@
 
 .SUFFIXES: .S .d
 .S.d:
        ${_MKTARGET_CREATE}
-       ${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
-           ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       ${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       mv -f $@.tmp $@
 
 .SUFFIXES: .c .d
 .c.d:
        ${_MKTARGET_CREATE}
-       ${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
-           ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       ${MKDEP} -f $@.tmp -- ${MKDEP_CFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
+       mv -f $@.tmp $@
 
 .SUFFIXES: .c .o
 .c.o:



Home | Main Index | Thread Index | Old Index