]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/local.dirdeps.mk
Document bsd.progs.mk and add more variables overrides.
[FreeBSD/FreeBSD.git] / share / mk / local.dirdeps.mk
1 # $FreeBSD$
2 .if !target(_DIRDEP_USE)
3 # we are the 1st makefile
4
5 .if !defined(MK_CLANG)
6 .include "${SRCTOP}/share/mk/src.opts.mk"
7 .endif
8
9 # DEP_MACHINE is set before we get here, this may not be.
10 DEP_RELDIR ?= ${RELDIR}
11
12 .if ${.TARGETS:Uall:M*/*} && empty(DIRDEPS)
13 # This little trick let's us do
14 #
15 # mk -f dirdeps.mk some/dir.i386,bsd
16 #
17 DIRDEPS := ${.TARGETS:M*/*}
18 ${.TARGETS:Nall}: all
19 .endif
20
21 # making universe is special
22 .if defined(UNIVERSE_GUARD)
23 # these should be done by now
24 DIRDEPS_FILTER+= N*.host
25 .endif
26
27 # pseudo machines get no qualification
28 .for m in host common
29 M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
30 .endfor
31
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.
35 _need_host_libs= \
36         lib/libc++ \
37         lib/libcxxrt \
38         lib/libdwarf \
39         lib/libmd \
40
41 N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}}
42 DIRDEPS_FILTER.host = \
43         ${N_host_libs} \
44         Ninclude* \
45         Nlib/csu* \
46         Nlib/[mn]* \
47         Ngnu/lib/csu* \
48         Ngnu/lib/lib[a-r]* \
49         Nusr.bin/xinstall* \
50
51
52 DIRDEPS_FILTER+= \
53         Nbin/cat.host \
54         ${DIRDEPS_FILTER.xtras:U}
55 .endif
56
57 # reset this each time
58 DIRDEPS_FILTER.xtras=
59 .if ${DEP_MACHINE:Npkgs*} != ""
60 DIRDEPS_FILTER.xtras+= Nusr.bin/clang/clang.host
61 .endif
62
63 .if ${DEP_MACHINE} != "host"
64
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
70 .endif
71 .else
72 DIRDEPS_FILTER.xtras+= Nlib/libc_nonshared
73 .endif
74
75 # some optional things
76 .if ${MK_CTF} == "yes" && ${DEP_RELDIR:Mcddl/usr.bin/ctf*} == ""
77 DIRDEPS += \
78         cddl/usr.bin/ctfconvert.host \
79         cddl/usr.bin/ctfmerge.host
80 .endif
81
82 .endif
83
84 .if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == ""
85 DIRDEPS+= lib/clang/include
86 .endif
87
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
92 .endif
93 .endif
94
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}}