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