Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/kmod.mk
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | .if defined(PREFIX_SYMS) | ||||
${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \ | ${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \ | ||||
${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET} | ${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET} | ||||
.endif | .endif | ||||
.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no | .if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no | ||||
${OBJCOPY} --strip-debug ${.TARGET} | ${OBJCOPY} --strip-debug ${.TARGET} | ||||
.endif | .endif | ||||
_MAP_DEBUG_PREFIX= yes | _MAP_DEBUG_PREFIX= yes | ||||
.if ${MK_REPRODUCIBLE_BUILD} != "no" | |||||
_sysroot=${CC:M--sysroot=*:[-1]:S,--sysroot=,,} | |||||
_map_sysdir=${REPRODUCIBLE_SYSDIR} | |||||
CFLAGS+= -ffile-prefix-map=${_sysroot}/=/ | |||||
CFLAGS+= -ffile-prefix-map=${SYSDIR}=${_map_sysdir} | |||||
.if defined(REPRODUCIBLE_MODOBJDIR) && \ | |||||
"${REPRODUCIBLE_MODOBJDIR}${REPRODUCIBLE_SYSDIR}" != "${MAKEOBJDIRPREFIX}${SYSDIR}" | |||||
CFLAGS+= -ffile-prefix-map=${MAKEOBJDIRPREFIX}${SYSDIR}=${REPRODUCIBLE_MODOBJDIR}${REPRODUCIBLE_SYSDIR} | |||||
.endif | |||||
.else | |||||
_map_sysdir=${SYSDIR} | |||||
.endif | |||||
_ILINKS=machine | _ILINKS=machine | ||||
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" | .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" | ||||
_ILINKS+=x86 | _ILINKS+=x86 | ||||
.endif | .endif | ||||
CLEANFILES+=${_ILINKS} | CLEANFILES+=${_ILINKS} | ||||
all: ${PROG} | all: ${PROG} | ||||
beforedepend: ${_ILINKS} | beforedepend: ${_ILINKS} | ||||
beforebuild: ${_ILINKS} | beforebuild: ${_ILINKS} | ||||
# Ensure that the links exist without depending on it when it exists which | # Ensure that the links exist without depending on it when it exists which | ||||
# causes all the modules to be rebuilt when the directory pointed to changes. | # causes all the modules to be rebuilt when the directory pointed to changes. | ||||
# Ensure that debug info references the path in the source tree. | # Ensure that debug info references the path in the source tree. | ||||
.for _link in ${_ILINKS} | .for _link in ${_ILINKS} | ||||
.if !exists(${.OBJDIR}/${_link}) | .if !exists(${.OBJDIR}/${_link}) | ||||
OBJS_DEPEND_GUESS+= ${_link} | OBJS_DEPEND_GUESS+= ${_link} | ||||
.endif | .endif | ||||
.if defined(_MAP_DEBUG_PREFIX) | .if defined(_MAP_DEBUG_PREFIX) | ||||
.if ${_link} == "machine" | .if ${_link} == "machine" | ||||
CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include | CFLAGS+= -ffile-prefix-map=./machine=${_map_sysdir}/${MACHINE}/include | ||||
.else | .else | ||||
CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include | CFLAGS+= -ffile-prefix-map=./${_link}=${_map_sysdir}/${_link}/include | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.NOPATH: ${_ILINKS} | .NOPATH: ${_ILINKS} | ||||
${_ILINKS}: | ${_ILINKS}: | ||||
@case ${.TARGET} in \ | @case ${.TARGET} in \ | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |