summaryrefslogtreecommitdiffstats
path: root/share/mk/sys.mk
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2010-04-02 06:55:31 +0000
committernetchild <netchild@FreeBSD.org>2010-04-02 06:55:31 +0000
commite14ccde629ef57d3eb9b2e301b0789029e6ba32d (patch)
treea328b94a6cba383d7a03a4da5cb2becf2d12be03 /share/mk/sys.mk
parent1edbfe1bf0f2aa5129e857b93c974d7b8b98d889 (diff)
downloadFreeBSD-src-e14ccde629ef57d3eb9b2e301b0789029e6ba32d.zip
FreeBSD-src-e14ccde629ef57d3eb9b2e301b0789029e6ba32d.tar.gz
WITH_CTF can now be specified in src.conf (not recommended, there
are some problems with static executables), make.conf (would also affect ports which do not use GNU make and do not override the compile targets) or in the kernel config (via "makeoptions WITH_CTF=yes"). Additional (related) changes: - propagate WITH_CTF to module builds - do not add -g to the linker flags, it's a noop there anyway (at least according to the man page of ld) - do not add -g to CFLAGS unconditionally we need to have a look if it is really needed (IMO not) or if there is a way to add it only when WITH_CTF is used Note: ctfconvert / ctfmerge lines will not appear in the build output, to protect the innocent (those which do not build with WITH_CTF would see the shell-test and may think WITH_CTF is used). Reviewed by: imp, jhb, scottl (earlier version) Discussed on: arch@
Diffstat (limited to 'share/mk/sys.mk')
-rw-r--r--share/mk/sys.mk82
1 files changed, 22 insertions, 60 deletions
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 51ec039..80ad3fa 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -55,14 +55,14 @@ NO_CTF = 1
# C Type Format data is required for DTrace
CTFFLAGS ?= -L VERSION
-.if !defined(NO_CTF)
CTFCONVERT ?= ctfconvert
CTFMERGE ?= ctfmerge
.if defined(CFLAGS) && (${CFLAGS:M-g} != "")
CTFFLAGS += -g
.else
-CFLAGS += -g
-.endif
+# XXX: What to do here? Is removing the CFLAGS part completely ok here?
+# For now comment it out to not compile with -g unconditionally.
+#CFLAGS += -g
.endif
CXX ?= c++
@@ -144,15 +144,11 @@ YFLAGS ?= -d
# SINGLE SUFFIX RULES
.c:
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f:
${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.sh:
cp ${.IMPSRC} ${.TARGET}
@@ -162,33 +158,25 @@ YFLAGS ?= -d
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f.o:
${FC} ${FFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c
rm -f y.tab.c
mv y.tab.o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.l.o:
${LEX} ${LFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c lex.yy.c
rm -f lex.yy.c
mv lex.yy.o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
@@ -226,15 +214,11 @@ YFLAGS ?= -d
.c:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.cc .cpp .cxx .C:
${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
@@ -244,15 +228,11 @@ YFLAGS ?= -d
.m.o:
${OBJC} ${OBJCFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.p.o:
${PC} ${PFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.e .r .F .f:
${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
@@ -263,38 +243,28 @@ YFLAGS ?= -d
.S.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.asm.o:
${CC} -x assembler-with-cpp ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.s.o:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# XXX not -j safe
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
rm -f y.tab.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.l.o:
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
rm -f ${.PREFIX}.tmp.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# XXX not -j safe
.y.c:
@@ -306,34 +276,26 @@ YFLAGS ?= -d
.s.out .c.out .o.out:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f.out .F.out .r.out .e.out:
${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
${LDLIBS} -o ${.TARGET}
rm -f ${.PREFIX}.o
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# XXX not -j safe
.y.out:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
rm -f y.tab.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.l.out:
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
rm -f ${.PREFIX}.tmp.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef.
__MAKE_CONF?=/etc/make.conf
OpenPOWER on IntegriCloud