xref: /freebsd/lib/Makefile (revision 5d3e7166f6a0187fa3f8831b16a06bd9955c21ff)
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	libc++ \
19	libc++experimental \
20	libcxxrt \
21	libelf \
22	libssp \
23	libssp_nonshared \
24	msun
25
26# The main list; please keep these sorted alphabetically.
27# The only exception is sqlite3: we place it at the start of the list since it
28# takes a long time to build and starting it first improves parallelism.
29
30SUBDIR=	${SUBDIR_BOOTSTRAP} \
31	.WAIT \
32	libsqlite3 \
33	geom \
34	lib9p \
35	libalias \
36	libarchive \
37	libauditd \
38	libbegemot \
39	libblocksruntime \
40	libbsddialog \
41	libbsdstat \
42	libbsm \
43	libbz2 \
44	libcalendar \
45	libcam \
46	libcapsicum \
47	libcasper \
48	libcompat \
49	libcrypt \
50	libdevctl \
51	libdevdctl \
52	libdevinfo \
53	libdevstat \
54	libdl \
55	libdwarf \
56	libedit \
57	libelftc \
58	libevent1 \
59	libexecinfo \
60	libexpat \
61	libfetch \
62	libgcc_eh \
63	libgcc_s \
64	libgeom \
65	libifconfig \
66	libipsec \
67	libiscsiutil \
68	libjail \
69	libkiconv \
70	libkvm \
71	liblua \
72	liblzma \
73	libmemstat \
74	libmd \
75	libmixer \
76	libmt \
77	lib80211 \
78	libnetbsd \
79	libnetmap \
80	libnv \
81	libopenbsd \
82	libpam \
83	libpathconv \
84	libpcap \
85	libpjdlog \
86	libproc \
87	libprocstat \
88	libregex \
89	librpcsvc \
90	librss \
91	librt \
92	librtld_db \
93	libsbuf \
94	libsmb \
95	libstdbuf \
96	libstdthreads \
97	libsysdecode \
98	libtacplus \
99	libthr \
100	libthread_db \
101	libucl \
102	libufs \
103	libugidfw \
104	libulog \
105	libutil \
106	${_libvgl} \
107	libwrap \
108	libxo \
109	liby \
110	libz \
111	libzstd \
112	ncurses
113
114# Inter-library dependencies.  When the makefile for a library contains LDADD
115# libraries, those libraries should be listed as build order dependencies here.
116
117SUBDIR_DEPEND_geom=	libufs
118SUBDIR_DEPEND_googletest= libregex
119SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
120SUBDIR_DEPEND_libauditdm= libbsm
121SUBDIR_DEPEND_libbsddialog= ncurses
122SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
123SUBDIR_DEPEND_libc++:= libcxxrt
124# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
125# small enough to build that this bit of serialization is likely insignificant.
126SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
127SUBDIR_DEPEND_libcam= libsbuf
128SUBDIR_DEPEND_libcasper= libnv
129SUBDIR_DEPEND_libdevstat= libkvm
130SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
131SUBDIR_DEPEND_libedit= ncurses
132SUBDIR_DEPEND_libgeom= libexpat libsbuf
133SUBDIR_DEPEND_librpcsec_gss= libgssapi
134SUBDIR_DEPEND_libmagic= libz
135SUBDIR_DEPEND_libmemstat= libkvm
136SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
137SUBDIR_DEPEND_libpjdlog= libutil
138SUBDIR_DEPEND_libprocstat= libkvm libutil
139SUBDIR_DEPEND_libradius= libmd
140SUBDIR_DEPEND_libsmb= libkiconv
141SUBDIR_DEPEND_libtacplus= libmd
142SUBDIR_DEPEND_libulog= libmd
143SUBDIR_DEPEND_libunbound= ${_libldns}
144SUBDIR_DEPEND_liblzma= libthr
145.if ${MK_OFED} != "no"
146SUBDIR_DEPEND_libpcap= ofed
147.endif
148
149.if !defined(COMPAT_32BIT)
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_32BIT) && !defined(COMPAT_SOFTFP)
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"
205SUBDIR.${MK_OPENMP}+=	libomp
206.endif
207.if !defined(COMPAT_32BIT) && ${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