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