xref: /freebsd/share/mk/local.gendirdeps.mk (revision 792bbaba989533a1fc93823df1720c8c4aaf0442)
1# $FreeBSD$
2
3# we need a keyword, this noise is to prevent it being expanded
4GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @:M*F*}';
5
6# suppress optional/auto dependencies
7# local.dirdeps.mk will put them in if necessary
8GENDIRDEPS_FILTER+= \
9	Nbin/cat.host \
10	Ngnu/lib/libssp/libssp_nonshared \
11	Ncddl/usr.bin/ctf* \
12	Nlib/libc_nonshared \
13	Ntargets/pseudo/stage* \
14	Ntools/*
15
16# Clang has nested directories in its OBJDIR.
17GENDIRDEPS_FILTER+= C,(lib/clang/lib[^/]*)/.*,\1,
18
19# Exclude toolchain which is handled special.
20.if ${RELDIR:Mtargets*} == ""
21.if ${RELDIR:Nusr.bin/clang/*:Ngnu/usr.bin/cc/*:Nlib/clang*} != ""
22GENDIRDEPS_FILTER.host+= \
23	Nusr.bin/clang/* \
24	Ngnu/usr.bin/cc/* \
25
26.endif
27GENDIRDEPS_FILTER_HOST_TOOLS+= \
28	Nlib/clang/headers \
29	Nusr.bin/addr2line \
30	Nusr.bin/ar \
31	Nusr.bin/clang/clang \
32	Nusr.bin/elfcopy \
33	Nusr.bin/elfdump \
34	Nusr.bin/nm \
35	Nusr.bin/readelf \
36	Nusr.bin/size \
37	Nusr.bin/strings \
38	Nusr.bin/strip \
39	Ngnu/usr.bin/cc* \
40	Ngnu/usr.bin/binutils* \
41
42.if ${MACHINE} != "host"
43GENDIRDEPS_FILTER+=	${GENDIRDEPS_FILTER_HOST_TOOLS:C,$,.host,}
44.else
45GENDIRDEPS_FILTER+=	${GENDIRDEPS_FILTER_HOST_TOOLS}
46.endif
47.endif
48
49GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER.${MACHINE}:U}
50
51# gendirdeps.mk will turn _{VAR} into ${VAR} which keeps this simple
52# order of this list matters!
53GENDIRDEPS_FILTER_DIR_VARS+= \
54       CSU_DIR \
55       BOOT_MACHINE_DIR
56
57# order of this list matters!
58GENDIRDEPS_FILTER_VARS+= \
59       KERNEL_NAME \
60       MACHINE_CPUARCH \
61       MACHINE_ARCH \
62       MACHINE
63
64GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_DIR_VARS:@v@S,${$v},_{${v}},@}
65GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u}
66