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