Makefile revision 1.300 1 1.300 mrg # $NetBSD: Makefile,v 1.300 2024/07/01 04:03:03 mrg Exp $
2 1.8 mycroft # from: @(#)Makefile 5.25.1.1 (Berkeley) 5/7/91
3 1.21 cgd
4 1.62 thorpej .include <bsd.own.mk>
5 1.62 thorpej
6 1.188 joerg SUBDIR= csu .WAIT
7 1.155 plunky
8 1.155 plunky .if (${MKGCC} != "no")
9 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
10 1.155 plunky .endif
11 1.155 plunky
12 1.155 plunky SUBDIR+= libc
13 1.155 plunky SUBDIR+= .WAIT
14 1.155 plunky
15 1.155 plunky #
16 1.155 plunky # The SUBDIRs above are included here for completeness but should be built
17 1.155 plunky # and installed prior to make(dependall) in this file, as libraries listed
18 1.155 plunky # below will depend on versions from DESTDIR only.
19 1.155 plunky #
20 1.155 plunky
21 1.158 plunky SUBDIR+= i18n_module
22 1.158 plunky
23 1.158 plunky SUBDIR+= libarch \
24 1.158 plunky libbluetooth libbsdmalloc libbz2 \
25 1.184 matt libcompat libcrypt \
26 1.265 martin libintl libipsec libkvm libm \
27 1.259 maxv libossaudio libpci libposix libprop libpthread \
28 1.249 kamil libpuffs libresolv librmt librpcsvc librt \
29 1.187 christos libtelnet libterminfo \
30 1.287 christos libusbhid libutil liby libz
31 1.158 plunky
32 1.206 matt .if !defined(BSD_MK_COMPAT_FILE)
33 1.206 matt SUBDIR+= libkern
34 1.206 matt .endif
35 1.206 matt
36 1.294 rin .if (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
37 1.294 rin SUBDIR+= libc_aligned
38 1.294 rin .endif
39 1.226 matt .if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
40 1.201 matt LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
41 1.228 joerg LIBC_MACHINE_CPU?=${MACHINE_CPU}
42 1.228 joerg .if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
43 1.197 matt SUBDIR+= libc_vfp
44 1.197 matt .endif
45 1.201 matt .endif
46 1.292 christos .if ${MACHINE_MIPS64}
47 1.247 macallan SUBDIR+= libc_fp
48 1.247 macallan .endif
49 1.187 christos .if (${MKRUMP} != "no")
50 1.187 christos SUBDIR+= librumpclient
51 1.187 christos .endif
52 1.158 plunky .if (${MKSKEY} != "no")
53 1.158 plunky SUBDIR+= libskey
54 1.158 plunky .endif
55 1.60 thorpej
56 1.285 jmcneill .if ${HAVE_NVMM:Uno} == "yes" && !defined(MLIBDIR)
57 1.265 martin SUBDIR+= libnvmm
58 1.265 martin .endif
59 1.265 martin
60 1.293 nia .if (${MKARGON2} != "no")
61 1.293 nia SUBDIR+= ../external/apache2/argon2/lib/libargon2
62 1.293 nia .endif
63 1.293 nia
64 1.155 plunky .if (${MKMDNS} != "no")
65 1.155 plunky SUBDIR+= ../external/apache2/mDNSResponder/lib
66 1.155 plunky .endif
67 1.155 plunky
68 1.155 plunky SUBDIR+= ../external/bsd/am-utils/lib
69 1.155 plunky
70 1.155 plunky SUBDIR+= ../external/bsd/flex/lib
71 1.180 christos SUBDIR+= ../external/bsd/tre/lib
72 1.297 riastrad ELFTOOLCHAINLIB=../external/bsd/elftoolchain/lib/
73 1.297 riastrad .include "${ELFTOOLCHAINLIB}Makefile.subdir"
74 1.163 matt SUBDIR+= ../external/bsd/liblzf/lib
75 1.158 plunky SUBDIR+= ../external/bsd/libpcap/lib
76 1.155 plunky
77 1.214 plunky .if ${MKSLJIT} != "no"
78 1.214 plunky SUBDIR+= ../external/bsd/sljit/lib
79 1.214 plunky SUBDIR+= libbpfjit
80 1.214 plunky .endif
81 1.214 plunky
82 1.261 christos SUBDIR+= ../external/bsd/libnv/lib
83 1.261 christos
84 1.224 matt .if (${MKZFS} != "no")
85 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libavl
86 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libnvpair
87 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libumem
88 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libuutil
89 1.224 matt .endif
90 1.224 matt
91 1.182 tron SUBDIR+= ../external/mit/expat/lib
92 1.155 plunky
93 1.238 christos SUBDIR+= ../external/gpl2/libmalloc
94 1.155 plunky
95 1.269 christos SUBDIR+= ../external/bsd/jemalloc/lib
96 1.269 christos
97 1.155 plunky .if (${MKGCC} != "no")
98 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
99 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
100 1.173 mrg # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
101 1.173 mrg # specific build area, but we get better parallelism this way.
102 1.215 mrg # We don't build compat versions of these.
103 1.252 mrg . if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
104 1.174 plunky SUBDIR+= ../external/lgpl3/mpfr/lib/libmpfr
105 1.209 mrg SUBDIR+= ../external/lgpl3/mpc/lib/libmpc
106 1.174 plunky . endif
107 1.155 plunky .endif
108 1.144 christos
109 1.296 rin # GCC and GDB >= 13 require GMP.
110 1.296 rin .if !defined(MLIBDIR) && (${MKGCCCMDS} != "no" || \
111 1.296 rin (${MKGDB} != "no" && ${HAVE_GDB:U0} >= 1320))
112 1.296 rin SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
113 1.296 rin .endif
114 1.296 rin
115 1.89 lukem #
116 1.89 lukem # Libraries that depend upon any listed previously
117 1.93 lukem # (and those that depend upon these [and ...])
118 1.89 lukem #
119 1.97 christos #==================== 1st library dependency barrier ====================
120 1.97 christos SUBDIR+= .WAIT
121 1.97 christos
122 1.235 christos .if ${MKDTRACE} != "no"
123 1.229 christos SUBDIR+= ../external/bsd/librtld_db/lib # depends on libutil
124 1.234 christos .endif
125 1.229 christos
126 1.240 riastrad .if ${MKCTF} != "no"
127 1.227 christos SUBDIR+= ../external/cddl/osnet/lib/libctf
128 1.227 christos .endif
129 1.227 christos
130 1.221 mrg SUBDIR+= ../external/public-domain/xz/lib # depends on libpthread
131 1.208 mrg SUBDIR+= ../crypto/external/bsd/netpgp/libmj
132 1.208 mrg SUBDIR+= ../crypto/external/bsd/netpgp/lib/verify # depends on libz
133 1.284 christos SUBDIR+= ../external/bsd/blocklist/lib # depends on libpthread
134 1.208 mrg SUBDIR+= ../external/mit/lua/lib # depends on libm
135 1.286 nia SUBDIR+= ../external/public-domain/sqlite/lib # depends on libm
136 1.158 plunky SUBDIR+= libcurses # depends on libterminfo
137 1.162 haad SUBDIR+= libdm # depends on libprop
138 1.158 plunky SUBDIR+= libedit # depends on libterminfo
139 1.184 matt SUBDIR+= libexecinfo # depends on libelf
140 1.176 dyoung SUBDIR+= libppath # depends on libprop
141 1.175 plunky SUBDIR+= libperfuse # depends on libpuffs
142 1.165 bouyer SUBDIR+= libquota # depends on libprop and librpcsvc
143 1.113 pooka SUBDIR+= librefuse # depends on libpuffs
144 1.207 joerg SUBDIR+= libisns # depends on libpthread
145 1.187 christos .if (${MKRUMP} != "no")
146 1.253 christos SUBDIR+= librumphijack # depends on librumpclient and libpthread
147 1.253 christos SUBDIR+= librumpres # depends on librumpclient
148 1.126 pooka SUBDIR+= librumpuser # depends on libpthread
149 1.187 christos .endif
150 1.126 pooka
151 1.161 rmind .if (${MKNPF} != "no")
152 1.261 christos SUBDIR+= libnpf # depends on libnv
153 1.161 rmind .endif
154 1.161 rmind
155 1.295 christos OSSL=../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/
156 1.295 christos .include "${.CURDIR}/${OSSL}Makefile.subdir" # depends on libcrypt
157 1.155 plunky
158 1.155 plunky .if (${MKISCSI} != "no")
159 1.155 plunky SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
160 1.155 plunky .endif
161 1.155 plunky
162 1.224 matt .if (${MKZFS} != "no")
163 1.257 chs SUBDIR+= ../external/cddl/osnet/lib/libzfs_core
164 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libzpool
165 1.224 matt .endif
166 1.224 matt
167 1.163 matt .if (${MKLVM} != "no")
168 1.163 matt SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
169 1.163 matt .endif
170 1.163 matt
171 1.155 plunky .if (${MKBINUTILS} != "no")
172 1.239 christos SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
173 1.155 plunky .endif
174 1.155 plunky
175 1.202 joerg .if (${MKLIBCXX} != "no")
176 1.202 joerg SUBDIR+= ../external/bsd/libc++
177 1.202 joerg .endif
178 1.202 joerg
179 1.203 joerg .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
180 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
181 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
182 1.155 plunky .endif
183 1.222 christos
184 1.271 nakayama .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
185 1.273 joerg SUBDIR+= ../external/apache2/llvm/include
186 1.270 joerg .endif
187 1.270 joerg
188 1.275 christos SUBDIR+= ../external/mit/libcbor/lib
189 1.283 christos
190 1.283 christos SUBDIR+= ../external/mit/libuv/lib
191 1.222 christos #==================== 2nd library dependency barrier ====================
192 1.222 christos SUBDIR+= .WAIT
193 1.222 christos
194 1.287 christos SUBDIR+= libwrap
195 1.287 christos
196 1.299 mrg .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
197 1.300 mrg .if ${MKGCCCMDS} != "no"
198 1.258 christos .for sanitizer in asan lsan ubsan
199 1.245 christos .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
200 1.245 christos SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
201 1.245 christos .endif
202 1.245 christos .endfor
203 1.272 mrg .endif
204 1.300 mrg .endif
205 1.155 plunky
206 1.271 nakayama .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
207 1.273 joerg SUBDIR+= ../external/apache2/llvm/librt
208 1.270 joerg .endif
209 1.270 joerg
210 1.221 mrg SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
211 1.221 mrg
212 1.274 christos SUBDIR+= ../external/bsd/file/lib # depends on libz, libbz2, libxz
213 1.274 christos
214 1.208 mrg .if (${MKNPF} != "no")
215 1.208 mrg SUBDIR+= npf # depends on libnpf
216 1.208 mrg .endif
217 1.208 mrg
218 1.185 christos .if (${MKATF} != "no")
219 1.297 riastrad ATFLIB= ../external/bsd/atf/lib/
220 1.297 riastrad .include "${ATFLIB}Makefile.subdir" # depends on libstdc++
221 1.185 christos .endif
222 1.185 christos
223 1.198 jmmv .if (${MKKYUA} != "no")
224 1.198 jmmv SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
225 1.198 jmmv .endif
226 1.198 jmmv
227 1.158 plunky SUBDIR+= libform # depends on libcurses
228 1.175 plunky SUBDIR+= libmenu # depends on libcurses
229 1.236 kamil SUBDIR+= libpanel # depends on libcurses
230 1.251 riastrad SUBDIR+= libradius # depends on libcrypto
231 1.187 christos .if (${MKRUMP} != "no")
232 1.175 plunky SUBDIR+= librump # depends on librumpuser
233 1.187 christos .endif
234 1.158 plunky
235 1.100 christos .if (${MKKERBEROS} != "no")
236 1.297 riastrad # heimdal depends on libcrypto, libedit, libterminfo
237 1.297 riastrad HEIMDALLIB= ../crypto/external/bsd/heimdal/lib/
238 1.297 riastrad .include "${HEIMDALLIB}Makefile.subdir" # depends on libcrypto
239 1.166 elric # libedit, libterminfo,
240 1.100 christos .endif
241 1.100 christos
242 1.275 christos SUBDIR+= ../external/bsd/libfido2/lib # depends on libcbor
243 1.297 riastrad NETPGPLIB= ../crypto/external/bsd/netpgp/lib/
244 1.297 riastrad .include "${NETPGPLIB}Makefile.subdir" # depends on libcrypto, ...
245 1.297 riastrad LIBEVENTLIB= ../external/bsd/libevent/lib/
246 1.297 riastrad .include "${LIBEVENTLIB}Makefile.subdir" # depends on libcrypto
247 1.235 christos .if ${MKDTRACE} != "no"
248 1.234 christos SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
249 1.234 christos .endif
250 1.158 plunky SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
251 1.158 plunky
252 1.158 plunky .if (${MKLDAP} != "no")
253 1.297 riastrad OPENLDAPLIB= ../external/bsd/openldap/lib/ # depends on libcrypto, ...
254 1.297 riastrad .include "${OPENLDAPLIB}Makefile.subdir"
255 1.158 plunky .endif
256 1.158 plunky
257 1.257 chs .if (${MKZFS} != "no")
258 1.257 chs SUBDIR+= ../external/cddl/osnet/lib/libzfs
259 1.257 chs .endif
260 1.257 chs
261 1.256 sevan SUBDIR+= ../libexec/httpd/libbozohttpd # depends on libssl & libcrypto
262 1.256 sevan
263 1.124 lukem #==================== 3rd library dependency barrier ====================
264 1.124 lukem SUBDIR+= .WAIT
265 1.124 lukem
266 1.275 christos SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz,
267 1.275 christos # libfido2
268 1.255 christos SUBDIR+= ../crypto/external/bsd/netpgp/bindings/lua # depends on netpgp/lib
269 1.260 christos SUBDIR+= ../external/mpl/bind/lib # depends on heimdal, libcrypto
270 1.283 christos # libuv
271 1.251 riastrad .if ${MKUNBOUND} != "no"
272 1.246 christos SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
273 1.246 christos .endif
274 1.204 joerg
275 1.230 christos .if ${MKDTRACE} != "no"
276 1.230 christos SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
277 1.230 christos .endif
278 1.230 christos
279 1.187 christos .if (${MKRUMP} != "no")
280 1.143 pooka SUBDIR+= librumpdev # depends on librump
281 1.128 pooka SUBDIR+= librumpnet # depends on librump
282 1.130 pooka SUBDIR+= librumpvfs # depends on librump
283 1.187 christos .endif
284 1.126 pooka
285 1.175 plunky SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
286 1.181 joerg SUBDIR+= ../external/bsd/mdocml/lib
287 1.181 joerg
288 1.126 pooka #==================== 4th library dependency barrier ====================
289 1.126 pooka SUBDIR+= .WAIT
290 1.158 plunky
291 1.277 christos .if (${MKPAM} != "no")
292 1.278 rin SUBDIR+= libpam # depends on heimdal, libssh
293 1.277 christos .endif
294 1.277 christos
295 1.277 christos
296 1.280 christos .if (${MKRUMP} != "no")
297 1.158 plunky SUBDIR+= libukfs # depends on librumpvfs, librump
298 1.280 christos .endif
299 1.131 pooka
300 1.190 christos .if (${MKTPM} != "no")
301 1.190 christos SUBDIR+= ../crypto/external/cpl/trousers/lib
302 1.190 christos .endif
303 1.190 christos
304 1.131 pooka #==================== 5th library dependency barrier ====================
305 1.131 pooka SUBDIR+= .WAIT
306 1.158 plunky
307 1.279 christos .if (${MKPAM} != "no")
308 1.279 christos SUBDIR+= ../external/bsd/pam-u2f/lib # depends on libpam
309 1.279 christos .endif
310 1.279 christos
311 1.281 tnn .if (${MKRUMP} != "no")
312 1.158 plunky SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
313 1.281 tnn .endif
314 1.188 joerg
315 1.192 christos .if (${MKTPM} != "no")
316 1.192 christos SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
317 1.192 christos .endif
318 1.192 christos
319 1.280 christos .if (${MKRUMP} != "no")
320 1.188 joerg .if !defined(BSD_MK_COMPAT_FILE)
321 1.188 joerg SUBDIR+= ../sys/rump/dev/lib
322 1.188 joerg SUBDIR+= ../sys/rump/fs/lib
323 1.188 joerg SUBDIR+= ../sys/rump/kern/lib
324 1.188 joerg SUBDIR+= ../sys/rump/net/lib
325 1.188 joerg .endif
326 1.187 christos .endif
327 1.158 plunky
328 1.178 mbalmer # Lua bindings come last, they might depend on anything
329 1.178 mbalmer SUBDIR+= lua
330 1.178 mbalmer
331 1.195 joerg .include <bsd.buildinstall.mk>
332 1.1 cgd .include <bsd.subdir.mk>
333