Home | History | Annotate | Line # | Download | only in lib
Makefile revision 1.274
      1 #	$NetBSD: Makefile,v 1.274 2019/12/18 02:46:21 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 libwrap liby libz
     31 
     32 .if !defined(BSD_MK_COMPAT_FILE)
     33 SUBDIR+=	libkern
     34 .endif
     35 
     36 .if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
     37 LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
     38 LIBC_MACHINE_CPU?=${MACHINE_CPU}
     39 .if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
     40 SUBDIR+=	libc_vfp
     41 .endif
     42 .endif
     43 .if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
     44 SUBDIR+=	libc_fp
     45 .endif
     46 .if (${MKRUMP} != "no")
     47 SUBDIR+=	librumpclient
     48 .endif
     49 .if (${MKSKEY} != "no")
     50 SUBDIR+=	libskey
     51 .endif
     52 
     53 .if ${MACHINE_ARCH} == "x86_64" && ${MLIBDIR:Unone} != "i386"
     54 SUBDIR+=	libnvmm
     55 .endif
     56 
     57 SUBDIR+=	../external/public-domain/sqlite/lib
     58 
     59 .if (${MKMDNS} != "no")
     60 SUBDIR+=	../external/apache2/mDNSResponder/lib
     61 .endif
     62 
     63 SUBDIR+=	../external/bsd/am-utils/lib
     64 
     65 SUBDIR+=	../external/bsd/flex/lib
     66 SUBDIR+=	../external/bsd/tre/lib
     67 SUBDIR+=	../external/bsd/elftoolchain/lib/libelf
     68 SUBDIR+=	../external/bsd/liblzf/lib
     69 SUBDIR+=	../external/bsd/libpcap/lib
     70 
     71 .if ${MKSLJIT} != "no"
     72 SUBDIR+=	../external/bsd/sljit/lib
     73 SUBDIR+=	libbpfjit
     74 .endif
     75 
     76 SUBDIR+=	../external/bsd/libnv/lib
     77 
     78 .if (${MKZFS} != "no")
     79 SUBDIR+=        ../external/cddl/osnet/lib/libavl
     80 SUBDIR+=        ../external/cddl/osnet/lib/libnvpair
     81 SUBDIR+=        ../external/cddl/osnet/lib/libumem
     82 SUBDIR+=        ../external/cddl/osnet/lib/libuutil
     83 .endif
     84 
     85 SUBDIR+=	../external/mit/expat/lib
     86 
     87 SUBDIR+=	../external/gpl2/libmalloc
     88 
     89 SUBDIR+=	../external/bsd/jemalloc/lib
     90 
     91 .if (${MKGCC} != "no")
     92 SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
     93 SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
     94 # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
     95 # specific build area, but we get better parallelism this way.
     96 # We don't build compat versions of these.
     97 . if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
     98 SUBDIR+=	../external/lgpl3/gmp/lib/libgmp
     99 SUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
    100 SUBDIR+=	../external/lgpl3/mpc/lib/libmpc
    101 . endif
    102 .endif
    103 
    104 #
    105 # Libraries that depend upon any listed previously
    106 # (and those that depend upon these [and ...])
    107 #
    108 #==================== 1st library dependency barrier ====================
    109 SUBDIR+=	.WAIT
    110 
    111 .if ${MKDTRACE} != "no"
    112 SUBDIR+=	../external/bsd/librtld_db/lib		# depends on libutil
    113 .endif
    114 
    115 .if ${MKCTF} != "no"
    116 SUBDIR+=        ../external/cddl/osnet/lib/libctf
    117 .endif
    118 
    119 SUBDIR+=	../external/public-domain/xz/lib	# depends on libpthread
    120 SUBDIR+=	../crypto/external/bsd/netpgp/libmj
    121 SUBDIR+=	../crypto/external/bsd/netpgp/lib/verify # depends on libz
    122 SUBDIR+=	../external/bsd/blacklist/lib		# depends on libpthread
    123 SUBDIR+=	../external/bsd/elftoolchain/lib/libdwarf # depends on libelf
    124 SUBDIR+=	../external/mit/lua/lib # depends on libm
    125 SUBDIR+=	libcurses	# depends on libterminfo
    126 SUBDIR+=	libdm		# depends on libprop
    127 SUBDIR+=	libedit		# depends on libterminfo
    128 SUBDIR+=	libexecinfo 	# depends on libelf
    129 SUBDIR+=	libppath	# depends on libprop
    130 SUBDIR+=	libperfuse	# depends on libpuffs
    131 SUBDIR+=	libquota	# depends on libprop and librpcsvc
    132 SUBDIR+=	librefuse	# depends on libpuffs
    133 SUBDIR+=	libisns 	# depends on libpthread
    134 .if (${MKRUMP} != "no")
    135 SUBDIR+=	librumphijack	# depends on librumpclient and libpthread
    136 SUBDIR+=	librumpres	# depends on librumpclient
    137 SUBDIR+=	librumpuser	# depends on libpthread
    138 .endif
    139 
    140 .if (${MKNPF} != "no")
    141 SUBDIR+=	libnpf		# depends on libnv
    142 .endif
    143 
    144 SUBDIR+=	../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib # depends on libcrypt
    145 
    146 .if (${MKISCSI} != "no")
    147 SUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
    148 .endif
    149 
    150 .if (${MKZFS} != "no")
    151 SUBDIR+=        ../external/cddl/osnet/lib/libzfs_core
    152 SUBDIR+=        ../external/cddl/osnet/lib/libzpool
    153 .endif
    154 
    155 .if (${MKLVM} != "no")
    156 SUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
    157 .endif
    158 
    159 .if (${MKBINUTILS} != "no")
    160 SUBDIR+=	../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib	# libbfd depends on libz
    161 .endif
    162 
    163 .if (${MKLIBCXX} != "no")
    164 SUBDIR+=	../external/bsd/libc++
    165 .endif
    166 
    167 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
    168 SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
    169 SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
    170 .endif
    171 
    172 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
    173 SUBDIR+=	../external/apache2/llvm/include
    174 .endif
    175 
    176 #==================== 2nd library dependency barrier ====================
    177 SUBDIR+=	.WAIT
    178 
    179 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
    180 .for sanitizer in asan lsan ubsan
    181 .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
    182 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
    183 .endif
    184 .endfor
    185 .endif
    186 
    187 .if (${MKLLVMRT} != "no" && (!defined(MLIBDIR) || ${MKCOMPATX11} != "no"))
    188 SUBDIR+=	../external/apache2/llvm/librt
    189 .endif
    190 
    191 SUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
    192 
    193 SUBDIR+=	../external/bsd/file/lib	# depends on libz, libbz2, libxz
    194 
    195 .if (${MKNPF} != "no")
    196 SUBDIR+=	npf		# depends on libnpf
    197 .endif
    198 
    199 .if (${MKATF} != "no")
    200 SUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
    201 .endif
    202 
    203 .if (${MKKYUA} != "no")
    204 SUBDIR+=	../external/bsd/lutok/lib	# depends on lua and libstdc++
    205 .endif
    206 
    207 SUBDIR+=	libform		# depends on libcurses
    208 SUBDIR+=	libmenu		# depends on libcurses
    209 SUBDIR+=	libpanel	# depends on libcurses
    210 SUBDIR+=	libradius	# depends on libcrypto
    211 .if (${MKRUMP} != "no")
    212 SUBDIR+=	librump		# depends on librumpuser
    213 .endif
    214 
    215 .if (${MKKERBEROS} != "no")
    216 SUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
    217 							# libedit, libterminfo,
    218 .endif
    219 
    220 SUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
    221 SUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
    222 SUBDIR+=	../external/bsd/libevent/lib	# depends on libcrypto
    223 .if ${MKDTRACE} != "no"
    224 SUBDIR+=	../external/bsd/libproc/lib	# depends on libstdc++, libctf
    225 .endif
    226 SUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
    227 
    228 .if (${MKLDAP} != "no")
    229 SUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
    230 .endif
    231 
    232 .if (${MKZFS} != "no")
    233 SUBDIR+=        ../external/cddl/osnet/lib/libzfs
    234 .endif
    235 
    236 SUBDIR+= 	../libexec/httpd/libbozohttpd 	# depends on libssl & libcrypto
    237 
    238 #==================== 3rd library dependency barrier ====================
    239 SUBDIR+=	.WAIT
    240 
    241 SUBDIR+=	../crypto/external/bsd/netpgp/bindings/lua  # depends on netpgp/lib
    242 SUBDIR+=	../external/mpl/bind/lib	# depends on heimdal, libcrypto
    243 .if ${MKUNBOUND} != "no"
    244 SUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
    245 .endif
    246 
    247 .if ${MKDTRACE} != "no"
    248 SUBDIR+=        ../external/cddl/osnet/lib/libdtrace	# depends on libproc
    249 .endif
    250 
    251 .if (${MKRUMP} != "no")
    252 SUBDIR+=	librumpdev	# depends on librump
    253 SUBDIR+=	librumpnet	# depends on librump
    254 SUBDIR+=	librumpvfs	# depends on librump
    255 .endif
    256 
    257 .if (${MKPAM} != "no")
    258 SUBDIR+=	libpam		# depends on heimdal
    259 .endif
    260 
    261 SUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
    262 SUBDIR+=	../external/bsd/mdocml/lib
    263 
    264 .if (${MKRUMP} != "no")
    265 #==================== 4th library dependency barrier ====================
    266 SUBDIR+=	.WAIT
    267 
    268 SUBDIR+=	libukfs		# depends on librumpvfs, librump
    269 
    270 .if (${MKTPM} != "no")
    271 SUBDIR+=	../crypto/external/cpl/trousers/lib
    272 .endif
    273 
    274 #==================== 5th library dependency barrier ====================
    275 SUBDIR+=	.WAIT
    276 
    277 SUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
    278 
    279 .if (${MKTPM} != "no")
    280 SUBDIR+=	../crypto/external/cpl/tpm-tools/lib	# depends on trousers
    281 .endif
    282 
    283 .if !defined(BSD_MK_COMPAT_FILE)
    284 SUBDIR+=	../sys/rump/dev/lib
    285 SUBDIR+=	../sys/rump/fs/lib
    286 SUBDIR+=	../sys/rump/kern/lib
    287 SUBDIR+=	../sys/rump/net/lib
    288 .endif
    289 .endif
    290 
    291 # Lua bindings come last, they might depend on anything
    292 SUBDIR+=	lua
    293 
    294 # Needed by rump and rescue which are outside the smbfs tree
    295 SUBDIR+=	../external/bsd/smbfs/lib
    296 
    297 .for S in ${SUBDIR}
    298 .if ${S} != ".WAIT"
    299 SUBLIB_${S}!=	cd ${S} && ${MAKE} -V LIB
    300 SUBDEP_${S}!=	cd ${S} && ${MAKE} -V LIBDPLIBS
    301 .endif
    302 .endfor
    303 
    304 showdeps:
    305 .for S in ${SUBDIR}
    306 .if ${S} != ".WAIT"
    307 .for DL DD in ${SUBDEP_${S}}
    308 	@echo ${S} ${SUBLIB_${S}} ${DL} ${DD:C,^${.CURDIR}/,,}
    309 .endfor
    310 .endif
    311 .endfor
    312 
    313 .include <bsd.buildinstall.mk>
    314 .include <bsd.subdir.mk>
    315