Makefile revision 1.295 1 # $NetBSD: Makefile,v 1.295 2023/06/17 15:47:31 christos Exp $
2 # from: @(#)Makefile 5.25.1.1 (Berkeley) 5/7/91
3
4 .include <bsd.own.mk>
5
6 SUBDIR= csu .WAIT
7
8 .if (${MKGCC} != "no")
9 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
10 .endif
11
12 SUBDIR+= libc
13 SUBDIR+= .WAIT
14
15 #
16 # The SUBDIRs above are included here for completeness but should be built
17 # and installed prior to make(dependall) in this file, as libraries listed
18 # below will depend on versions from DESTDIR only.
19 #
20
21 SUBDIR+= i18n_module
22
23 SUBDIR+= libarch \
24 libbluetooth libbsdmalloc libbz2 \
25 libcompat libcrypt \
26 libintl libipsec libkvm libm \
27 libossaudio libpci libposix libprop libpthread \
28 libpuffs libresolv librmt librpcsvc librt \
29 libtelnet libterminfo \
30 libusbhid libutil liby libz
31
32 .if !defined(BSD_MK_COMPAT_FILE)
33 SUBDIR+= libkern
34 .endif
35
36 .if (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
37 SUBDIR+= libc_aligned
38 .endif
39 .if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
40 LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
41 LIBC_MACHINE_CPU?=${MACHINE_CPU}
42 .if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
43 SUBDIR+= libc_vfp
44 .endif
45 .endif
46 .if ${MACHINE_MIPS64}
47 SUBDIR+= libc_fp
48 .endif
49 .if (${MKRUMP} != "no")
50 SUBDIR+= librumpclient
51 .endif
52 .if (${MKSKEY} != "no")
53 SUBDIR+= libskey
54 .endif
55
56 .if ${HAVE_NVMM:Uno} == "yes" && !defined(MLIBDIR)
57 SUBDIR+= libnvmm
58 .endif
59
60 .if (${MKARGON2} != "no")
61 SUBDIR+= ../external/apache2/argon2/lib/libargon2
62 .endif
63
64 .if (${MKMDNS} != "no")
65 SUBDIR+= ../external/apache2/mDNSResponder/lib
66 .endif
67
68 SUBDIR+= ../external/bsd/am-utils/lib
69
70 SUBDIR+= ../external/bsd/flex/lib
71 SUBDIR+= ../external/bsd/tre/lib
72 SUBDIR+= ../external/bsd/elftoolchain/lib
73 SUBDIR+= ../external/bsd/liblzf/lib
74 SUBDIR+= ../external/bsd/libpcap/lib
75
76 .if ${MKSLJIT} != "no"
77 SUBDIR+= ../external/bsd/sljit/lib
78 SUBDIR+= libbpfjit
79 .endif
80
81 SUBDIR+= ../external/bsd/libnv/lib
82
83 .if (${MKZFS} != "no")
84 SUBDIR+= ../external/cddl/osnet/lib/libavl
85 SUBDIR+= ../external/cddl/osnet/lib/libnvpair
86 SUBDIR+= ../external/cddl/osnet/lib/libumem
87 SUBDIR+= ../external/cddl/osnet/lib/libuutil
88 .endif
89
90 SUBDIR+= ../external/mit/expat/lib
91
92 SUBDIR+= ../external/gpl2/libmalloc
93
94 SUBDIR+= ../external/bsd/jemalloc/lib
95
96 .if (${MKGCC} != "no")
97 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
98 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
99 # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
100 # specific build area, but we get better parallelism this way.
101 # We don't build compat versions of these.
102 . if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
103 SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
104 SUBDIR+= ../external/lgpl3/mpfr/lib/libmpfr
105 SUBDIR+= ../external/lgpl3/mpc/lib/libmpc
106 . endif
107 .endif
108
109 #
110 # Libraries that depend upon any listed previously
111 # (and those that depend upon these [and ...])
112 #
113 #==================== 1st library dependency barrier ====================
114 SUBDIR+= .WAIT
115
116 .if ${MKDTRACE} != "no"
117 SUBDIR+= ../external/bsd/librtld_db/lib # depends on libutil
118 .endif
119
120 .if ${MKCTF} != "no"
121 SUBDIR+= ../external/cddl/osnet/lib/libctf
122 .endif
123
124 SUBDIR+= ../external/public-domain/xz/lib # depends on libpthread
125 SUBDIR+= ../crypto/external/bsd/netpgp/libmj
126 SUBDIR+= ../crypto/external/bsd/netpgp/lib/verify # depends on libz
127 SUBDIR+= ../external/bsd/blocklist/lib # depends on libpthread
128 SUBDIR+= ../external/mit/lua/lib # depends on libm
129 SUBDIR+= ../external/public-domain/sqlite/lib # depends on libm
130 SUBDIR+= libcurses # depends on libterminfo
131 SUBDIR+= libdm # depends on libprop
132 SUBDIR+= libedit # depends on libterminfo
133 SUBDIR+= libexecinfo # depends on libelf
134 SUBDIR+= libppath # depends on libprop
135 SUBDIR+= libperfuse # depends on libpuffs
136 SUBDIR+= libquota # depends on libprop and librpcsvc
137 SUBDIR+= librefuse # depends on libpuffs
138 SUBDIR+= libisns # depends on libpthread
139 .if (${MKRUMP} != "no")
140 SUBDIR+= librumphijack # depends on librumpclient and libpthread
141 SUBDIR+= librumpres # depends on librumpclient
142 SUBDIR+= librumpuser # depends on libpthread
143 .endif
144
145 .if (${MKNPF} != "no")
146 SUBDIR+= libnpf # depends on libnv
147 .endif
148
149 OSSL=../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/
150 .include "${.CURDIR}/${OSSL}Makefile.subdir" # depends on libcrypt
151
152 .if (${MKISCSI} != "no")
153 SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
154 .endif
155
156 .if (${MKZFS} != "no")
157 SUBDIR+= ../external/cddl/osnet/lib/libzfs_core
158 SUBDIR+= ../external/cddl/osnet/lib/libzpool
159 .endif
160
161 .if (${MKLVM} != "no")
162 SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
163 .endif
164
165 .if (${MKBINUTILS} != "no")
166 SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
167 .endif
168
169 .if (${MKLIBCXX} != "no")
170 SUBDIR+= ../external/bsd/libc++
171 .endif
172
173 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
174 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
175 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
176 .endif
177
178 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
179 SUBDIR+= ../external/apache2/llvm/include
180 .endif
181
182 SUBDIR+= ../external/mit/libcbor/lib
183
184 SUBDIR+= ../external/mit/libuv/lib
185 #==================== 2nd library dependency barrier ====================
186 SUBDIR+= .WAIT
187
188 SUBDIR+= libwrap
189
190 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
191 .for sanitizer in asan lsan ubsan
192 .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
193 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
194 .endif
195 .endfor
196 .endif
197
198 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
199 SUBDIR+= ../external/apache2/llvm/librt
200 .endif
201
202 SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
203
204 SUBDIR+= ../external/bsd/file/lib # depends on libz, libbz2, libxz
205
206 .if (${MKNPF} != "no")
207 SUBDIR+= npf # depends on libnpf
208 .endif
209
210 .if (${MKATF} != "no")
211 SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
212 .endif
213
214 .if (${MKKYUA} != "no")
215 SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
216 .endif
217
218 SUBDIR+= libform # depends on libcurses
219 SUBDIR+= libmenu # depends on libcurses
220 SUBDIR+= libpanel # depends on libcurses
221 SUBDIR+= libradius # depends on libcrypto
222 .if (${MKRUMP} != "no")
223 SUBDIR+= librump # depends on librumpuser
224 .endif
225
226 .if (${MKKERBEROS} != "no")
227 SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
228 # libedit, libterminfo,
229 .endif
230
231 SUBDIR+= ../external/bsd/libfido2/lib # depends on libcbor
232 SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
233 SUBDIR+= ../external/bsd/libevent/lib # depends on libcrypto
234 .if ${MKDTRACE} != "no"
235 SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
236 .endif
237 SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
238
239 .if (${MKLDAP} != "no")
240 SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
241 .endif
242
243 .if (${MKZFS} != "no")
244 SUBDIR+= ../external/cddl/osnet/lib/libzfs
245 .endif
246
247 SUBDIR+= ../libexec/httpd/libbozohttpd # depends on libssl & libcrypto
248
249 #==================== 3rd library dependency barrier ====================
250 SUBDIR+= .WAIT
251
252 SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz,
253 # libfido2
254 SUBDIR+= ../crypto/external/bsd/netpgp/bindings/lua # depends on netpgp/lib
255 SUBDIR+= ../external/mpl/bind/lib # depends on heimdal, libcrypto
256 # libuv
257 .if ${MKUNBOUND} != "no"
258 SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
259 .endif
260
261 .if ${MKDTRACE} != "no"
262 SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
263 .endif
264
265 .if (${MKRUMP} != "no")
266 SUBDIR+= librumpdev # depends on librump
267 SUBDIR+= librumpnet # depends on librump
268 SUBDIR+= librumpvfs # depends on librump
269 .endif
270
271 SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
272 SUBDIR+= ../external/bsd/mdocml/lib
273
274 #==================== 4th library dependency barrier ====================
275 SUBDIR+= .WAIT
276
277 .if (${MKPAM} != "no")
278 SUBDIR+= libpam # depends on heimdal, libssh
279 .endif
280
281
282 .if (${MKRUMP} != "no")
283 SUBDIR+= libukfs # depends on librumpvfs, librump
284 .endif
285
286 .if (${MKTPM} != "no")
287 SUBDIR+= ../crypto/external/cpl/trousers/lib
288 .endif
289
290 #==================== 5th library dependency barrier ====================
291 SUBDIR+= .WAIT
292
293 .if (${MKPAM} != "no")
294 SUBDIR+= ../external/bsd/pam-u2f/lib # depends on libpam
295 .endif
296
297 .if (${MKRUMP} != "no")
298 SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
299 .endif
300
301 .if (${MKTPM} != "no")
302 SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
303 .endif
304
305 .if (${MKRUMP} != "no")
306 .if !defined(BSD_MK_COMPAT_FILE)
307 SUBDIR+= ../sys/rump/dev/lib
308 SUBDIR+= ../sys/rump/fs/lib
309 SUBDIR+= ../sys/rump/kern/lib
310 SUBDIR+= ../sys/rump/net/lib
311 .endif
312 .endif
313
314 # Lua bindings come last, they might depend on anything
315 SUBDIR+= lua
316
317 .include <bsd.buildinstall.mk>
318 .include <bsd.subdir.mk>
319