summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/kern.mk8
-rw-r--r--sys/conf/kern.post.mk12
-rw-r--r--sys/conf/kern.pre.mk11
-rw-r--r--sys/conf/kmod.mk5
4 files changed, 21 insertions, 15 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 0f5cd66..7e23a80 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -108,3 +108,11 @@ CFLAGS+= -restrict
${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
CFLAGS+= -fstack-protector
.endif
+
+#
+# Enable CTF conversation on request.
+#
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index f808c95..c5c9c34 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -19,6 +19,10 @@ MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}"
.endif
+.if defined(WITH_CTF)
+MKMODULESENV+= WITH_CTF="${WITH_CTF}"
+.endif
+
.MAIN: all
.for target in all clean cleandepend cleandir clobber depend install \
@@ -90,9 +94,7 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
@rm -f ${.TARGET}
@echo linking ${.TARGET}
${SYSTEM_LD}
-.if defined(CTFMERGE)
- ${SYSTEM_CTFMERGE}
-.endif
+ @${SYSTEM_CTFMERGE}
.if !defined(DEBUG)
${OBJCOPY} --strip-debug ${.TARGET}
.endif
@@ -240,9 +242,7 @@ kernel-reinstall:
config.o env.o hints.o vers.o vnode_if.o:
${NORMAL_C}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
config.ln env.ln hints.ln vers.ln vnode_if.ln:
${NORMAL_LINT}
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ee74a9e..39a045a 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -128,11 +128,7 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
-.if defined(CTFCONVERT)
-NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.else
-NORMAL_CTFCONVERT=
-.endif
+NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC}
@@ -142,10 +138,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
SYSTEM_OBJS+= hack.So
-.if defined(CTFMERGE)
-SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
-LD+= -g
-.endif
+SYSTEM_CTFMERGE= [ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \
-warn-common -export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 2cd7509..526eec7 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -69,6 +69,11 @@ OBJCOPY?= objcopy
.error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
.endif
+# Enable CTF conversion on request.
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
.include <bsd.init.mk>
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
OpenPOWER on IntegriCloud