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