Changeset View
Standalone View
share/mk/bsd.lib.mk
| Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | |||||
| .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) | .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) | ||||
| # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR | # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR | ||||
| @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} | @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} | ||||
| .endif | .endif | ||||
| ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} | ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} | ||||
| ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} | ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} | ||||
| .endif | .endif | ||||
| _SYMLIST?=${SRCTOP}/tools/build/symlist.awk | |||||
sjg: It is conventional to have white-space after `=`
same applies to all below | |||||
Done Inline ActionsI've added spaces as with earlier assignments in the file. Overall the file needs a sweep as there are spaces, tabs, and nothing... brooks: I've added spaces as with earlier assignments in the file. Overall the file needs a sweep as… | |||||
| .if exists(${_SYMLIST}) && !target(${SHLIB_NAME}.symbols) | |||||
Done Inline ActionsPerhaps && !target(${SHLIB_NAME}.symbols) sjg: Perhaps `&& !target(${SHLIB_NAME}.symbols)`
so a local*mk could provide an alternative… | |||||
Done Inline ActionsI've added this guard, but I'm not quite sure it's the right one. The question is, what do we want to be pluggable? brooks: I've added this guard, but I'm not quite sure it's the right one. The question is, what do we… | |||||
| CLEANFILES+= ${SHLIB_NAME}.symbols | |||||
| ${SHLIB_NAME}.symbols: ${SHLIB_NAME_FULL} ${_SYMLIST} | |||||
| (printf "%sgenerated by bsd.lib.mk\n" @; \ | |||||
Done Inline ActionsWhy printf when echo would do? sjg: Why printf when echo would do? | |||||
Done Inline ActionsThis file needs to not contain the string @generated or tools like Phabricator will treat it as a generated file and not display diffs by default. printf accomplishes this. brooks: This file needs to not contain the string `@generated` or tools like Phabricator will treat it… | |||||
Done Inline ActionsYou could do ? echo ${:U@}generated sjg: You could do ?
`echo ${:U@}generated` | |||||
| readelf -sW ${.ALLSRC:[1]} | awk -f ${_SYMLIST} | sort ) > ${.TARGET} | |||||
| .if defined(SYMBOLS_REF_MD) | |||||
Not Done Inline Actionsfwiw this whole for loop can be replaced with ie. treat .MAKESYSFLAGS as one big string, lose the space after -m sjg: fwiw this whole for loop can be replaced with
`_mpath := ${.MAKEFLAGS:tW:S/-m /-m/g:tw:M-m*:S/… | |||||
| _SYMBOLS_REF_ARCH= -${MACHINE_ARCH} | |||||
| .else | |||||
| _SYMBOLS_REF_ARCH= | |||||
| .endif | |||||
| SYMBOLS_REF?= ${.CURDIR}/.symref${_SYMBOLS_REF_ARCH} | |||||
kibUnsubmitted Not Done Inline ActionsMy last request: can we avoid using hidden file names for symrefs? Why should we hide them? kib: My last request: can we avoid using hidden file names for symrefs? Why should we hide them? | |||||
brooksAuthorUnsubmitted Done Inline ActionsIt feels noisy to me to have them visible, particularly when they are MD, but I've waffled on this. brooks: It feels noisy to me to have them visible, particularly when they are MD, but I've waffled on… | |||||
kibUnsubmitted Not Done Inline ActionsPut them into a subdir? kib: Put them into a subdir? | |||||
| .if make(check-symbols) && ${.MAKE.LEVEL} == 1 | |||||
Done Inline ActionsThere's some argument this shouldn't include ${SHLIB_NAME} and maybe they should be dot files to keep them out of the way in the normal course of things. brooks: There's some argument this shouldn't include ${SHLIB_NAME} and maybe they should be dot files… | |||||
Done Inline Actionswhat's wrong with .if make(check-symbols) ? sjg: what's wrong with `.if make(check-symbols)` ? | |||||
| _CHECK_SYMBOLS_WARNING?= echo | |||||
| .else | |||||
| _CHECK_SYMBOLS_WARNING?= true | |||||
| .endif | |||||
| check-symbols: ${SHLIB_NAME}.symbols | |||||
| @if [ ! -e ${SYMBOLS_REF} ]; then \ | |||||
| ${_CHECK_SYMBOLS_WARNING} "WARNING: no symbol reference (${SYMBOLS_REF:T}), run 'make update-symref'" 1>&2; \ | |||||
| else \ | |||||
| if ! diff ${SYMBOLS_REF} ${SHLIB_NAME}.symbols; then \ | |||||
| echo "ERROR: symbol set changed, correct or run 'make update-symref'" 1>&2; \ | |||||
Not Done Inline ActionsFWIW I would use := here sjg: FWIW I would use `:=` here | |||||
| false; \ | |||||
| fi \ | |||||
| fi | |||||
| update-symref: ${SHLIB_NAME}.symbols | |||||
| cp ${SHLIB_NAME}.symbols ${SYMBOLS_REF} | |||||
| .endif #exists(${_SYMLIST}) && !target(${SHLIB_NAME}.symbols) | |||||
| .endif #defined(SHLIB_NAME) | .endif #defined(SHLIB_NAME) | ||||
| .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) | .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) | ||||
| _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a | _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a | ||||
| lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} | lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} | ||||
| @${ECHO} building special pic ${LIB} library | @${ECHO} building special pic ${LIB} library | ||||
| @rm -f ${.TARGET} | @rm -f ${.TARGET} | ||||
| ▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines | |||||
It is conventional to have white-space after =
same applies to all below