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