Home | History | Annotate | Line # | Download | only in lib
      1  1.316       mrg #	$NetBSD: Makefile,v 1.316 2026/01/19 09:41:05 mrg Exp $
      2    1.8   mycroft #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
      3   1.21       cgd 
      4   1.62   thorpej .include <bsd.own.mk>
      5   1.62   thorpej 
      6  1.188     joerg SUBDIR=		csu .WAIT
      7  1.155    plunky 
      8  1.155    plunky .if (${MKGCC} != "no")
      9  1.211       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
     10  1.155    plunky .endif
     11  1.155    plunky 
     12  1.155    plunky SUBDIR+=	libc
     13  1.155    plunky SUBDIR+=	.WAIT
     14  1.155    plunky 
     15  1.155    plunky #
     16  1.155    plunky # The SUBDIRs above are included here for completeness but should be built
     17  1.155    plunky # and installed prior to make(dependall) in this file, as libraries listed
     18  1.155    plunky # below will depend on versions from DESTDIR only.
     19  1.155    plunky #
     20  1.155    plunky 
     21  1.158    plunky SUBDIR+=	i18n_module
     22  1.158    plunky 
     23  1.158    plunky SUBDIR+=	libarch \
     24  1.311   thorpej 		libbsdmalloc libbz2 \
     25  1.184      matt 		libcompat libcrypt \
     26  1.312   thorpej 		libintl libkvm libm \
     27  1.259      maxv 		libossaudio libpci libposix libprop libpthread \
     28  1.249     kamil 		libpuffs libresolv librmt librpcsvc librt \
     29  1.187  christos 		libtelnet libterminfo \
     30  1.314   thorpej 		libutil liby libz
     31  1.158    plunky 
     32  1.206      matt .if !defined(BSD_MK_COMPAT_FILE)
     33  1.206      matt SUBDIR+=	libkern
     34  1.206      matt .endif
     35  1.206      matt 
     36  1.294       rin .if (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
     37  1.294       rin SUBDIR+=	libc_aligned
     38  1.294       rin .endif
     39  1.226      matt .if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
     40  1.201      matt LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
     41  1.228     joerg LIBC_MACHINE_CPU?=${MACHINE_CPU}
     42  1.228     joerg .if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
     43  1.197      matt SUBDIR+=	libc_vfp
     44  1.197      matt .endif
     45  1.201      matt .endif
     46  1.292  christos .if ${MACHINE_MIPS64}
     47  1.247  macallan SUBDIR+=	libc_fp
     48  1.247  macallan .endif
     49  1.311   thorpej .if (${MKBLUETOOTH} != "no")
     50  1.311   thorpej SUBDIR+=	libbluetooth
     51  1.311   thorpej .endif
     52  1.312   thorpej .if (${MKIPSEC} != "no")
     53  1.312   thorpej SUBDIR+=	libipsec
     54  1.312   thorpej .endif
     55  1.187  christos .if (${MKRUMP} != "no")
     56  1.187  christos SUBDIR+=	librumpclient
     57  1.187  christos .endif
     58  1.158    plunky .if (${MKSKEY} != "no")
     59  1.158    plunky SUBDIR+=	libskey
     60  1.158    plunky .endif
     61   1.60   thorpej 
     62  1.285  jmcneill .if ${HAVE_NVMM:Uno} == "yes" && !defined(MLIBDIR)
     63  1.265    martin SUBDIR+=	libnvmm
     64  1.265    martin .endif
     65  1.265    martin 
     66  1.314   thorpej .if (${MKUSB} != "no")
     67  1.314   thorpej SUBDIR+=	libusbhid
     68  1.314   thorpej .endif
     69  1.314   thorpej 
     70  1.293       nia .if (${MKARGON2} != "no")
     71  1.293       nia SUBDIR+=	../external/apache2/argon2/lib/libargon2
     72  1.293       nia .endif
     73  1.293       nia 
     74  1.155    plunky .if (${MKMDNS} != "no")
     75  1.155    plunky SUBDIR+=	../external/apache2/mDNSResponder/lib
     76  1.155    plunky .endif
     77  1.155    plunky 
     78  1.155    plunky SUBDIR+=	../external/bsd/am-utils/lib
     79  1.155    plunky 
     80  1.155    plunky SUBDIR+=	../external/bsd/flex/lib
     81  1.180  christos SUBDIR+=	../external/bsd/tre/lib
     82  1.297  riastrad ELFTOOLCHAINLIB=../external/bsd/elftoolchain/lib/
     83  1.297  riastrad .include "${ELFTOOLCHAINLIB}Makefile.subdir"
     84  1.163      matt SUBDIR+=	../external/bsd/liblzf/lib
     85  1.158    plunky SUBDIR+=	../external/bsd/libpcap/lib
     86  1.155    plunky 
     87  1.214    plunky .if ${MKSLJIT} != "no"
     88  1.214    plunky SUBDIR+=	../external/bsd/sljit/lib
     89  1.214    plunky SUBDIR+=	libbpfjit
     90  1.214    plunky .endif
     91  1.214    plunky 
     92  1.261  christos SUBDIR+=	../external/bsd/libnv/lib
     93  1.261  christos 
     94  1.224      matt .if (${MKZFS} != "no")
     95  1.224      matt SUBDIR+=        ../external/cddl/osnet/lib/libavl
     96  1.224      matt SUBDIR+=        ../external/cddl/osnet/lib/libnvpair
     97  1.224      matt SUBDIR+=        ../external/cddl/osnet/lib/libumem
     98  1.224      matt SUBDIR+=        ../external/cddl/osnet/lib/libuutil
     99  1.224      matt .endif
    100  1.224      matt 
    101  1.182      tron SUBDIR+=	../external/mit/expat/lib
    102  1.155    plunky 
    103  1.238  christos SUBDIR+=	../external/gpl2/libmalloc
    104  1.155    plunky 
    105  1.302  christos SUBDIR+=	../external/bsd/${EXTERNAL_JEMALLOC_SUBDIR}/lib
    106  1.269  christos 
    107  1.155    plunky .if (${MKGCC} != "no")
    108  1.211       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
    109  1.211       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
    110  1.155    plunky .endif
    111  1.144  christos 
    112  1.296       rin # GCC and GDB >= 13 require GMP.
    113  1.301  christos # We don't build compat versions of these
    114  1.301  christos .if !defined(MLIBDIR) && (${MKGCCCMDS} != "no" || ${MKGDB} != "no")
    115  1.301  christos SUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
    116  1.301  christos SUBDIR+=	../external/lgpl3/mpc/lib/libmpc
    117  1.296       rin SUBDIR+=	../external/lgpl3/gmp/lib/libgmp
    118  1.296       rin .endif
    119  1.296       rin 
    120   1.89     lukem #
    121   1.89     lukem # Libraries that depend upon any listed previously
    122   1.93     lukem # (and those that depend upon these [and ...])
    123   1.89     lukem #
    124   1.97  christos #==================== 1st library dependency barrier ====================
    125   1.97  christos SUBDIR+=	.WAIT
    126   1.97  christos 
    127  1.235  christos .if ${MKDTRACE} != "no"
    128  1.229  christos SUBDIR+=	../external/bsd/librtld_db/lib		# depends on libutil
    129  1.234  christos .endif
    130  1.229  christos 
    131  1.240  riastrad .if ${MKCTF} != "no"
    132  1.227  christos SUBDIR+=        ../external/cddl/osnet/lib/libctf
    133  1.227  christos .endif
    134  1.227  christos 
    135  1.221       mrg SUBDIR+=	../external/public-domain/xz/lib	# depends on libpthread
    136  1.208       mrg SUBDIR+=	../crypto/external/bsd/netpgp/libmj
    137  1.208       mrg SUBDIR+=	../crypto/external/bsd/netpgp/lib/verify # depends on libz
    138  1.284  christos SUBDIR+=	../external/bsd/blocklist/lib		# depends on libpthread
    139  1.208       mrg SUBDIR+=	../external/mit/lua/lib # depends on libm
    140  1.286       nia SUBDIR+=	../external/public-domain/sqlite/lib # depends on libm
    141  1.158    plunky SUBDIR+=	libcurses	# depends on libterminfo
    142  1.162      haad SUBDIR+=	libdm		# depends on libprop
    143  1.158    plunky SUBDIR+=	libedit		# depends on libterminfo
    144  1.184      matt SUBDIR+=	libexecinfo 	# depends on libelf
    145  1.176    dyoung SUBDIR+=	libppath	# depends on libprop
    146  1.175    plunky SUBDIR+=	libperfuse	# depends on libpuffs
    147  1.165    bouyer SUBDIR+=	libquota	# depends on libprop and librpcsvc
    148  1.113     pooka SUBDIR+=	librefuse	# depends on libpuffs
    149  1.207     joerg SUBDIR+=	libisns 	# depends on libpthread
    150  1.187  christos .if (${MKRUMP} != "no")
    151  1.253  christos SUBDIR+=	librumphijack	# depends on librumpclient and libpthread
    152  1.253  christos SUBDIR+=	librumpres	# depends on librumpclient
    153  1.126     pooka SUBDIR+=	librumpuser	# depends on libpthread
    154  1.187  christos .endif
    155  1.126     pooka 
    156  1.161     rmind .if (${MKNPF} != "no")
    157  1.261  christos SUBDIR+=	libnpf		# depends on libnv
    158  1.161     rmind .endif
    159  1.161     rmind 
    160  1.308  christos OSSL=../crypto/external/${EXTERNAL_OPENSSL_SUBDIR}/lib/
    161  1.295  christos .include "${.CURDIR}/${OSSL}Makefile.subdir" # depends on libcrypt
    162  1.155    plunky 
    163  1.155    plunky .if (${MKISCSI} != "no")
    164  1.155    plunky SUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
    165  1.155    plunky .endif
    166  1.155    plunky 
    167  1.224      matt .if (${MKZFS} != "no")
    168  1.257       chs SUBDIR+=        ../external/cddl/osnet/lib/libzfs_core
    169  1.224      matt SUBDIR+=        ../external/cddl/osnet/lib/libzpool
    170  1.224      matt .endif
    171  1.224      matt 
    172  1.163      matt .if (${MKLVM} != "no")
    173  1.163      matt SUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
    174  1.163      matt .endif
    175  1.163      matt 
    176  1.155    plunky .if (${MKBINUTILS} != "no")
    177  1.239  christos SUBDIR+=	../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib	# libbfd depends on libz
    178  1.155    plunky .endif
    179  1.155    plunky 
    180  1.202     joerg .if (${MKLIBCXX} != "no")
    181  1.202     joerg SUBDIR+=	../external/bsd/libc++
    182  1.202     joerg .endif
    183  1.202     joerg 
    184  1.203     joerg .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
    185  1.211       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
    186  1.211       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
    187  1.155    plunky .endif
    188  1.222  christos 
    189  1.271  nakayama .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
    190  1.273     joerg SUBDIR+=	../external/apache2/llvm/include
    191  1.270     joerg .endif
    192  1.270     joerg 
    193  1.275  christos SUBDIR+=	../external/mit/libcbor/lib
    194  1.283  christos 
    195  1.304       mrg SUBDIR+=	../external/bsd/zstd/lib
    196  1.222  christos #==================== 2nd library dependency barrier ====================
    197  1.222  christos SUBDIR+=	.WAIT
    198  1.222  christos 
    199  1.287  christos SUBDIR+=	libwrap
    200  1.287  christos 
    201  1.299       mrg .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
    202  1.300       mrg .if ${MKGCCCMDS} != "no"
    203  1.258  christos .for sanitizer in asan lsan ubsan
    204  1.245  christos .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
    205  1.245  christos SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
    206  1.245  christos .endif
    207  1.245  christos .endfor
    208  1.272       mrg .endif
    209  1.300       mrg .endif
    210  1.155    plunky 
    211  1.271  nakayama .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
    212  1.273     joerg SUBDIR+=	../external/apache2/llvm/librt
    213  1.270     joerg .endif
    214  1.270     joerg 
    215  1.303  christos SUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz, zstd
    216  1.221       mrg 
    217  1.304       mrg SUBDIR+=	../external/bsd/file/lib	# depends on libz, libbz2, libxz, zstd
    218  1.274  christos 
    219  1.208       mrg .if (${MKNPF} != "no")
    220  1.208       mrg SUBDIR+=	npf		# depends on libnpf
    221  1.208       mrg .endif
    222  1.208       mrg 
    223  1.185  christos .if (${MKATF} != "no")
    224  1.297  riastrad ATFLIB=	../external/bsd/atf/lib/
    225  1.297  riastrad .include "${ATFLIB}Makefile.subdir"		# depends on libstdc++
    226  1.185  christos .endif
    227  1.185  christos 
    228  1.198      jmmv .if (${MKKYUA} != "no")
    229  1.198      jmmv SUBDIR+=	../external/bsd/lutok/lib	# depends on lua and libstdc++
    230  1.198      jmmv .endif
    231  1.198      jmmv 
    232  1.158    plunky SUBDIR+=	libform		# depends on libcurses
    233  1.175    plunky SUBDIR+=	libmenu		# depends on libcurses
    234  1.236     kamil SUBDIR+=	libpanel	# depends on libcurses
    235  1.251  riastrad SUBDIR+=	libradius	# depends on libcrypto
    236  1.187  christos .if (${MKRUMP} != "no")
    237  1.175    plunky SUBDIR+=	librump		# depends on librumpuser
    238  1.187  christos .endif
    239  1.158    plunky 
    240  1.100  christos .if (${MKKERBEROS} != "no")
    241  1.297  riastrad # heimdal depends on libcrypto, libedit, libterminfo
    242  1.297  riastrad HEIMDALLIB=	../crypto/external/bsd/heimdal/lib/
    243  1.297  riastrad .include "${HEIMDALLIB}Makefile.subdir"			# depends on libcrypto
    244  1.166     elric 							# libedit, libterminfo,
    245  1.100  christos .endif
    246  1.100  christos 
    247  1.313   thorpej .if (${MKFIDO2} != "no")
    248  1.275  christos SUBDIR+=	../external/bsd/libfido2/lib	# depends on libcbor
    249  1.313   thorpej .endif
    250  1.313   thorpej 
    251  1.297  riastrad NETPGPLIB=	../crypto/external/bsd/netpgp/lib/
    252  1.297  riastrad .include "${NETPGPLIB}Makefile.subdir"		# depends on libcrypto, ...
    253  1.297  riastrad LIBEVENTLIB=	../external/bsd/libevent/lib/
    254  1.297  riastrad .include "${LIBEVENTLIB}Makefile.subdir"	# depends on libcrypto
    255  1.235  christos .if ${MKDTRACE} != "no"
    256  1.234  christos SUBDIR+=	../external/bsd/libproc/lib	# depends on libstdc++, libctf
    257  1.234  christos .endif
    258  1.158    plunky SUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
    259  1.158    plunky 
    260  1.158    plunky .if (${MKLDAP} != "no")
    261  1.297  riastrad OPENLDAPLIB=	../external/bsd/openldap/lib/	# depends on libcrypto, ...
    262  1.297  riastrad .include "${OPENLDAPLIB}Makefile.subdir"
    263  1.158    plunky .endif
    264  1.158    plunky 
    265  1.257       chs .if (${MKZFS} != "no")
    266  1.257       chs SUBDIR+=        ../external/cddl/osnet/lib/libzfs
    267  1.257       chs .endif
    268  1.257       chs 
    269  1.256     sevan SUBDIR+= 	../libexec/httpd/libbozohttpd 	# depends on libssl & libcrypto
    270  1.256     sevan 
    271  1.305  christos SUBDIR+=	../external/mit/libuv/lib
    272  1.307  christos SUBDIR+=	../external/lgpl2/userspace-rcu/lib
    273  1.305  christos 
    274  1.124     lukem #==================== 3rd library dependency barrier ====================
    275  1.124     lukem SUBDIR+=	.WAIT
    276  1.124     lukem 
    277  1.275  christos SUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz,
    278  1.275  christos 						   # libfido2
    279  1.255  christos SUBDIR+=	../crypto/external/bsd/netpgp/bindings/lua  # depends on netpgp/lib
    280  1.260  christos SUBDIR+=	../external/mpl/bind/lib	# depends on heimdal, libcrypto
    281  1.305  christos 						# libuv, userspace-rcu
    282  1.251  riastrad .if ${MKUNBOUND} != "no"
    283  1.246  christos SUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
    284  1.246  christos .endif
    285  1.204     joerg 
    286  1.230  christos .if ${MKDTRACE} != "no"
    287  1.230  christos SUBDIR+=        ../external/cddl/osnet/lib/libdtrace	# depends on libproc
    288  1.230  christos .endif
    289  1.230  christos 
    290  1.187  christos .if (${MKRUMP} != "no")
    291  1.143     pooka SUBDIR+=	librumpdev	# depends on librump
    292  1.128     pooka SUBDIR+=	librumpnet	# depends on librump
    293  1.130     pooka SUBDIR+=	librumpvfs	# depends on librump
    294  1.187  christos .endif
    295  1.126     pooka 
    296  1.175    plunky SUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
    297  1.181     joerg SUBDIR+=	../external/bsd/mdocml/lib
    298  1.181     joerg 
    299  1.126     pooka #==================== 4th library dependency barrier ====================
    300  1.126     pooka SUBDIR+=	.WAIT
    301  1.158    plunky 
    302  1.277  christos .if (${MKPAM} != "no")
    303  1.278       rin SUBDIR+=	libpam		# depends on heimdal, libssh
    304  1.277  christos .endif
    305  1.277  christos 
    306  1.277  christos 
    307  1.280  christos .if (${MKRUMP} != "no")
    308  1.158    plunky SUBDIR+=	libukfs		# depends on librumpvfs, librump
    309  1.280  christos .endif
    310  1.131     pooka 
    311  1.190  christos .if (${MKTPM} != "no")
    312  1.190  christos SUBDIR+=	../crypto/external/cpl/trousers/lib
    313  1.190  christos .endif
    314  1.190  christos 
    315  1.131     pooka #==================== 5th library dependency barrier ====================
    316  1.131     pooka SUBDIR+=	.WAIT
    317  1.158    plunky 
    318  1.279  christos .if (${MKPAM} != "no")
    319  1.279  christos SUBDIR+=	../external/bsd/pam-u2f/lib	# depends on libpam
    320  1.279  christos .endif
    321  1.279  christos 
    322  1.281       tnn .if (${MKRUMP} != "no")
    323  1.158    plunky SUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
    324  1.281       tnn .endif
    325  1.188     joerg 
    326  1.192  christos .if (${MKTPM} != "no")
    327  1.192  christos SUBDIR+=	../crypto/external/cpl/tpm-tools/lib	# depends on trousers
    328  1.192  christos .endif
    329  1.192  christos 
    330  1.280  christos .if (${MKRUMP} != "no")
    331  1.188     joerg .if !defined(BSD_MK_COMPAT_FILE)
    332  1.188     joerg SUBDIR+=	../sys/rump/dev/lib
    333  1.188     joerg SUBDIR+=	../sys/rump/fs/lib
    334  1.188     joerg SUBDIR+=	../sys/rump/kern/lib
    335  1.188     joerg SUBDIR+=	../sys/rump/net/lib
    336  1.188     joerg .endif
    337  1.187  christos .endif
    338  1.158    plunky 
    339  1.178   mbalmer # Lua bindings come last, they might depend on anything
    340  1.178   mbalmer SUBDIR+=	lua
    341  1.178   mbalmer 
    342  1.316       mrg .if (${MKGCC} != "no" && ${HAVE_GCC:U0} >= 14)
    343  1.316       mrg .if ${HAVE_QUADMATH} != "no"
    344  1.316       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libquadmath
    345  1.316       mrg .endif
    346  1.316       mrg .endif
    347  1.316       mrg 
    348  1.315       mrg #==================== 6th library dependency barrier ====================
    349  1.315       mrg SUBDIR+=	.WAIT
    350  1.315       mrg 
    351  1.315       mrg .if (${MKGCC} != "no" && ${HAVE_GCC:U0} >= 14)
    352  1.315       mrg SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgfortran
    353  1.315       mrg .endif
    354  1.315       mrg 
    355  1.195     joerg .include <bsd.buildinstall.mk>
    356    1.1       cgd .include <bsd.subdir.mk>
    357