Skip to content

Commit

Permalink
Fix the build: provide compatibility with ports that define KERNLDSCR…
Browse files Browse the repository at this point in the history
…IPT to

a file?
  • Loading branch information
christos committed Aug 24, 2015
1 parent c862ad0 commit ef556ed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sys/conf/Makefile.kern.inc
@@ -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}.
Expand Down Expand Up @@ -230,8 +230,12 @@ SYSTEM_OBJ?= ${MD_OBJS} ${MI_OBJS} ${OBJS:O} ${SYSLIBCOMPAT} ${LIBKERN}
.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
Expand All @@ -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 &/}
Expand Down

0 comments on commit ef556ed

Please sign in to comment.