xref: /freebsd/lib/Makefile (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1
2.include <src.opts.mk>
3
4# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
5# of the other libraries.  These are built first with a .WAIT between them
6# and the main list to avoid needing a SUBDIR_DEPEND line on every library
7# naming just these few items.
8
9SUBDIR_BOOTSTRAP= \
10	csu \
11	.WAIT \
12	libc \
13	libc_nonshared \
14	libcompiler_rt \
15	${_libclang_rt} \
16	libc++ \
17	libc++experimental \
18	libcxxrt \
19	libelf \
20	libssp \
21	libssp_nonshared \
22	msun
23
24# The main list; please keep these sorted alphabetically.
25# The only exception is sqlite3: we place it at the start of the list since it
26# takes a long time to build and starting it first improves parallelism.
27
28SUBDIR=	${SUBDIR_BOOTSTRAP} \
29	.WAIT \
30	libsqlite3 \
31	geom \
32	lib9p \
33	libalias \
34	libarchive \
35	libauditd \
36	libbegemot \
37	libblocksruntime \
38	libbsddialog \
39	libbsdstat \
40	libbsm \
41	libbz2 \
42	libcalendar \
43	libcam \
44	libcapsicum \
45	libcasper \
46	libcompat \
47	libcrypt \
48	libdevctl \
49	libdevdctl \
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	nss_tacplus
112
113# Inter-library dependencies.  When the makefile for a library contains LDADD
114# libraries, those libraries should be listed as build order dependencies here.
115
116SUBDIR_DEPEND_geom=	libufs
117SUBDIR_DEPEND_googletest= libregex
118SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
119SUBDIR_DEPEND_libauditdm= libbsm
120SUBDIR_DEPEND_libbsddialog= ncurses
121SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
122SUBDIR_DEPEND_libc++:= libcxxrt
123# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
124# small enough to build that this bit of serialization is likely insignificant.
125SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
126SUBDIR_DEPEND_libcam= libsbuf
127SUBDIR_DEPEND_libcasper= libnv
128SUBDIR_DEPEND_libdevstat= libkvm
129SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
130SUBDIR_DEPEND_libedit= ncurses
131SUBDIR_DEPEND_libgeom= libexpat libsbuf
132SUBDIR_DEPEND_librpcsec_gss= libgssapi
133SUBDIR_DEPEND_libmagic= libz
134SUBDIR_DEPEND_libmemstat= libkvm
135SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
136SUBDIR_DEPEND_libpjdlog= libutil
137SUBDIR_DEPEND_libprocstat= libkvm libutil
138SUBDIR_DEPEND_libradius= libmd
139SUBDIR_DEPEND_libsmb= libkiconv
140SUBDIR_DEPEND_libtacplus= libmd
141SUBDIR_DEPEND_libulog= libmd
142SUBDIR_DEPEND_libunbound= ${_libldns}
143SUBDIR_DEPEND_liblzma= libthr
144.if ${MK_OFED} != "no"
145SUBDIR_DEPEND_libpcap= ofed
146.endif
147SUBDIR_DEPEND_nss_tacplus= libtacplus
148
149.if !defined(COMPAT_LIBCOMPAT)
150SUBDIR+=	flua
151SUBDIR_DEPEND_flua=	libjail
152.endif
153
154# NB: keep these sorted by MK_* knobs
155
156SUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
157SUBDIR.${MK_BLACKLIST}+=libblacklist
158SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
159SUBDIR.${MK_BSNMP}+=	libbsnmp
160
161.if !defined(COMPAT_LIBCOMPAT)
162.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \
163    ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
164SUBDIR+=	clang
165.endif
166.endif
167
168SUBDIR.${MK_CUSE}+= 	libcuse
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.
180.if ${COMPILER_TYPE} == "clang"
181_libclang_rt=	libclang_rt
182.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
183.error Requested build with sanitizers but cannot build runtime libraries!
184.endif
185
186SUBDIR.${MK_EFI}+=	libefivar
187SUBDIR.${MK_GOOGLETEST}+=	googletest
188SUBDIR.${MK_NETGRAPH}+=	libnetgraph
189SUBDIR.${MK_NIS}+=	libypclnt
190
191.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
192_libvgl=	libvgl
193.endif
194
195.if ${MACHINE_CPUARCH} == "aarch64"
196SUBDIR.${MK_PMC}+=	libopencsd
197.endif
198
199.if ${MACHINE_CPUARCH} == "amd64"
200SUBDIR.${MK_PMC}+=	libipt
201SUBDIR.${MK_BHYVE}+=	libvmmapi
202.endif
203
204.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm"
205SUBDIR.${MK_OPENMP}+=	libomp
206.endif
207.if ${MK_USB} != "no"
208SUBDIR.${MK_OPENSSH}+=	libcbor libfido2
209.endif
210SUBDIR.${MK_OPENSSL}+=	libmp
211SUBDIR.${MK_PF}+=	libpfctl
212SUBDIR.${MK_PMC}+=	libpmc libpmcstat
213SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
214SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
215SUBDIR.${MK_TELNET}+=	libtelnet
216SUBDIR.${MK_TESTS_SUPPORT}+=	atf
217SUBDIR.${MK_TESTS_SUPPORT}+=	liblutok
218SUBDIR.${MK_TESTS}+=	tests
219SUBDIR.${MK_UNBOUND}+=	libunbound
220SUBDIR.${MK_USB}+=	libusbhid libusb
221SUBDIR.${MK_OFED}+=	ofed
222SUBDIR.${MK_VERIEXEC}+=	libveriexec
223SUBDIR.${MK_ZFS}+=	libbe
224
225.if !make(install)
226SUBDIR_PARALLEL=
227.endif
228
229.include <bsd.subdir.mk>
230