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