Makefile revision 1.296 1 # $NetBSD: Makefile,v 1.296 2023/08/20 02:07:54 rin 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/mpfr/lib/libmpfr
104 SUBDIR+= ../external/lgpl3/mpc/lib/libmpc
105 . endif
106 .endif
107
108 # GCC and GDB >= 13 require GMP.
109 .if !defined(MLIBDIR) && (${MKGCCCMDS} != "no" || \
110 (${MKGDB} != "no" && ${HAVE_GDB:U0} >= 1320))
111 SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
112 .endif
113
114 #
115 # Libraries that depend upon any listed previously
116 # (and those that depend upon these [and ...])
117 #
118 #==================== 1st library dependency barrier ====================
119 SUBDIR+= .WAIT
120
121 .if ${MKDTRACE} != "no"
122 SUBDIR+= ../external/bsd/librtld_db/lib # depends on libutil
123 .endif
124
125 .if ${MKCTF} != "no"
126 SUBDIR+= ../external/cddl/osnet/lib/libctf
127 .endif
128
129 SUBDIR+= ../external/public-domain/xz/lib # depends on libpthread
130 SUBDIR+= ../crypto/external/bsd/netpgp/libmj
131 SUBDIR+= ../crypto/external/bsd/netpgp/lib/verify # depends on libz
132 SUBDIR+= ../external/bsd/blocklist/lib # depends on libpthread
133 SUBDIR+= ../external/mit/lua/lib # depends on libm
134 SUBDIR+= ../external/public-domain/sqlite/lib # depends on libm
135 SUBDIR+= libcurses # depends on libterminfo
136 SUBDIR+= libdm # depends on libprop
137 SUBDIR+= libedit # depends on libterminfo
138 SUBDIR+= libexecinfo # depends on libelf
139 SUBDIR+= libppath # depends on libprop
140 SUBDIR+= libperfuse # depends on libpuffs
141 SUBDIR+= libquota # depends on libprop and librpcsvc
142 SUBDIR+= librefuse # depends on libpuffs
143 SUBDIR+= libisns # depends on libpthread
144 .if (${MKRUMP} != "no")
145 SUBDIR+= librumphijack # depends on librumpclient and libpthread
146 SUBDIR+= librumpres # depends on librumpclient
147 SUBDIR+= librumpuser # depends on libpthread
148 .endif
149
150 .if (${MKNPF} != "no")
151 SUBDIR+= libnpf # depends on libnv
152 .endif
153
154 OSSL=../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/
155 .include "${.CURDIR}/${OSSL}Makefile.subdir" # depends on libcrypt
156
157 .if (${MKISCSI} != "no")
158 SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
159 .endif
160
161 .if (${MKZFS} != "no")
162 SUBDIR+= ../external/cddl/osnet/lib/libzfs_core
163 SUBDIR+= ../external/cddl/osnet/lib/libzpool
164 .endif
165
166 .if (${MKLVM} != "no")
167 SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
168 .endif
169
170 .if (${MKBINUTILS} != "no")
171 SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
172 .endif
173
174 .if (${MKLIBCXX} != "no")
175 SUBDIR+= ../external/bsd/libc++
176 .endif
177
178 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
179 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
180 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
181 .endif
182
183 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
184 SUBDIR+= ../external/apache2/llvm/include
185 .endif
186
187 SUBDIR+= ../external/mit/libcbor/lib
188
189 SUBDIR+= ../external/mit/libuv/lib
190 #==================== 2nd library dependency barrier ====================
191 SUBDIR+= .WAIT
192
193 SUBDIR+= libwrap
194
195 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
196 .for sanitizer in asan lsan ubsan
197 .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
198 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
199 .endif
200 .endfor
201 .endif
202
203 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
204 SUBDIR+= ../external/apache2/llvm/librt
205 .endif
206
207 SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
208
209 SUBDIR+= ../external/bsd/file/lib # depends on libz, libbz2, libxz
210
211 .if (${MKNPF} != "no")
212 SUBDIR+= npf # depends on libnpf
213 .endif
214
215 .if (${MKATF} != "no")
216 SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
217 .endif
218
219 .if (${MKKYUA} != "no")
220 SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
221 .endif
222
223 SUBDIR+= libform # depends on libcurses
224 SUBDIR+= libmenu # depends on libcurses
225 SUBDIR+= libpanel # depends on libcurses
226 SUBDIR+= libradius # depends on libcrypto
227 .if (${MKRUMP} != "no")
228 SUBDIR+= librump # depends on librumpuser
229 .endif
230
231 .if (${MKKERBEROS} != "no")
232 SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
233 # libedit, libterminfo,
234 .endif
235
236 SUBDIR+= ../external/bsd/libfido2/lib # depends on libcbor
237 SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
238 SUBDIR+= ../external/bsd/libevent/lib # depends on libcrypto
239 .if ${MKDTRACE} != "no"
240 SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
241 .endif
242 SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
243
244 .if (${MKLDAP} != "no")
245 SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
246 .endif
247
248 .if (${MKZFS} != "no")
249 SUBDIR+= ../external/cddl/osnet/lib/libzfs
250 .endif
251
252 SUBDIR+= ../libexec/httpd/libbozohttpd # depends on libssl & libcrypto
253
254 #==================== 3rd library dependency barrier ====================
255 SUBDIR+= .WAIT
256
257 SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz,
258 # libfido2
259 SUBDIR+= ../crypto/external/bsd/netpgp/bindings/lua # depends on netpgp/lib
260 SUBDIR+= ../external/mpl/bind/lib # depends on heimdal, libcrypto
261 # libuv
262 .if ${MKUNBOUND} != "no"
263 SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
264 .endif
265
266 .if ${MKDTRACE} != "no"
267 SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
268 .endif
269
270 .if (${MKRUMP} != "no")
271 SUBDIR+= librumpdev # depends on librump
272 SUBDIR+= librumpnet # depends on librump
273 SUBDIR+= librumpvfs # depends on librump
274 .endif
275
276 SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
277 SUBDIR+= ../external/bsd/mdocml/lib
278
279 #==================== 4th library dependency barrier ====================
280 SUBDIR+= .WAIT
281
282 .if (${MKPAM} != "no")
283 SUBDIR+= libpam # depends on heimdal, libssh
284 .endif
285
286
287 .if (${MKRUMP} != "no")
288 SUBDIR+= libukfs # depends on librumpvfs, librump
289 .endif
290
291 .if (${MKTPM} != "no")
292 SUBDIR+= ../crypto/external/cpl/trousers/lib
293 .endif
294
295 #==================== 5th library dependency barrier ====================
296 SUBDIR+= .WAIT
297
298 .if (${MKPAM} != "no")
299 SUBDIR+= ../external/bsd/pam-u2f/lib # depends on libpam
300 .endif
301
302 .if (${MKRUMP} != "no")
303 SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
304 .endif
305
306 .if (${MKTPM} != "no")
307 SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
308 .endif
309
310 .if (${MKRUMP} != "no")
311 .if !defined(BSD_MK_COMPAT_FILE)
312 SUBDIR+= ../sys/rump/dev/lib
313 SUBDIR+= ../sys/rump/fs/lib
314 SUBDIR+= ../sys/rump/kern/lib
315 SUBDIR+= ../sys/rump/net/lib
316 .endif
317 .endif
318
319 # Lua bindings come last, they might depend on anything
320 SUBDIR+= lua
321
322 .include <bsd.buildinstall.mk>
323 .include <bsd.subdir.mk>
324