xref: /freebsd/lib/Makefile (revision ed549cb0c53f8438c52593ce811f6fcc812248e9)
1#	@(#)Makefile	8.1 (Berkeley) 6/4/93
2# $FreeBSD$
3
4.include <src.opts.mk>
5
6# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
7# of the other libraries.  These are built first with a .WAIT between them
8# and the main list to avoid needing a SUBDIR_DEPEND line on every library
9# naming just these few items.
10
11SUBDIR_BOOTSTRAP= \
12	csu \
13	.WAIT \
14	libc \
15	libc_nonshared \
16	libcompiler_rt \
17	${_libclang_rt} \
18	${_libcplusplus} \
19	${_libcxxrt} \
20	libelf \
21	libssp \
22	libssp_nonshared \
23	msun
24
25# The main list; please keep these sorted alphabetically.
26# The only exception is sqlite3: we place it at the start of the list since it
27# takes a long time to build and starting it first improves parallelism.
28
29SUBDIR=	${SUBDIR_BOOTSTRAP} \
30	.WAIT \
31	libsqlite3 \
32	geom \
33	lib9p \
34	libalias \
35	libarchive \
36	libauditd \
37	libbegemot \
38	libblocksruntime \
39	libbsddialog \
40	libbsdstat \
41	libbsm \
42	libbz2 \
43	libcalendar \
44	libcam \
45	libcapsicum \
46	libcasper \
47	libcompat \
48	libcrypt \
49	libdevctl \
50	libdevinfo \
51	libdevstat \
52	libdl \
53	libdwarf \
54	libedit \
55	libelftc \
56	libevent1 \
57	libexecinfo \
58	libexpat \
59	libfetch \
60	libgcc_eh \
61	libgcc_s \
62	libgeom \
63	libifconfig \
64	libipsec \
65	libiscsiutil \
66	libjail \
67	libkiconv \
68	libkvm \
69	liblua \
70	liblzma \
71	libmemstat \
72	libmd \
73	libmixer \
74	libmt \
75	lib80211 \
76	libnetbsd \
77	libnetmap \
78	libnv \
79	libopenbsd \
80	libpam \
81	libpathconv \
82	libpcap \
83	libpjdlog \
84	libproc \
85	libprocstat \
86	libregex \
87	librpcsvc \
88	librss \
89	librt \
90	librtld_db \
91	libsbuf \
92	libsmb \
93	libstdbuf \
94	libstdthreads \
95	libsysdecode \
96	libtacplus \
97	libthr \
98	libthread_db \
99	libucl \
100	libufs \
101	libugidfw \
102	libulog \
103	libutil \
104	${_libvgl} \
105	libwrap \
106	libxo \
107	liby \
108	libz \
109	libzstd \
110	ncurses
111
112# Inter-library dependencies.  When the makefile for a library contains LDADD
113# libraries, those libraries should be listed as build order dependencies here.
114
115SUBDIR_DEPEND_geom=	libufs
116SUBDIR_DEPEND_googletest= libregex
117SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
118SUBDIR_DEPEND_libauditdm= libbsm
119SUBDIR_DEPEND_libbsddialog= ncurses
120SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
121SUBDIR_DEPEND_libc++:= libcxxrt
122# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
123# small enough to build that this bit of serialization is likely insignificant.
124SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
125SUBDIR_DEPEND_libcam= libsbuf
126SUBDIR_DEPEND_libcasper= libnv
127SUBDIR_DEPEND_libdevstat= libkvm
128SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
129SUBDIR_DEPEND_libedit= ncurses
130SUBDIR_DEPEND_libgeom= libexpat libsbuf
131SUBDIR_DEPEND_librpcsec_gss= libgssapi
132SUBDIR_DEPEND_libmagic= libz
133SUBDIR_DEPEND_libmemstat= libkvm
134SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
135SUBDIR_DEPEND_libpjdlog= libutil
136SUBDIR_DEPEND_libprocstat= libkvm libutil
137SUBDIR_DEPEND_libradius= libmd
138SUBDIR_DEPEND_libsmb= libkiconv
139SUBDIR_DEPEND_libtacplus= libmd
140SUBDIR_DEPEND_libulog= libmd
141SUBDIR_DEPEND_libunbound= ${_libldns}
142SUBDIR_DEPEND_liblzma= libthr
143.if ${MK_OFED} != "no"
144SUBDIR_DEPEND_libpcap= ofed
145.endif
146
147.if !defined(COMPAT_32BIT)
148SUBDIR+=	flua
149SUBDIR_DEPEND_flua=	libjail
150.endif
151
152# NB: keep these sorted by MK_* knobs
153
154SUBDIR.${MK_ATM}+=	libngatm
155SUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
156SUBDIR.${MK_BLACKLIST}+=libblacklist
157SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
158SUBDIR.${MK_BSNMP}+=	libbsnmp
159
160.if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
161.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \
162    ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
163SUBDIR+=	clang
164.endif
165.endif
166
167SUBDIR.${MK_CUSE}+= 	libcuse
168SUBDIR.${MK_CXX}+=	libdevdctl
169SUBDIR.${MK_TOOLCHAIN}+=libpe
170SUBDIR.${MK_DIALOG}+=	libdpv libfigpar
171SUBDIR.${MK_FILE}+=	libmagic
172SUBDIR.${MK_GPIO}+=	libgpio
173SUBDIR.${MK_GSSAPI}+=	libgssapi librpcsec_gss
174SUBDIR.${MK_ICONV}+=	libiconv_modules
175SUBDIR.${MK_KERBEROS_SUPPORT}+=	libcom_err
176SUBDIR.${MK_LDNS}+=	libldns
177SUBDIR.${MK_STATS}+=	libstats
178
179# The libraries under libclang_rt can only be built by clang and when we enable
180# C++ support.
181.if ${COMPILER_TYPE} == "clang" && ${MK_CXX} != "no"
182_libclang_rt=	libclang_rt
183.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
184.error Requested build with sanitizers but cannot build runtime libraries!
185.endif
186
187.if ${MK_CXX} != "no"
188_libcxxrt=	libcxxrt
189_libcplusplus=	libc++
190_libcplusplus+=	libc++experimental
191.endif
192
193SUBDIR.${MK_EFI}+=	libefivar
194SUBDIR.${MK_GOOGLETEST}+=	googletest
195SUBDIR.${MK_NETGRAPH}+=	libnetgraph
196SUBDIR.${MK_NIS}+=	libypclnt
197
198.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
199_libvgl=	libvgl
200.endif
201
202.if ${MACHINE_CPUARCH} == "aarch64"
203SUBDIR.${MK_PMC}+=	libopencsd
204.endif
205
206.if ${MACHINE_CPUARCH} == "amd64"
207SUBDIR.${MK_PMC}+=	libipt
208SUBDIR.${MK_BHYVE}+=	libvmmapi
209.endif
210
211.if ${MACHINE_ARCH} != "powerpc"
212SUBDIR.${MK_OPENMP}+=	libomp
213.endif
214.if !defined(COMPAT_32BIT) && ${MK_USB} != "no"
215SUBDIR.${MK_OPENSSH}+=	libcbor libfido2
216.endif
217SUBDIR.${MK_OPENSSL}+=	libmp
218SUBDIR.${MK_PF}+=	libpfctl
219SUBDIR.${MK_PMC}+=	libpmc libpmcstat
220SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
221SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
222SUBDIR.${MK_TELNET}+=	libtelnet
223SUBDIR.${MK_TESTS_SUPPORT}+=	atf
224SUBDIR.${MK_TESTS_SUPPORT}.${MK_CXX}+=	liblutok
225SUBDIR.${MK_TESTS}+=	tests
226SUBDIR.${MK_UNBOUND}+=	libunbound
227SUBDIR.${MK_USB}+=	libusbhid libusb
228SUBDIR.${MK_OFED}+=	ofed
229SUBDIR.${MK_VERIEXEC}+=	libveriexec
230SUBDIR.${MK_ZFS}+=	libbe
231
232.if !make(install)
233SUBDIR_PARALLEL=
234.endif
235
236.include <bsd.subdir.mk>
237