diff --git a/share/mk/local.dirdeps-options.mk b/share/mk/local.dirdeps-options.mk index 9e7f7bbd963c..4eef5311375e 100644 --- a/share/mk/local.dirdeps-options.mk +++ b/share/mk/local.dirdeps-options.mk @@ -1,27 +1,29 @@ # avoid duplication DIRDEPS.AUDIT.yes= lib/libbsm DIRDEPS.BLACKLIST_SUPPORT.yes+= lib/libblacklist DIRDEPS.CASPER.yes+= lib/libcasper/libcasper DIRDEPS.GSSAPI.yes+= lib/libgssapi DIRDEPS.JAIL.yes+= lib/libjail DIRDEPS.KERBEROS_SUPPORT.yes+= \ kerberos5/lib/libasn1 \ kerberos5/lib/libheimbase \ kerberos5/lib/libheimipcc \ kerberos5/lib/libhx509 \ kerberos5/lib/libkrb5 \ kerberos5/lib/libroken \ kerberos5/lib/libwind DIRDEPS.NIS.yes+= \ include/rpc \ include/rpcsvc \ lib/librpcsvc DIRDEPS.OPENSSL.yes+= secure/lib/libcrypto DIRDEPS.OPENSSL.no+= lib/libmd DIRDEPS.PAM_SUPPORT.yes+= lib/libpam/libpam DIRDEPS.TCP_WRAPPERS.yes+= lib/libwrap +MK_FDT.${DEP_MACHINE} ?= yes + .-include diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 99782b856d41..2a92eea7455e 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -1,248 +1,252 @@ .if !target(_DIRDEP_USE) # we are the 1st makefile .if !defined(MK_CLANG) .include "${SRCTOP}/share/mk/src.opts.mk" .endif +# Machine-specific MK settings needed for Makefile.dirdeps.options usage +MK_FDT.i386 = no +MK_FDT.amd64 = no + # making universe is special .if defined(UNIVERSE_GUARD) # these should be done by now DIRDEPS_FILTER+= N*.host .endif # pseudo machines get no qualification .for m in ${PSEUDO_MACHINE_LIST:Nhost*} M_dep_qual_fixes += C;($m),[^/.,]*$$;\1; .endfor #.info M_dep_qual_fixes=${M_dep_qual_fixes} # Some things we never want to build for host DIRDEPS_FILTER.host = \ Ninclude* \ Nlib/csu* \ Nlib/libc \ Nlib/libcompiler_rt \ Nlib/[mn]* \ Nlib/lib[t]* \ Ngnu/lib/lib[a-r]* \ Nsecure/lib* \ Nusr.bin/xinstall* \ .if ${.MAKE.OS} == "FreeBSD" # Host libraries should mostly be excluded from the build so the # host version in /usr/lib is used. # Internal libraries need to be allowed to be built though # since they are never installed. # Cheat for including src.libnames.mk ____: # Pull in _INTERNALLIBS .include _need_host_libs= .for lib in ${_INTERNALLIBS} _need_host_libs+= ${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} .endfor .if ${MK_host_egacy} == "yes" _need_host_libs+= lib/libmd .endif N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} DIRDEPS_FILTER.host+= ${N_host_libs} .endif DIRDEPS_FILTER.host32 = ${DIRDEPS_FILTER.host} DIRDEPS_FILTER+= \ Nbin/cat.host \ ${DIRDEPS_FILTER.xtras:U} # Cleanup a buildworld's WORLDTMP so that any files generated from it # or using it will rebuild with the DIRDEPS SYSROOT. Otherwise existing # object .meta files may still reference those directories and not be # rebuilt and lead to incorrect Makefile.depend files due to lack of # .dirdep files. .if !defined(NO_CLEANUP_WORLDTMP) && exists(${OBJTOP}/tmp/_worldtmp) cleanup_worldtmp: .PHONY .NOMETA @echo "Cleaning leftover WORLDTMP from buildworld." -rm -rf ${OBJTOP}/tmp/* -chflags -R 0 ${OBJTOP}/tmp/* rm -rf ${OBJTOP}/tmp beforedirdeps: cleanup_worldtmp .endif # pseudo option for building host tools on old or non-FreeBSD host # allows us to leverage Makefile.depend.options with # DIRDEPS_OPTIONS = host_egacy # dirdeps-options.mk will qualify with ${DEP_MACHINE} (and others) # before looking at the bare option. MK_host_egacy.host= ${MK_host_egacy} .endif # !target(_DIRDEP_USE) # reset this each time DIRDEPS_FILTER.xtras= .if ${DEP_MACHINE:Npkgs*} != "" DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host .endif .if ${DEP_MACHINE:Nhost*} == "" .if ${MK_host_egacy} == "yes" && ${DEP_RELDIR:Ntools/build:Ntargets/*:N*/stage} != "" DIRDEPS += tools/build .endif .else MK_host_egacy.${DEP_MACHINE}= no # this is how we can handle optional dependencies .if ${DEP_RELDIR} == "lib/libc" DIRDEPS += lib/libc_nonshared .if ${MK_SSP:Uno} != "no" DIRDEPS += lib/libssp_nonshared .endif .else DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared .endif # some optional things .if ${MK_CTF} == "yes" && ${DEP_RELDIR:Mcddl/usr.bin/ctf*} == "" DIRDEPS += \ cddl/usr.bin/ctfconvert.host \ cddl/usr.bin/ctfmerge.host .endif .if ${DEP_MACHINE:Nhost*} != "" # Add in proper libgcc (gnu or LLVM) if not building libcc and libc is needed. # Add both gcc_s and gcc_eh as dependencies as the decision to build # -static or not is not known here. .if ${DEP_RELDIR:M*libgcc*} == "" && ${DIRDEPS:U:Mlib/libc} != "" DIRDEPS+= \ lib/libgcc_eh \ lib/libgcc_s .endif .endif # Bootstrap support. Give hints to DIRDEPS if there is no Makefile.depend* # generated yet. This can be based on things such as SRC files and LIBADD. # These hints will not factor into the final Makefile.depend as only what is # used will be added in and handled via [local.]gendirdeps.mk. This is not # done for MACHINE=host builds. # XXX: Include this in local.autodep.mk as well for gendirdeps without filemon. # Only do this for main build target .if ${RELDIR} == ${DEP_RELDIR} && !defined(_RECURSING_PROGS) .for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T} .if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile}) _have_depfile= .endif .endfor .if !defined(_have_depfile) # KMOD does not use any stdlibs. .if !defined(KMOD) # Gather PROGS dependencies first .if !empty(PROGS) _PROGS_LIBADD= _PROGS_DPADD= _PROGS_SRCS= .for _prog in ${PROGS} .for s in . _ .if !empty(LIBADD${s}${_prog}) _PROGS_LIBADD+= ${LIBADD${s}${_prog}} .endif .if !empty(DPADD${s}${_prog}) _PROGS_DPADD+= ${DPADD${s}${_prog}} .endif .if !empty(SRCS${s}${_prog}) _PROGS_SRCS+= ${SRCS${s}${_prog}} .endif .endfor # .for s in . _ # Add in assumed source (bsd.prog.mk) .if !target(${_prog}) .if defined(PROG_CXX) _PROGS_SRCS+= ${_prog}.cc .else _PROGS_SRCS+= ${_prog}.c .endif .endif # !target(${_prog}) .endfor # .for _prog in ${PROGS} .endif # !empty(PROGS) _SRCS= ${SRCS} ${_PROGS_SRCS} # Has C files. The C_DIRDEPS are shared with C++ files as well. C_DIRDEPS= \ include \ include/arpa \ include/protocols \ include/rpc \ include/rpcsvc \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ # libgcc is needed as well but is added later. .if ${MK_GSSAPI} != "no" C_DIRDEPS+= include/gssapi .endif .if !empty(_SRCS:M*.c) DIRDEPS+= ${C_DIRDEPS} .endif # Has C++ files .if !empty(_SRCS:M*.cc) || !empty(_SRCS:M*.C) || !empty(_SRCS:M*.cpp) || \ !empty(_SRCS:M*.cxx) DIRDEPS+= ${C_DIRDEPS} .if ${MK_CLANG} == "yes" DIRDEPS+= lib/libc++ lib/libcxxrt .endif # XXX: Clang and GCC always adds -lm currently, even when not needed. DIRDEPS+= lib/msun .endif # CXX .endif # !defined(KMOD) # Has yacc files. .if !empty(_SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host .endif _DPADD= ${DPADD} ${_PROGS_DPADD} .if !empty(_DPADD) # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. _DP_DIRDEPS= \ ${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs .if !empty(_DP_DIRDEPS) DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif .endif # !empty(DPADD) _ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD} .if !empty(_ALL_LIBADD) # Also handle LIBADD for non-internal libraries. .for _lib in ${_ALL_LIBADD:O:u} _lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} .if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \ exists(${SRCTOP}/${_lib${_lib}reldir}) DIRDEPS+= ${_lib${_lib}reldir} .endif .endfor .endif # !empty(LIBADD) .endif # no Makefile.depend* .endif # ${RELDIR} == ${DEP_RELDIR} .endif # ${DEP_MACHINE} != "host" .if ${MK_STAGING} == "yes" # we need targets/pseudo/stage to prep the stage tree .if ${DEP_RELDIR:N.:N${SRCTOP}:N*pseudo/stage} != "" DIRDEPS += targets/pseudo/stage .endif .endif DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}} DEP_MACHINE_CPUARCH = ${DEP_MACHINE_ARCH:${__TO_CPUARCH}} CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH} CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}} BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}} KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}} .-include diff --git a/stand/efi/fdt/Makefile.depend b/stand/efi/fdt/Makefile.depend index 15a1f9c07f7c..18537add9fe3 100644 --- a/stand/efi/fdt/Makefile.depend +++ b/stand/efi/fdt/Makefile.depend @@ -1,12 +1,11 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/xlocale \ + stand/libsa \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/libefi/Makefile.depend b/stand/efi/libefi/Makefile.depend index 18537add9fe3..8a29d17bb768 100644 --- a/stand/efi/libefi/Makefile.depend +++ b/stand/efi/libefi/Makefile.depend @@ -1,11 +1,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ stand/libsa \ + usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/loader/Makefile.depend b/stand/efi/loader/Makefile.depend index 96a148bee2d7..ae9e6b6efaa4 100644 --- a/stand/efi/loader/Makefile.depend +++ b/stand/efi/loader/Makefile.depend @@ -1,13 +1,14 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + bin/sh.host \ stand/efi/libefi \ - stand/ficl \ stand/libsa \ + usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/loader/Makefile.depend.arm b/stand/efi/loader/Makefile.depend.arm index 8eb92e94c6e0..4ba1445d8a5f 100644 --- a/stand/efi/loader/Makefile.depend.arm +++ b/stand/efi/loader/Makefile.depend.arm @@ -1,17 +1,16 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ bin/sh.host \ stand/efi/fdt \ stand/efi/libefi \ stand/fdt \ stand/libsa \ usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/loader/Makefile.depend.arm64 b/stand/efi/loader/Makefile.depend.arm64 index 8eb92e94c6e0..4ba1445d8a5f 100644 --- a/stand/efi/loader/Makefile.depend.arm64 +++ b/stand/efi/loader/Makefile.depend.arm64 @@ -1,17 +1,16 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ bin/sh.host \ stand/efi/fdt \ stand/efi/libefi \ stand/fdt \ stand/libsa \ usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/loader/Makefile.depend.options b/stand/efi/loader/Makefile.depend.options new file mode 100644 index 000000000000..20292bab9bcd --- /dev/null +++ b/stand/efi/loader/Makefile.depend.options @@ -0,0 +1,7 @@ +# options that impact our dependencies +DIRDEPS_OPTIONS = LOADER_LUA + +DIRDEPS.LOADER_LUA.yes += \ + stand/liblua \ + +.include diff --git a/stand/efi/loader/Makefile.depend.arm b/stand/efi/loader/Makefile.depend.riscv similarity index 95% copy from stand/efi/loader/Makefile.depend.arm copy to stand/efi/loader/Makefile.depend.riscv index 8eb92e94c6e0..4ba1445d8a5f 100644 --- a/stand/efi/loader/Makefile.depend.arm +++ b/stand/efi/loader/Makefile.depend.riscv @@ -1,17 +1,16 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ bin/sh.host \ stand/efi/fdt \ stand/efi/libefi \ stand/fdt \ stand/libsa \ usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/fdt/Makefile.depend b/stand/fdt/Makefile.depend index 15a1f9c07f7c..18537add9fe3 100644 --- a/stand/fdt/Makefile.depend +++ b/stand/fdt/Makefile.depend @@ -1,12 +1,11 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/xlocale \ + stand/libsa \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/ficl/Makefile.depend b/stand/ficl/Makefile.depend index 18537add9fe3..8a29d17bb768 100644 --- a/stand/ficl/Makefile.depend +++ b/stand/ficl/Makefile.depend @@ -1,11 +1,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ stand/libsa \ + usr.bin/awk.host \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/i386/libi386/Makefile.depend b/stand/i386/libi386/Makefile.depend index 18537add9fe3..15a1f9c07f7c 100644 --- a/stand/i386/libi386/Makefile.depend +++ b/stand/i386/libi386/Makefile.depend @@ -1,11 +1,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - stand/libsa \ + include \ + include/xlocale \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/i386/loader/Makefile.depend b/stand/i386/loader/Makefile.depend index 9262a05207b6..c687ef93d84e 100644 --- a/stand/i386/loader/Makefile.depend +++ b/stand/i386/loader/Makefile.depend @@ -1,16 +1,15 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - stand/ficl \ stand/i386/btx/btx \ stand/i386/btx/btxldr \ stand/i386/btx/lib \ stand/i386/libi386 \ stand/libsa \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/i386/loader/Makefile.depend.options b/stand/i386/loader/Makefile.depend.options new file mode 100644 index 000000000000..7527fa4bda17 --- /dev/null +++ b/stand/i386/loader/Makefile.depend.options @@ -0,0 +1,10 @@ +DIRDEPS_OPTIONS = FORTH LOADER_LUA + +DIRDEPS.FORTH.yes += \ + stand/ficl \ + +DIRDEPS.LOADER_LUA.yes += \ + stand/liblua \ + stand/lua \ + +.include diff --git a/stand/ficl/Makefile.depend b/stand/i386/loader_lua/Makefile.depend similarity index 91% copy from stand/ficl/Makefile.depend copy to stand/i386/loader_lua/Makefile.depend index 18537add9fe3..993ab0638f4a 100644 --- a/stand/ficl/Makefile.depend +++ b/stand/i386/loader_lua/Makefile.depend @@ -1,11 +1,11 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - stand/libsa \ + include \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/ficl/Makefile.depend b/stand/lua/Makefile.depend similarity index 91% copy from stand/ficl/Makefile.depend copy to stand/lua/Makefile.depend index 18537add9fe3..11aba52f82cf 100644 --- a/stand/ficl/Makefile.depend +++ b/stand/lua/Makefile.depend @@ -1,11 +1,10 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - stand/libsa \ .include .if ${DEP_RELDIR} == ${_DEP_RELDIR} # local dependencies - needed for -jN in clean tree .endif diff --git a/stand/efi/fdt/Makefile.depend b/stand/powerpc/ofw/Makefile.depend similarity index 100% copy from stand/efi/fdt/Makefile.depend copy to stand/powerpc/ofw/Makefile.depend diff --git a/stand/uboot/Makefile.depend.options b/stand/uboot/Makefile.depend.options new file mode 100644 index 000000000000..d70bc7edd168 --- /dev/null +++ b/stand/uboot/Makefile.depend.options @@ -0,0 +1,9 @@ +DIRDEPS_OPTIONS = FORTH LOADER_LUA + +DIRDEPS.FORTH.yes += \ + stand/ficl \ + +DIRDEPS.LOADER_LUA.yes += \ + stand/lua \ + +.include diff --git a/targets/pseudo/loader/Makefile b/targets/pseudo/loader/Makefile new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/targets/pseudo/loader/Makefile @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/targets/pseudo/loader/Makefile.depend.amd64 b/targets/pseudo/loader/Makefile.depend.amd64 new file mode 100644 index 000000000000..8e9a786ba236 --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.amd64 @@ -0,0 +1,7 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/efi/loader \ + + +.include diff --git a/targets/pseudo/loader/Makefile.depend.arm b/targets/pseudo/loader/Makefile.depend.arm new file mode 100644 index 000000000000..d23148b537fe --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.arm @@ -0,0 +1,8 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/efi/loader \ + stand/uboot \ + + +.include diff --git a/targets/pseudo/loader/Makefile.depend.arm64 b/targets/pseudo/loader/Makefile.depend.arm64 new file mode 100644 index 000000000000..8e9a786ba236 --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.arm64 @@ -0,0 +1,7 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/efi/loader \ + + +.include diff --git a/targets/pseudo/loader/Makefile.depend.i386 b/targets/pseudo/loader/Makefile.depend.i386 new file mode 100644 index 000000000000..29a2092b8203 --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.i386 @@ -0,0 +1,7 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/i386/loader \ + + +.include diff --git a/targets/pseudo/loader/Makefile.depend.powerpc b/targets/pseudo/loader/Makefile.depend.powerpc new file mode 100644 index 000000000000..6c481c73d253 --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.powerpc @@ -0,0 +1,7 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/uboot \ + + +.include diff --git a/targets/pseudo/loader/Makefile.depend.riscv b/targets/pseudo/loader/Makefile.depend.riscv new file mode 100644 index 000000000000..8e9a786ba236 --- /dev/null +++ b/targets/pseudo/loader/Makefile.depend.riscv @@ -0,0 +1,7 @@ +# This file is not autogenerated - take care! + +DIRDEPS = \ + stand/efi/loader \ + + +.include