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