Module Name: src
Committed By: christos
Date: Mon Aug 24 18:02:55 UTC 2015
Modified Files:
src/sys/conf: Makefile.kern.inc
Log Message:
Fix the build: provide compatibility with ports that define KERNLDSCRIPT to
a file?
To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/conf/Makefile.kern.inc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.188 src/sys/conf/Makefile.kern.inc:1.189
--- src/sys/conf/Makefile.kern.inc:1.188 Mon Aug 24 11:50:47 2015
+++ src/sys/conf/Makefile.kern.inc Mon Aug 24 14:02:55 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.kern.inc,v 1.188 2015/08/24 15:50:47 uebayasi Exp $
+# $NetBSD: Makefile.kern.inc,v 1.189 2015/08/24 18:02:55 christos Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -230,8 +230,12 @@ SYSTEM_OBJ?= ${MD_OBJS} ${MI_OBJS} ${OBJ
.endif
SYSTEM_DEP+= Makefile ${SYSTEM_OBJ} .gdbinit
.if defined(KERNLDSCRIPT)
+.if exists(${KERNLDSCRIPT})
+SYSTEM_DEP+= -T ${KERNLDSCRIPT}
+.else
SYSTEM_DEP+= ${.TARGET}.ldscript
.endif
+.endif
.if defined(CTFMERGE)
SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
.else
@@ -256,8 +260,12 @@ EXTRA_CLEAN+= ${k}.ldscript
${k}.ldscript: ${KERNLDSCRIPT}
${CPP} ${KERNLDSCRIPT} | grep -v '^#' >$@
.endfor
+.if exists(${KERNLDSCRIPT})
+LINKSCRIPT= -T ${KERNLDSCRIPT}
+.else
LINKSCRIPT= -T ${.TARGET}.ldscript
.endif
+.endif
TEXTADDR?= ${LOADADDRESS} # backwards compatibility
LINKTEXT?= ${TEXTADDR:C/.+/-Ttext &/}