Create a mechanism for providing fine-grained build order dependencies
during SUBDIR_PARALLEL builds. This augments the coarse .WAIT mechanism, which is still useful if you've got a situation such as "almost everything depends on A and B". Because the parallel subdir mechanism uses non-obvious mangling of target names, which should probably remain a private detail of the implementation, it's not easy to do things like "libfoo: libbar", so instead the new mechanism lets you set a variable that lists dependencies: SUBDIR_DEPEND_libfoo= libgroodah libpouet Note that while I'm using libraries as an example here, it really has nothing to do with the generated library files. This is really saying "build in directory libfoo after building in the libgroodah and libpouet directories." This updates lib/Makefile with dependency information based on the old almost-accurate comment block and by combing through lib/* makefiles looking for LDADD dependencies to other libraries within lib/*. Reviewed by: Jia-Shiun Li <jiashiun@gmail.com>
This commit is contained in:
parent
b9402e3d56
commit
a1c70d6943
115
lib/Makefile
115
lib/Makefile
@ -3,82 +3,43 @@
|
|||||||
|
|
||||||
.include <src.opts.mk>
|
.include <src.opts.mk>
|
||||||
|
|
||||||
# To satisfy shared library or ELF linkage when only the libraries being
|
# The SUBDIR_ORDERED list is a small set of libraries which are used by many
|
||||||
# built are visible:
|
# of the other libraries. These are built first with a .WAIT between them
|
||||||
#
|
# and the main list to avoid needing a SUBDIR_DEPEND line on every library
|
||||||
# csu must be built before all shared libaries for ELF.
|
# naming just these few items.
|
||||||
# libc must be built before all other shared libraries.
|
|
||||||
# libbsm must be built before libauditd.
|
|
||||||
# libcom_err must be built before libpam.
|
|
||||||
# libcrypt must be built before libpam.
|
|
||||||
# libkvm must be built before libdevstat.
|
|
||||||
# libldns must be built before libunbound.
|
|
||||||
# msun must be built before libg++ and libstdc++.
|
|
||||||
# libmd must be built before libatm, libopie, libradius, and libtacplus.
|
|
||||||
# ncurses must be built before libdialog, libedit and libreadline.
|
|
||||||
# libnetgraph must be built before libbsnmp/modules/snmp_netgraph.
|
|
||||||
# libopie must be built before libpam.
|
|
||||||
# libradius must be built before libpam.
|
|
||||||
# librpcsvc must be built before libpam.
|
|
||||||
# libsbuf must be built before libcam.
|
|
||||||
# libtacplus must be built before libpam.
|
|
||||||
# libutil must be built before libpam.
|
|
||||||
# libypclnt must be built before libpam.
|
|
||||||
# libgssapi must be built before librpcsec_gss
|
|
||||||
#
|
|
||||||
# Otherwise, the SUBDIR list should be in alphabetical order.
|
|
||||||
#
|
|
||||||
# Except it appears bind needs to be compiled last
|
|
||||||
|
|
||||||
SUBDIR_ORDERED= ${_csu} \
|
SUBDIR_ORDERED= ${_csu} \
|
||||||
.WAIT \
|
.WAIT \
|
||||||
libc \
|
libc \
|
||||||
libc_nonshared \
|
libc_nonshared \
|
||||||
.WAIT \
|
|
||||||
msun \
|
|
||||||
.WAIT \
|
|
||||||
libbsm \
|
|
||||||
libauditd \
|
|
||||||
libutil \
|
|
||||||
libpjdlog \
|
|
||||||
libnv \
|
|
||||||
${_libcapsicum} \
|
|
||||||
libcompiler_rt \
|
libcompiler_rt \
|
||||||
libcrypt \
|
${_libcplusplus} \
|
||||||
libelf \
|
|
||||||
${_libiconv_modules} \
|
|
||||||
libkvm \
|
|
||||||
${_libldns} \
|
|
||||||
libmd \
|
|
||||||
ncurses \
|
|
||||||
${_libnetgraph} \
|
|
||||||
libradius \
|
|
||||||
librpcsvc \
|
|
||||||
libsbuf \
|
|
||||||
libtacplus \
|
|
||||||
${_libypclnt} \
|
|
||||||
${_libcxxrt} \
|
${_libcxxrt} \
|
||||||
${_libcplusplus}
|
libelf \
|
||||||
|
msun
|
||||||
|
|
||||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
# The main list; please keep these sorted alphabetically.
|
||||||
SUBDIR_ORDERED+= libcom_err
|
|
||||||
.endif
|
|
||||||
|
|
||||||
SUBDIR= ${SUBDIR_ORDERED} \
|
SUBDIR= ${SUBDIR_ORDERED} \
|
||||||
.WAIT \
|
.WAIT \
|
||||||
libalias \
|
libalias \
|
||||||
libarchive \
|
libarchive \
|
||||||
${_libatm} \
|
${_libatm} \
|
||||||
|
libauditd \
|
||||||
libbegemot \
|
libbegemot \
|
||||||
libblocksruntime \
|
libblocksruntime \
|
||||||
${_libbluetooth} \
|
${_libbluetooth} \
|
||||||
${_libbsnmp} \
|
${_libbsnmp} \
|
||||||
libbsdstat \
|
libbsdstat \
|
||||||
|
libbsm \
|
||||||
libbz2 \
|
libbz2 \
|
||||||
libcalendar \
|
libcalendar \
|
||||||
libcam \
|
libcam \
|
||||||
|
${_libcapsicum} \
|
||||||
${_libcasper} \
|
${_libcasper} \
|
||||||
|
${_libcom_err} \
|
||||||
libcompat \
|
libcompat \
|
||||||
|
libcrypt \
|
||||||
libdevinfo \
|
libdevinfo \
|
||||||
libdevstat \
|
libdevstat \
|
||||||
libdwarf \
|
libdwarf \
|
||||||
@ -91,26 +52,36 @@ SUBDIR= ${SUBDIR_ORDERED} \
|
|||||||
${_libgpib} \
|
${_libgpib} \
|
||||||
${_libgssapi} \
|
${_libgssapi} \
|
||||||
${_librpcsec_gss} \
|
${_librpcsec_gss} \
|
||||||
|
${_libiconv_modules} \
|
||||||
libipsec \
|
libipsec \
|
||||||
libjail \
|
libjail \
|
||||||
libkiconv \
|
libkiconv \
|
||||||
|
libkvm \
|
||||||
|
${_libldns} \
|
||||||
liblzma \
|
liblzma \
|
||||||
libmagic \
|
libmagic \
|
||||||
libmandoc \
|
libmandoc \
|
||||||
libmemstat \
|
libmemstat \
|
||||||
|
libmd \
|
||||||
${_libmilter} \
|
${_libmilter} \
|
||||||
${_libmp} \
|
${_libmp} \
|
||||||
${_libnandfs} \
|
${_libnandfs} \
|
||||||
libnetbsd \
|
libnetbsd \
|
||||||
|
${_libnetgraph} \
|
||||||
${_libngatm} \
|
${_libngatm} \
|
||||||
|
libnv \
|
||||||
libopie \
|
libopie \
|
||||||
libpam \
|
libpam \
|
||||||
libpcap \
|
libpcap \
|
||||||
|
libpjdlog \
|
||||||
${_libpmc} \
|
${_libpmc} \
|
||||||
${_libproc} \
|
${_libproc} \
|
||||||
libprocstat \
|
libprocstat \
|
||||||
|
libradius \
|
||||||
|
librpcsvc \
|
||||||
librt \
|
librt \
|
||||||
${_librtld_db} \
|
${_librtld_db} \
|
||||||
|
libsbuf \
|
||||||
${_libsdp} \
|
${_libsdp} \
|
||||||
${_libsm} \
|
${_libsm} \
|
||||||
${_libsmb} \
|
${_libsmb} \
|
||||||
@ -119,6 +90,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
|
|||||||
libstand \
|
libstand \
|
||||||
libstdbuf \
|
libstdbuf \
|
||||||
libstdthreads \
|
libstdthreads \
|
||||||
|
libtacplus \
|
||||||
${_libtelnet} \
|
${_libtelnet} \
|
||||||
${_libthr} \
|
${_libthr} \
|
||||||
libthread_db \
|
libthread_db \
|
||||||
@ -129,16 +101,51 @@ SUBDIR= ${SUBDIR_ORDERED} \
|
|||||||
${_libunbound} \
|
${_libunbound} \
|
||||||
${_libusbhid} \
|
${_libusbhid} \
|
||||||
${_libusb} \
|
${_libusb} \
|
||||||
|
libutil \
|
||||||
${_libvgl} \
|
${_libvgl} \
|
||||||
${_libvmmapi} \
|
${_libvmmapi} \
|
||||||
libwrap \
|
libwrap \
|
||||||
liby \
|
liby \
|
||||||
|
${_libypclnt} \
|
||||||
libz \
|
libz \
|
||||||
|
ncurses \
|
||||||
${_atf} \
|
${_atf} \
|
||||||
${_clang} \
|
${_clang} \
|
||||||
${_cuse} \
|
${_cuse} \
|
||||||
${_tests}
|
${_tests}
|
||||||
|
|
||||||
|
# Inter-library dependencies. When the makefile for a library contains LDADD
|
||||||
|
# libraries, those libraries should be listed as build order dependencies here.
|
||||||
|
|
||||||
|
SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
|
||||||
|
SUBDIR_DEPEND_libatm= libmd
|
||||||
|
SUBDIR_DEPEND_libauditdm= libbsm
|
||||||
|
SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
|
||||||
|
SUBDIR_DEPEND_libc++= libcxxrt
|
||||||
|
SUBDIR_DEPEND_libc= libcompiler_rt
|
||||||
|
SUBDIR_DEPEND_libcam= libsbuf
|
||||||
|
SUBDIR_DEPEND_libcapsicum= libnv
|
||||||
|
SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog
|
||||||
|
SUBDIR_DEPEND_libdevstat= libkvm
|
||||||
|
SUBDIR_DEPEND_libdiaglog= ncurses
|
||||||
|
SUBDIR_DEPEND_libedit= ncurses
|
||||||
|
SUBDIR_DEPEND_libg++= msun
|
||||||
|
SUBDIR_DEPEND_libgeom= libexpat libsbuf
|
||||||
|
SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
|
||||||
|
SUBDIR_DEPEND_libmagic= libz
|
||||||
|
SUBDIR_DEPEND_libmemstat= libkvm
|
||||||
|
SUBDIR_DEPEND_libopie= libmd
|
||||||
|
SUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
|
||||||
|
SUBDIR_DEPEND_libpjdlog= libutil
|
||||||
|
SUBDIR_DEPEND_libprocstat= libkvm libutil
|
||||||
|
SUBDIR_DEPEND_libradius= libmd
|
||||||
|
SUBDIR_DEPEND_libreadline= ncurses
|
||||||
|
SUBDIR_DEPEND_libsmb= libkiconv
|
||||||
|
SUBDIR_DEPEND_libstdc++= msun
|
||||||
|
SUBDIR_DEPEND_libtacplus= libmd
|
||||||
|
SUBDIR_DEPEND_libulog= libmd
|
||||||
|
SUBDIR_DEPEND_libunbound= ${_libldns}
|
||||||
|
|
||||||
.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
|
.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
|
||||||
_csu=csu/${MACHINE_ARCH}-elf
|
_csu=csu/${MACHINE_ARCH}-elf
|
||||||
.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
|
.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
|
||||||
@ -190,6 +197,10 @@ _librpcsec_gss= librpcsec_gss
|
|||||||
_libiconv_modules= libiconv_modules
|
_libiconv_modules= libiconv_modules
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||||
|
_libcom_err= libcom_err
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${MK_LDNS} != "no"
|
.if ${MK_LDNS} != "no"
|
||||||
_libldns= libldns
|
_libldns= libldns
|
||||||
.endif
|
.endif
|
||||||
|
@ -80,7 +80,11 @@ __subdir_targets=
|
|||||||
__subdir_targets+= .WAIT
|
__subdir_targets+= .WAIT
|
||||||
.else
|
.else
|
||||||
__subdir_targets+= ${__target}_subdir_${__dir}
|
__subdir_targets+= ${__target}_subdir_${__dir}
|
||||||
${__target}_subdir_${__dir}: .MAKE
|
__deps=
|
||||||
|
.for __dep in ${SUBDIR_DEPEND_${__dir}}
|
||||||
|
__deps+= ${__target}_subdir_${__dep}
|
||||||
|
.endfor
|
||||||
|
${__target}_subdir_${__dir}: .MAKE ${__deps}
|
||||||
.if !defined(NO_SUBDIR)
|
.if !defined(NO_SUBDIR)
|
||||||
@${_+_}set -e; \
|
@${_+_}set -e; \
|
||||||
if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
|
if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
|
||||||
|
Loading…
Reference in New Issue
Block a user