xref: /freebsd/share/mk/local.gendirdeps.mk (revision 86c9d9918f1db7cdd968b60f8902466887bcd9e9)
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# Exclude toolchain which is handled special.
17.if ${RELDIR:Mtargets*} == ""
18.if ${RELDIR:Nusr.bin/clang/*:Ngnu/usr.bin/cc/*:Nlib/clang*} != ""
19GENDIRDEPS_FILTER.host+= \
20	Nusr.bin/clang/* \
21	Ngnu/usr.bin/cc/* \
22
23.endif
24GENDIRDEPS_FILTER_HOST_TOOLS+= \
25	Nlib/clang/include \
26	Nusr.bin/addr2line \
27	Nusr.bin/ar \
28	Nusr.bin/clang/clang \
29	Nusr.bin/elfcopy \
30	Nusr.bin/elfdump \
31	Nusr.bin/nm \
32	Nusr.bin/readelf \
33	Nusr.bin/size \
34	Nusr.bin/strings \
35	Nusr.bin/strip \
36	Ngnu/usr.bin/cc* \
37	Ngnu/usr.bin/binutils* \
38
39.if ${MACHINE} != "host"
40GENDIRDEPS_FILTER+=	${GENDIRDEPS_FILTER_HOST_TOOLS:C,$,.host,}
41.else
42GENDIRDEPS_FILTER+=	${GENDIRDEPS_FILTER_HOST_TOOLS}
43.endif
44.endif
45
46GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER.${MACHINE}:U}
47
48# gendirdeps.mk will turn _{VAR} into ${VAR} which keeps this simple
49# order of this list matters!
50GENDIRDEPS_FILTER_DIR_VARS+= \
51       CSU_DIR \
52       BOOT_MACHINE_DIR
53
54# order of this list matters!
55GENDIRDEPS_FILTER_VARS+= \
56       KERNEL_NAME \
57       MACHINE_CPUARCH \
58       MACHINE_ARCH \
59       MACHINE
60
61GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_DIR_VARS:@v@S,${$v},_{${v}},@}
62GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u}
63