xref: /freebsd/lib/Makefile (revision 3884d6f8bd7e13a2b152fedc2d0d4f6de5ad17b8)
1#	@(#)Makefile	8.1 (Berkeley) 6/4/93
2# $FreeBSD$
3
4.include <src.opts.mk>
5
6# The SUBDIR_ORDERED 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_ORDERED=	csu \
12	.WAIT \
13	libc \
14	libc_nonshared \
15	libcompiler_rt \
16	${_libclang_rt} \
17	${_libcplusplus} \
18	${_libcxxrt} \
19	libelf \
20	msun
21
22# The main list; please keep these sorted alphabetically.
23
24SUBDIR=	${SUBDIR_ORDERED} \
25	.WAIT \
26	libalias \
27	libarchive \
28	${_libatm} \
29	libauditd \
30	libbegemot \
31	libblocksruntime \
32	${_libbluetooth} \
33	${_libbsnmp} \
34	libbsdstat \
35	libbsm \
36	libbz2 \
37	libcalendar \
38	libcam \
39	${_libcapsicum} \
40	${_libcasper} \
41	${_libcom_err} \
42	libcompat \
43	libcrypt \
44	libdevctl \
45	libdevinfo \
46	libdevstat \
47	libdpv \
48	libdwarf \
49	libedit \
50	${_libelftc} \
51	libevent \
52	libexecinfo \
53	libexpat \
54	libfetch \
55	libfigpar \
56	libgeom \
57	${_libgpio} \
58	${_libgssapi} \
59	${_librpcsec_gss} \
60	${_libiconv_modules} \
61	libipsec \
62	libjail \
63	libkiconv \
64	libkvm \
65	${_libldns} \
66	liblzma \
67	${_libmagic} \
68	libmemstat \
69	libmd \
70	${_libmilter} \
71	${_libmp} \
72	libmt \
73	${_libnandfs} \
74	lib80211 \
75	libnetbsd \
76	${_libnetgraph} \
77	${_libngatm} \
78	libnv \
79	libopenbsd \
80	libopie \
81	libpam \
82	libpcap \
83	${_libpe} \
84	libpjdlog \
85	${_libpmc} \
86	${_libproc} \
87	libprocstat \
88	${_libradius} \
89	librpcsvc \
90	librt \
91	${_librtld_db} \
92	libsbuf \
93	${_libsdp} \
94	${_libsm} \
95	libsmb \
96	${_libsmdb} \
97	${_libsmutil} \
98	libsqlite3 \
99	libstand \
100	libstdbuf \
101	libstdthreads \
102	libsysdecode \
103	libtacplus \
104	${_libtelnet} \
105	${_libthr} \
106	libthread_db \
107	libucl \
108	libufs \
109	libugidfw \
110	libulog \
111	${_libunbound} \
112	${_libusbhid} \
113	${_libusb} \
114	libutil \
115	${_libvgl} \
116	${_libvmmapi} \
117	libwrap \
118	libxo \
119	liby \
120	${_libypclnt} \
121	libz \
122	ncurses \
123	${_atf} \
124	${_clang} \
125	${_cuse} \
126	${_tests}
127
128# Inter-library dependencies.  When the makefile for a library contains LDADD
129# libraries, those libraries should be listed as build order dependencies here.
130
131SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
132SUBDIR_DEPEND_libatm= libmd
133SUBDIR_DEPEND_libauditdm= libbsm
134SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
135SUBDIR_DEPEND_libc++:= libcxxrt
136SUBDIR_DEPEND_libc= libcompiler_rt
137SUBDIR_DEPEND_libcam= libsbuf
138SUBDIR_DEPEND_libcapsicum= libnv
139SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog
140SUBDIR_DEPEND_libdevstat= libkvm
141SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
142SUBDIR_DEPEND_libedit= ncurses
143SUBDIR_DEPEND_libgeom= libexpat libsbuf
144SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
145SUBDIR_DEPEND_libmagic= libz
146SUBDIR_DEPEND_libmemstat= libkvm
147SUBDIR_DEPEND_libopie= libmd
148SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
149SUBDIR_DEPEND_libpjdlog= libutil
150SUBDIR_DEPEND_libprocstat= libkvm libutil
151SUBDIR_DEPEND_libradius= libmd
152SUBDIR_DEPEND_libsmb= libkiconv
153SUBDIR_DEPEND_libtacplus= libmd
154SUBDIR_DEPEND_libulog= libmd
155SUBDIR_DEPEND_libunbound= ${_libldns}
156SUBDIR_DEPEND_liblzma= ${_libthr}
157
158# NB: keep these sorted by MK_* knobs
159
160.if ${MK_ATM} != "no"
161_libngatm=	libngatm
162.endif
163
164.if ${MK_BLUETOOTH} != "no"
165_libbluetooth=	libbluetooth
166_libsdp=	libsdp
167.endif
168
169.if ${MK_BSNMP} != "no"
170_libbsnmp=	libbsnmp
171.endif
172
173.if ${MK_CASPER} != "no"
174_libcapsicum=	libcapsicum
175_libcasper=	libcasper
176.endif
177
178.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
179_clang=		clang
180.endif
181
182.if ${MK_CUSE} != "no"
183_cuse=		libcuse
184.endif
185
186.if ${MK_TOOLCHAIN} != "no"
187_libelftc=	libelftc
188_libpe=		libpe
189.endif
190
191.if ${MK_FILE} != "no"
192_libmagic=	libmagic
193.endif
194
195.if ${MK_GPIO} != "no"
196_libgpio=	libgpio
197.endif
198
199.if ${MK_GSSAPI} != "no"
200_libgssapi=	libgssapi
201_librpcsec_gss=	librpcsec_gss
202.endif
203
204.if ${MK_ICONV} != "no"
205_libiconv_modules=	libiconv_modules
206.endif
207
208.if ${MK_KERBEROS_SUPPORT} != "no"
209_libcom_err= libcom_err
210.endif
211
212.if ${MK_LDNS} != "no"
213_libldns=	libldns
214.endif
215
216# The libraries under libclang_rt can only be built by clang, and only make
217# sense to build when clang is enabled at all.  Furthermore, they can only be
218# built for certain architectures.
219.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
220    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
221    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
222    (${MACHINE_CPUARCH} == "i386"))
223_libclang_rt=	libclang_rt
224.endif
225
226.if ${MK_LIBCPLUSPLUS} != "no"
227_libcxxrt=	libcxxrt
228_libcplusplus=	libc++
229.endif
230
231.if ${MK_LIBTHR} != "no"
232_libthr=	libthr
233.endif
234
235.if ${MK_NAND} != "no"
236_libnandfs=	libnandfs
237.endif
238
239.if ${MK_NETGRAPH} != "no"
240_libnetgraph=	libnetgraph
241.endif
242
243.if ${MK_NIS} != "no"
244_libypclnt=	libypclnt
245.endif
246
247.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
248_libvgl=	libvgl
249_libproc=	libproc
250_librtld_db=	librtld_db
251.endif
252
253.if ${MACHINE_CPUARCH} == "amd64"
254.if ${MK_BHYVE} != "no"
255_libvmmapi=	libvmmapi
256.endif
257.endif
258
259.if ${MACHINE_CPUARCH} == "mips"
260_libproc=	libproc
261_librtld_db=	librtld_db
262.endif
263
264.if ${MACHINE_CPUARCH} == "powerpc"
265_libproc=	libproc
266_librtld_db=	librtld_db
267.endif
268
269.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
270    ${MACHINE_CPUARCH} == "riscv"
271_libproc=	libproc
272_librtld_db=	librtld_db
273.endif
274
275.if ${MK_OPENSSL} != "no"
276_libmp=		libmp
277.endif
278
279.if ${MK_PMC} != "no"
280_libpmc=	libpmc
281.endif
282
283.if ${MK_RADIUS_SUPPORT} != "no"
284_libradius=	libradius
285.endif
286
287.if ${MK_SENDMAIL} != "no"
288_libmilter=	libmilter
289_libsm=		libsm
290_libsmdb=	libsmdb
291_libsmutil=	libsmutil
292.endif
293
294.if ${MK_TELNET} != "no"
295_libtelnet=	libtelnet
296.endif
297
298.if ${MK_TESTS_SUPPORT} != "no"
299_atf=		atf
300.endif
301.if ${MK_TESTS} != "no"
302_tests=		tests
303.endif
304
305.if ${MK_UNBOUND} != "no"
306_libunbound=	libunbound
307.endif
308
309.if ${MK_USB} != "no"
310_libusbhid=	libusbhid
311_libusb=	libusb
312.endif
313
314.if !make(install)
315SUBDIR_PARALLEL=
316.endif
317
318.include <bsd.subdir.mk>
319