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