xref: /freebsd/lib/Makefile (revision c45018041d5537d2a91c2d63e3982127041d523b)
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
27SUBDIR=	${SUBDIR_BOOTSTRAP} \
28	.WAIT \
29	geom \
30	libalias \
31	libarchive \
32	libauditd \
33	libbegemot \
34	libblocksruntime \
35	libbsdstat \
36	libbsm \
37	libbz2 \
38	libcalendar \
39	libcam \
40	libcapsicum \
41	libcasper \
42	libcompat \
43	libcrypt \
44	libdevctl \
45	libdevinfo \
46	libdevstat \
47	libdl \
48	libdwarf \
49	libedit \
50	libelftc \
51	libevent \
52	libexecinfo \
53	libexpat \
54	libfetch \
55	libfigpar \
56	libgcc_eh \
57	libgcc_s \
58	libgeom \
59	libifconfig \
60	libipsec \
61	libjail \
62	libkiconv \
63	libkvm \
64	liblzma \
65	libmemstat \
66	libmd \
67	libmt \
68	lib80211 \
69	libnetbsd \
70	libnv \
71	libopenbsd \
72	libopie \
73	libpam \
74	libpathconv \
75	libpcap \
76	libpjdlog \
77	libproc \
78	libprocstat \
79	libregex \
80	librpcsvc \
81	librss \
82	librt \
83	librtld_db \
84	libsbuf \
85	libsmb \
86	libsqlite3 \
87	libstdbuf \
88	libstdthreads \
89	libsysdecode \
90	libtacplus \
91	libthread_db \
92	libucl \
93	libufs \
94	libugidfw \
95	libulog \
96	libutil \
97	${_libvgl} \
98	libwrap \
99	libxo \
100	liby \
101	libz \
102	libzstd \
103	ncurses
104
105# Inter-library dependencies.  When the makefile for a library contains LDADD
106# libraries, those libraries should be listed as build order dependencies here.
107
108SUBDIR_DEPEND_geom=	libufs
109SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
110SUBDIR_DEPEND_libauditdm= libbsm
111SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
112SUBDIR_DEPEND_libc++:= libcxxrt
113# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
114# small enough to build that this bit of serialization is likely insignificant.
115SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
116SUBDIR_DEPEND_libcam= libsbuf
117SUBDIR_DEPEND_libcasper= libnv
118SUBDIR_DEPEND_libdevstat= libkvm
119SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
120SUBDIR_DEPEND_libedit= ncurses
121SUBDIR_DEPEND_libgeom= libexpat libsbuf
122SUBDIR_DEPEND_librpcsec_gss= libgssapi
123SUBDIR_DEPEND_libmagic= libz
124SUBDIR_DEPEND_libmemstat= libkvm
125SUBDIR_DEPEND_libopie= libmd
126SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
127SUBDIR_DEPEND_libpjdlog= libutil
128SUBDIR_DEPEND_libprocstat= libkvm libutil
129SUBDIR_DEPEND_libradius= libmd
130SUBDIR_DEPEND_libsmb= libkiconv
131SUBDIR_DEPEND_libtacplus= libmd
132SUBDIR_DEPEND_libulog= libmd
133SUBDIR_DEPEND_libunbound= ${_libldns}
134SUBDIR_DEPEND_liblzma= ${_libthr}
135.if ${MK_OFED} != "no"
136SUBDIR_DEPEND_libpcap= ofed
137.endif
138
139# NB: keep these sorted by MK_* knobs
140
141SUBDIR.${MK_ATM}+=	libngatm
142SUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
143SUBDIR.${MK_BLACKLIST}+=libblacklist
144SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
145SUBDIR.${MK_BSNMP}+=	libbsnmp
146
147.if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
148SUBDIR.${MK_CLANG}+=	clang
149.endif
150
151SUBDIR.${MK_CUSE}+= 	libcuse
152SUBDIR.${MK_CXX}+=	libdevdctl
153SUBDIR.${MK_TOOLCHAIN}+=libpe
154SUBDIR.${MK_DIALOG}+=	libdpv
155SUBDIR.${MK_FILE}+=	libmagic
156SUBDIR.${MK_GPIO}+=	libgpio
157SUBDIR.${MK_GSSAPI}+=	libgssapi librpcsec_gss
158SUBDIR.${MK_ICONV}+=	libiconv_modules
159SUBDIR.${MK_KERBEROS_SUPPORT}+=	libcom_err
160SUBDIR.${MK_LDNS}+=	libldns
161SUBDIR.${MK_STATS}+=	libstats
162
163# The libraries under libclang_rt can only be built by clang, and only make
164# sense to build when clang is enabled at all.  Furthermore, they can only be
165# built for certain architectures.
166.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
167    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
168    ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \
169    ${MACHINE_CPUARCH} == "powerpc")
170_libclang_rt=	libclang_rt
171.endif
172
173.if ${MK_LIBCPLUSPLUS} != "no"
174_libcxxrt=	libcxxrt
175_libcplusplus=	libc++
176_libcplusplus+=	libc++experimental
177.endif
178
179SUBDIR.${MK_EFI}+=	libefivar
180SUBDIR.${MK_GOOGLETEST}+=	googletest
181SUBDIR.${MK_LIBTHR}+=	libthr
182SUBDIR.${MK_NETGRAPH}+=	libnetgraph
183SUBDIR.${MK_NIS}+=	libypclnt
184
185.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
186_libvgl=	libvgl
187.endif
188
189.if ${MACHINE_CPUARCH} == "aarch64"
190SUBDIR.${MK_PMC}+=	libopencsd
191.endif
192
193.if ${MACHINE_CPUARCH} == "amd64"
194SUBDIR.${MK_PMC}+=	libipt
195SUBDIR.${MK_BHYVE}+=	libvmmapi
196.endif
197
198.if ${MACHINE_ARCH} != "powerpc"
199SUBDIR.${MK_OPENMP}+=	libomp
200.endif
201SUBDIR.${MK_OPENSSL}+=	libmp
202SUBDIR.${MK_PMC}+=	libpmc libpmcstat
203SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
204SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
205SUBDIR.${MK_TELNET}+=	libtelnet
206SUBDIR.${MK_TESTS_SUPPORT}+=	atf
207SUBDIR.${MK_TESTS}+=	tests
208SUBDIR.${MK_UNBOUND}+=	libunbound
209SUBDIR.${MK_USB}+=	libusbhid libusb
210SUBDIR.${MK_OFED}+=	ofed
211SUBDIR.${MK_VERIEXEC}+=	libveriexec
212SUBDIR.${MK_ZFS}+=	libbe
213
214.if !make(install)
215SUBDIR_PARALLEL=
216.endif
217
218.include <bsd.subdir.mk>
219