Changeset View
Standalone View
Makefile.inc1
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
.if make(showconfig) || make(test-system-*) | .if make(showconfig) || make(test-system-*) | ||||
_MKSHOWCONFIG= t | _MKSHOWCONFIG= t | ||||
.endif | .endif | ||||
SRCDIR?= ${.CURDIR} | SRCDIR?= ${.CURDIR} | ||||
LOCALBASE?= /usr/local | LOCALBASE?= /usr/local | ||||
.include "share/mk/src.tools.mk" | |||||
# Cross toolchain changes must be in effect before bsd.compiler.mk | # Cross toolchain changes must be in effect before bsd.compiler.mk | ||||
# so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. | # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. | ||||
.if defined(CROSS_TOOLCHAIN) | .if defined(CROSS_TOOLCHAIN) | ||||
.if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk) | .if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk) | ||||
.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" | ||||
.elif exists(${CROSS_TOOLCHAIN}) | .elif exists(${CROSS_TOOLCHAIN}) | ||||
.include "${CROSS_TOOLCHAIN}" | .include "${CROSS_TOOLCHAIN}" | ||||
.else | .else | ||||
▲ Show 20 Lines • Show All 814 Lines • ▼ Show 20 Lines | |||||
IMAKE+= -DNO_ROOT METALOG=${METALOG} | IMAKE+= -DNO_ROOT METALOG=${METALOG} | ||||
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} | INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} | ||||
MTREEFLAGS+= -W | MTREEFLAGS+= -W | ||||
.endif | .endif | ||||
.if defined(BUILD_PKGS) | .if defined(BUILD_PKGS) | ||||
INSTALLFLAGS+= -h sha256 | INSTALLFLAGS+= -h sha256 | ||||
.endif | .endif | ||||
.if defined(DB_FROM_SRC) || defined(NO_ROOT) | .if defined(DB_FROM_SRC) || defined(NO_ROOT) | ||||
IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" | IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" | ||||
IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}" | IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" | ||||
rgrimes: I repeat again, this should just be ${INSTALL} and so far ngie has made no valid assertion that… | |||||
Done Inline ActionsWell, unlike original commit this change deliberately added INSTALL_CMD for consistency with other tools. The expectation is that XYZ_CMD might be something one can fiddle with, while XYZ could be whatever build system needs to do its magic. sobomax: Well, unlike original commit this change deliberately added INSTALL_CMD for consistency with… | |||||
Not Done Inline ActionsAnyone having recersion issues with this? I know it well work but now we are overloading what MTREE_CMD is to mean. Is it the command only "mtree", or is it the command with the flags? I am also pretty sure this IMAKE_foo and all the related DESTDIR/WORLDTMP stuff should be pushed back down in etc/Makefile and not be in this Makefile.inc1. That would also push and cleanup much of the related stuff here. rgrimes: Anyone having recersion issues with this? I know it well work but now we are overloading what… | |||||
Done Inline Actions@rgrimes in our use case we pass arguments into _CMD override already, in fact we rely on it. So distinction is pretty much nil in practice. Could be either. This might look bit odd, but it works. I would not really feel comfortable touching IMAKE_foo with a six-foot pole. Someone with better understanding of the build system and way more time available is needed to tackle that. sobomax: @rgrimes in our use case we pass arguments into _CMD override already, in fact we rely on it. | |||||
.endif | .endif | ||||
DESTDIR_MTREEFLAGS= -deU | DESTDIR_MTREEFLAGS= -deU | ||||
# When creating worldtmp we don't need to set the directories as owned by root | # When creating worldtmp we don't need to set the directories as owned by root | ||||
# so we also pass -W | # so we also pass -W | ||||
WORLDTMP_MTREEFLAGS= -deUW | WORLDTMP_MTREEFLAGS= -deUW | ||||
.if defined(NO_ROOT) | .if defined(NO_ROOT) | ||||
# When building with -DNO_ROOT we shouldn't be changing the directories | # When building with -DNO_ROOT we shouldn't be changing the directories | ||||
# that are created by mtree to be owned by root/wheel. | # that are created by mtree to be owned by root/wheel. | ||||
DESTDIR_MTREEFLAGS+= -W | DESTDIR_MTREEFLAGS+= -W | ||||
.endif | .endif | ||||
MTREE?= mtree | DISTR_MTREE= ${MTREE_CMD} | ||||
Not Done Inline ActionsPlease no, MTREE is used elsewhere, the original source of this stuff here infact, and is the list of etc/mtree/* files that are to be processed. And again 2 variables that end up being "mtree" should always be colapsed to 1 variable. MTREE was already taken, the correct variable for this is then MTREE_CMD and MTREE has another meaning. rgrimes: Please no, MTREE is used elsewhere, the original source of this stuff here infact, and is the… | |||||
.if ${BUILD_WITH_STRICT_TMPPATH} != 0 | .if ${BUILD_WITH_STRICT_TMPPATH} != 0 | ||||
MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree | DISTR_MTREE= ${WORLDTMP}/legacy/usr/sbin/mtree | ||||
Not Done Inline ActionsMTREE_CMD= should be used here to be properly consistent rgrimes: MTREE_CMD= should be used here to be properly consistent | |||||
Done Inline ActionsI respectfully disagree with this. The whole point of having MAKE_CMD is that it should never be thrown away, especially in a file that might be included into other places. If the build system needs to use something else for a particular target (${WORLDTMP}/legacy/usr/sbin/mtree) at some point, it then should construct a new variable out and use that. I've renamed variable to clarify its scope. sobomax: I respectfully disagree with this. The whole point of having MAKE_CMD is that it should never… | |||||
.endif | .endif | ||||
WORLDTMP_MTREE= ${MTREE} ${WORLDTMP_MTREEFLAGS} | WORLDTMP_MTREE= ${DISTR_MTREE} ${WORLDTMP_MTREEFLAGS} | ||||
DESTDIR_MTREE= ${MTREE} ${DESTDIR_MTREEFLAGS} | DESTDIR_MTREE= ${DISTR_MTREE} ${DESTDIR_MTREEFLAGS} | ||||
Not Done Inline ActionsMTREE_CMD in these two rgrimes: MTREE_CMD in these two | |||||
# kernel stage | # kernel stage | ||||
KMAKEENV= ${WMAKEENV:NSYSROOT=*} | KMAKEENV= ${WMAKEENV:NSYSROOT=*} | ||||
KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} | KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} | ||||
# | # | ||||
# buildworld | # buildworld | ||||
# | # | ||||
▲ Show 20 Lines • Show All 456 Lines • ▼ Show 20 Lines | .if ${MK_TESTS} != "no" && ${dist} == "tests" | ||||
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ | ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ | ||||
-p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null | -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null | ||||
.if ${MK_DEBUG_FILES} != "no" | .if ${MK_DEBUG_FILES} != "no" | ||||
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ | ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ | ||||
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null | -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.if defined(NO_ROOT) | .if defined(NO_ROOT) | ||||
${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ | ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ | ||||
sed -e 's#^\./#./${dist}/#' >> ${METALOG} | sed -e 's#^\./#./${dist}/#' >> ${METALOG} | ||||
${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ | ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ | ||||
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} | sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} | ||||
${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \ | ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \ | ||||
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG} | sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG} | ||||
.if defined(LIBCOMPAT) | .if defined(LIBCOMPAT) | ||||
${IMAKEENV} ${MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \ | ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \ | ||||
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} | sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
-mkdir ${DESTDIR}/${DISTDIR}/base | -mkdir ${DESTDIR}/${DISTDIR}/base | ||||
${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ | ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ | ||||
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ | METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ | ||||
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ | DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ | ||||
▲ Show 20 Lines • Show All 1,992 Lines • Show Last 20 Lines |
I repeat again, this should just be ${INSTALL} and so far ngie has made no valid assertion that it should be otherwise.