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