2 .if !target(_DIRDEP_USE)
3 # we are the 1st makefile
6 .include "${SRCTOP}/share/mk/src.opts.mk"
9 # DEP_MACHINE is set before we get here, this may not be.
10 DEP_RELDIR ?= ${RELDIR}
12 .if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS)
13 # This little trick let's us do
15 # mk -f dirdeps.mk some/dir.i386,bsd
17 DIRDEPS := ${.TARGETS:M*/*}
21 # making universe is special
22 .if defined(UNIVERSE_GUARD)
23 # these should be done by now
24 DIRDEPS_FILTER+= N*.host
27 # pseudo machines get no qualification
29 M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
32 #.info M_dep_qual_fixes=${M_dep_qual_fixes}
33 # we want to supress these dependencies for host tools
34 # but some libs are sadly needed.
41 N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}}
42 DIRDEPS_FILTER.host = \
54 ${DIRDEPS_FILTER.xtras:U}
57 # reset this each time
59 .if ${DEP_MACHINE:Npkgs*} != ""
60 DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host
63 .if ${DEP_MACHINE} != "host"
65 # this is how we can handle optional dependencies
66 .if ${DEP_RELDIR} == "lib/libc"
67 DIRDEPS += lib/libc_nonshared
68 .if ${MK_SSP:Uno} != "no"
69 DIRDEPS += gnu/lib/libssp/libssp_nonshared
72 DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared
75 # some optional things
76 .if ${MK_CTF} == "yes" && ${DEP_RELDIR:Mcddl/usr.bin/ctf*} == ""
78 cddl/usr.bin/ctfconvert.host \
79 cddl/usr.bin/ctfmerge.host
84 .if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == ""
85 DIRDEPS+= lib/clang/include
88 .if ${MK_STAGING} == "yes"
89 # we need targets/pseudo/stage to prep the stage tree
90 .if ${DEP_RELDIR} != "targets/pseudo/stage"
91 DIRDEPS += targets/pseudo/stage
95 DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}}
96 CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH}
97 CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}}
98 BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}}
99 KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}}