Add a DTRACEFLAGS variable, which can be used to pass additional variables

to dtrace(1) invocations during a build. This change includes -C in the
default flags, which has dtrace(1) run input scripts through the
preprocessor. While here, sort the definitions of CP and CPP in sys.mk.

Differential Revision:	https://reviews.freebsd.org/D2204
Reviewed by:		imp, rpaulo (previous revision)
This commit is contained in:
Mark Johnston 2015-04-08 02:43:05 +00:00
parent 67cf27b70f
commit 0c76c8aa8c
2 changed files with 12 additions and 10 deletions

View File

@ -128,18 +128,18 @@ CFLAGS+= -I${.OBJDIR}
.for _D in ${_DSRC:R} .for _D in ${_DSRC:R}
DHDRS+= ${_D}.h DHDRS+= ${_D}.h
${_D}.h: ${_DSRC} ${_D}.h: ${_DSRC}
${DTRACE} -xnolibs -h -s ${.ALLSRC} ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
SRCS:= ${SRCS:S/^${_DSRC}$//} SRCS:= ${SRCS:S/^${_DSRC}$//}
OBJS+= ${_D}.o OBJS+= ${_D}.o
CLEANFILES+= ${_D}.h ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o
${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC}
.if defined(LIB) .if defined(LIB)
CLEANFILES+= ${_D}.So ${_D}.po CLEANFILES+= ${_D}.So ${_D}.po
${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC}
${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.ALLSRC} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC}
.endif .endif
.endfor .endfor
.endfor .endfor

View File

@ -62,17 +62,18 @@ CFLAGS += -fno-strict-aliasing
.endif .endif
PO_CFLAGS ?= ${CFLAGS} PO_CFLAGS ?= ${CFLAGS}
# cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle
# read-only files as non-root by passing -f.
CP ?= cp -f
CPP ?= cpp
# C Type Format data is required for DTrace # C Type Format data is required for DTrace
CTFFLAGS ?= -L VERSION CTFFLAGS ?= -L VERSION
CTFCONVERT ?= ctfconvert CTFCONVERT ?= ctfconvert
CTFMERGE ?= ctfmerge CTFMERGE ?= ctfmerge
# cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle
# read-only files as non-root by passing -f.
CP ?= cp -f
DTRACE ?= dtrace
.if defined(CFLAGS) && (${CFLAGS:M-g} != "") .if defined(CFLAGS) && (${CFLAGS:M-g} != "")
CTFFLAGS += -g CTFFLAGS += -g
.endif .endif
@ -81,7 +82,8 @@ CXX ?= c++
CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition} CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition}
PO_CXXFLAGS ?= ${CXXFLAGS} PO_CXXFLAGS ?= ${CXXFLAGS}
CPP ?= cpp DTRACE ?= dtrace
DTRACEFLAGS ?= -C -x nolibs
.if empty(.MAKEFLAGS:M-s) .if empty(.MAKEFLAGS:M-s)
ECHO ?= echo ECHO ?= echo