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