Use && to fail early if subcommands of kernel link fail.

(Remind me why we string together shell commands instead of just
using make targets?)
This commit is contained in:
riastradh 2016-04-09 18:51:44 +00:00
parent 2dd09931ab
commit 617d199e69
1 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.kern.inc,v 1.249 2015/11/27 20:59:47 christos Exp $
# $NetBSD: Makefile.kern.inc,v 1.250 2016/04/09 18:51:44 riastradh Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@ -52,7 +52,7 @@ _MKTARGET_CREATE?= :
##
# source tree is located via $S relative to the compilation directory
.ifndef S
S!= cd ../../../..; pwd
S!= cd ../../../.. && pwd
.endif
##
@ -229,12 +229,12 @@ LINKFLAGS?= ${LINKFORMAT} ${LINKSCRIPT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
LINKFLAGS_DEBUG?= -X
SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/" "//;s/\\.*//' vers.c; \
${SIZE} $@; chmod 755 $@; \
SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/" "//;s/\\.*//' vers.c && \
${SIZE} $@ && chmod 755 $@ && \
${SYSTEM_CTFMERGE}
SYSTEM_LD_TAIL_DEBUG?=; \
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
SYSTEM_LD_TAIL_DEBUG?=&& \
echo mv -f $@ $@.gdb && mv -f $@ $@.gdb && \
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
LINKFLAGS_NORMAL?= -S
STRIPFLAGS?= -g
@ -254,9 +254,9 @@ SYSTEM_LD_HEAD+= ${SYSTEM_LD_HEAD_EXTRA}
SYSTEM_LD_TAIL_STAGE1= ${SYSTEM_LD_TAIL}
SYSTEM_LD_TAIL_STAGE2= ${SYSTEM_LD_TAIL}
.if defined(COPY_SYMTAB)
SYSTEM_LD_TAIL_STAGE2+= ; echo ${DBSYM} $@; ${DBSYM} $@
SYSTEM_LD_TAIL_STAGE2+= && echo ${DBSYM} $@ && ${DBSYM} $@
.if !empty(DEBUG:M-g)
SYSTEM_LD_TAIL_STAGE2+= ; echo ${DBSYM} $@.gdb; ${DBSYM} $@.gdb
SYSTEM_LD_TAIL_STAGE2+= && echo ${DBSYM} $@.gdb && ${DBSYM} $@.gdb
.endif
.endif
SYSTEM_LD_TAIL_STAGE2+= ${SYSTEM_LD_TAIL_EXTRA}