Makefile revision 1.298
1#	$NetBSD: Makefile,v 1.298 2024/02/25 20:25:09 mrg 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		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)
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 (${MKRUMP} != "no")
50SUBDIR+=	librumpclient
51.endif
52.if (${MKSKEY} != "no")
53SUBDIR+=	libskey
54.endif
55
56.if ${HAVE_NVMM:Uno} == "yes" && !defined(MLIBDIR)
57SUBDIR+=	libnvmm
58.endif
59
60.if (${MKARGON2} != "no")
61SUBDIR+=	../external/apache2/argon2/lib/libargon2
62.endif
63
64.if (${MKMDNS} != "no")
65SUBDIR+=	../external/apache2/mDNSResponder/lib
66.endif
67
68SUBDIR+=	../external/bsd/am-utils/lib
69
70SUBDIR+=	../external/bsd/flex/lib
71SUBDIR+=	../external/bsd/tre/lib
72ELFTOOLCHAINLIB=../external/bsd/elftoolchain/lib/
73.include "${ELFTOOLCHAINLIB}Makefile.subdir"
74SUBDIR+=	../external/bsd/liblzf/lib
75SUBDIR+=	../external/bsd/libpcap/lib
76
77.if ${MKSLJIT} != "no"
78SUBDIR+=	../external/bsd/sljit/lib
79SUBDIR+=	libbpfjit
80.endif
81
82SUBDIR+=	../external/bsd/libnv/lib
83
84.if (${MKZFS} != "no")
85SUBDIR+=        ../external/cddl/osnet/lib/libavl
86SUBDIR+=        ../external/cddl/osnet/lib/libnvpair
87SUBDIR+=        ../external/cddl/osnet/lib/libumem
88SUBDIR+=        ../external/cddl/osnet/lib/libuutil
89.endif
90
91SUBDIR+=	../external/mit/expat/lib
92
93SUBDIR+=	../external/gpl2/libmalloc
94
95SUBDIR+=	../external/bsd/jemalloc/lib
96
97.if (${MKGCC} != "no")
98SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
99SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
100# Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
101# specific build area, but we get better parallelism this way.
102# We don't build compat versions of these.
103. if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
104SUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
105SUBDIR+=	../external/lgpl3/mpc/lib/libmpc
106. endif
107.endif
108
109# GCC and GDB >= 13 require GMP.
110.if !defined(MLIBDIR) && (${MKGCCCMDS} != "no" || \
111    (${MKGDB} != "no" && ${HAVE_GDB:U0} >= 1320))
112SUBDIR+=	../external/lgpl3/gmp/lib/libgmp
113.endif
114
115#
116# Libraries that depend upon any listed previously
117# (and those that depend upon these [and ...])
118#
119#==================== 1st library dependency barrier ====================
120SUBDIR+=	.WAIT
121
122.if ${MKDTRACE} != "no"
123SUBDIR+=	../external/bsd/librtld_db/lib		# depends on libutil
124.endif
125
126.if ${MKCTF} != "no"
127SUBDIR+=        ../external/cddl/osnet/lib/libctf
128.endif
129
130SUBDIR+=	../external/public-domain/xz/lib	# depends on libpthread
131SUBDIR+=	../crypto/external/bsd/netpgp/libmj
132SUBDIR+=	../crypto/external/bsd/netpgp/lib/verify # depends on libz
133SUBDIR+=	../external/bsd/blocklist/lib		# depends on libpthread
134SUBDIR+=	../external/mit/lua/lib # depends on libm
135SUBDIR+=	../external/public-domain/sqlite/lib # depends on libm
136SUBDIR+=	libcurses	# depends on libterminfo
137SUBDIR+=	libdm		# depends on libprop
138SUBDIR+=	libedit		# depends on libterminfo
139SUBDIR+=	libexecinfo 	# depends on libelf
140SUBDIR+=	libppath	# depends on libprop
141SUBDIR+=	libperfuse	# depends on libpuffs
142SUBDIR+=	libquota	# depends on libprop and librpcsvc
143SUBDIR+=	librefuse	# depends on libpuffs
144SUBDIR+=	libisns 	# depends on libpthread
145.if (${MKRUMP} != "no")
146SUBDIR+=	librumphijack	# depends on librumpclient and libpthread
147SUBDIR+=	librumpres	# depends on librumpclient
148SUBDIR+=	librumpuser	# depends on libpthread
149.endif
150
151.if (${MKNPF} != "no")
152SUBDIR+=	libnpf		# depends on libnv
153.endif
154
155OSSL=../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/
156.include "${.CURDIR}/${OSSL}Makefile.subdir" # depends on libcrypt
157
158.if (${MKISCSI} != "no")
159SUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
160.endif
161
162.if (${MKZFS} != "no")
163SUBDIR+=        ../external/cddl/osnet/lib/libzfs_core
164SUBDIR+=        ../external/cddl/osnet/lib/libzpool
165.endif
166
167.if (${MKLVM} != "no")
168SUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
169.endif
170
171.if (${MKBINUTILS} != "no")
172SUBDIR+=	../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib	# libbfd depends on libz
173.endif
174
175.if (${MKLIBCXX} != "no")
176SUBDIR+=	../external/bsd/libc++
177.endif
178
179.if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
180SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
181SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
182.endif
183
184.if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
185SUBDIR+=	../external/apache2/llvm/include
186.endif
187
188SUBDIR+=	../external/mit/libcbor/lib
189
190SUBDIR+=	../external/mit/libuv/lib
191#==================== 2nd library dependency barrier ====================
192SUBDIR+=	.WAIT
193
194SUBDIR+=	libwrap
195
196.if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no" && ${MKSANITIZER:Uno} == "yes")
197.for sanitizer in asan lsan ubsan
198.if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
199SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
200.endif
201.endfor
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
209
210SUBDIR+=	../external/bsd/file/lib	# depends on libz, libbz2, libxz
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
261#==================== 3rd library dependency barrier ====================
262SUBDIR+=	.WAIT
263
264SUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz,
265						   # libfido2
266SUBDIR+=	../crypto/external/bsd/netpgp/bindings/lua  # depends on netpgp/lib
267SUBDIR+=	../external/mpl/bind/lib	# depends on heimdal, libcrypto
268						# libuv
269.if ${MKUNBOUND} != "no"
270SUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
271.endif
272
273.if ${MKDTRACE} != "no"
274SUBDIR+=        ../external/cddl/osnet/lib/libdtrace	# depends on libproc
275.endif
276
277.if (${MKRUMP} != "no")
278SUBDIR+=	librumpdev	# depends on librump
279SUBDIR+=	librumpnet	# depends on librump
280SUBDIR+=	librumpvfs	# depends on librump
281.endif
282
283SUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
284SUBDIR+=	../external/bsd/mdocml/lib
285
286#==================== 4th library dependency barrier ====================
287SUBDIR+=	.WAIT
288
289.if (${MKPAM} != "no")
290SUBDIR+=	libpam		# depends on heimdal, libssh
291.endif
292
293
294.if (${MKRUMP} != "no")
295SUBDIR+=	libukfs		# depends on librumpvfs, librump
296.endif
297
298.if (${MKTPM} != "no")
299SUBDIR+=	../crypto/external/cpl/trousers/lib
300.endif
301
302#==================== 5th library dependency barrier ====================
303SUBDIR+=	.WAIT
304
305.if (${MKPAM} != "no")
306SUBDIR+=	../external/bsd/pam-u2f/lib	# depends on libpam
307.endif
308
309.if (${MKRUMP} != "no")
310SUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
311.endif
312
313.if (${MKTPM} != "no")
314SUBDIR+=	../crypto/external/cpl/tpm-tools/lib	# depends on trousers
315.endif
316
317.if (${MKRUMP} != "no")
318.if !defined(BSD_MK_COMPAT_FILE)
319SUBDIR+=	../sys/rump/dev/lib
320SUBDIR+=	../sys/rump/fs/lib
321SUBDIR+=	../sys/rump/kern/lib
322SUBDIR+=	../sys/rump/net/lib
323.endif
324.endif
325
326# Lua bindings come last, they might depend on anything
327SUBDIR+=	lua
328
329.include <bsd.buildinstall.mk>
330.include <bsd.subdir.mk>
331