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