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