1.if !target(_DIRDEP_USE) 2# we are the 1st makefile 3 4.if !defined(MK_CLANG) 5.include "${SRCTOP}/share/mk/src.opts.mk" 6.endif 7 8# DEP_MACHINE is set before we get here, this may not be. 9DEP_RELDIR ?= ${RELDIR} 10 11.if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS) 12# This little trick let's us do 13# 14# mk -f dirdeps.mk some/dir.i386,bsd 15# 16DIRDEPS := ${.TARGETS:M*/*} 17${.TARGETS:Nall}: all 18.endif 19 20# making universe is special 21.if defined(UNIVERSE_GUARD) 22# these should be done by now 23DIRDEPS_FILTER+= N*.host 24.endif 25 26# pseudo machines get no qualification 27.for m in host common 28M_dep_qual_fixes += C;($m),[^/.,]*$$;\1; 29.endfor 30 31#.info M_dep_qual_fixes=${M_dep_qual_fixes} 32# we want to supress these dependencies for host tools 33# but some libs are sadly needed. 34_need_host_libs= \ 35 lib/libc++ \ 36 lib/libcxxrt \ 37 lib/libdwarf \ 38 lib/libmd \ 39 40N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} 41DIRDEPS_FILTER.host = \ 42 ${N_host_libs} \ 43 Ninclude* \ 44 Nlib/csu* \ 45 Nlib/[mn]* \ 46 Ngnu/lib/csu* \ 47 Ngnu/lib/lib[a-r]* \ 48 Nusr.bin/xinstall* \ 49 50 51DIRDEPS_FILTER+= \ 52 ${DIRDEPS_FILTER.xtras:U} 53.endif 54 55# reset this each time 56DIRDEPS_FILTER.xtras= 57.if ${DEP_MACHINE:Npkgs*} != "" 58DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host 59.endif 60 61.if ${DEP_MACHINE} != "host" 62 63# this is how we can handle optional dependencies 64.if ${DEP_RELDIR} == "lib/libc" 65DIRDEPS += lib/libc_nonshared 66.if ${MK_SSP:Uno} != "no" 67DIRDEPS += gnu/lib/libssp/libssp_nonshared 68.endif 69.else 70DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared 71.endif 72 73# some optional things 74.if ${MK_CTF} == "yes" && ${DEP_RELDIR:Mcddl/usr.bin/ctf*} == "" 75DIRDEPS += \ 76 cddl/usr.bin/ctfconvert.host \ 77 cddl/usr.bin/ctfmerge.host 78.endif 79 80.endif 81 82.if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == "" 83DIRDEPS+= lib/clang/include 84.endif 85 86.if ${MK_STAGING} == "yes" 87# we need targets/pseudo/stage to prep the stage tree 88.if ${DEP_RELDIR} != "targets/pseudo/stage" 89DIRDEPS += targets/pseudo/stage 90.endif 91.endif 92 93CSU_DIR.i386 = csu/i386-elf 94DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}} 95CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH} 96CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}} 97BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}} 98KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}} 99