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