xref: /freebsd/lib/Makefile (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
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	libnetbsd \
75	${_libnetgraph} \
76	${_libngatm} \
77	libnv \
78	libohash \
79	libopie \
80	libpam \
81	libpcap \
82	libpjdlog \
83	${_libpmc} \
84	${_libproc} \
85	libprocstat \
86	${_libradius} \
87	librpcsvc \
88	librt \
89	${_librtld_db} \
90	libsbuf \
91	${_libsdp} \
92	${_libsm} \
93	${_libsmb} \
94	${_libsmdb} \
95	${_libsmutil} \
96	libsqlite3 \
97	libstand \
98	libstdbuf \
99	libstdthreads \
100	libtacplus \
101	${_libtelnet} \
102	${_libthr} \
103	libthread_db \
104	libucl \
105	libufs \
106	libugidfw \
107	libulog \
108	${_libunbound} \
109	${_libusbhid} \
110	${_libusb} \
111	libutil \
112	${_libvgl} \
113	${_libvmmapi} \
114	libwrap \
115	libxo \
116	liby \
117	${_libypclnt} \
118	libz \
119	ncurses \
120	${_atf} \
121	${_clang} \
122	${_cuse} \
123	${_tests}
124
125# Inter-library dependencies.  When the makefile for a library contains LDADD
126# libraries, those libraries should be listed as build order dependencies here.
127
128SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
129SUBDIR_DEPEND_libatm= libmd
130SUBDIR_DEPEND_libauditdm= libbsm
131SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
132SUBDIR_DEPEND_libc++:= libcxxrt
133SUBDIR_DEPEND_libc= libcompiler_rt
134SUBDIR_DEPEND_libcam= libsbuf
135SUBDIR_DEPEND_libcapsicum= libnv
136SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog
137SUBDIR_DEPEND_libdevstat= libkvm
138SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
139SUBDIR_DEPEND_libedit= ncurses
140SUBDIR_DEPEND_libgeom= libexpat libsbuf
141SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
142SUBDIR_DEPEND_libmagic= libz
143SUBDIR_DEPEND_libmemstat= libkvm
144SUBDIR_DEPEND_libopie= libmd
145SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
146SUBDIR_DEPEND_libpjdlog= libutil
147SUBDIR_DEPEND_libprocstat= libkvm libutil
148SUBDIR_DEPEND_libradius= libmd
149SUBDIR_DEPEND_libsmb= libkiconv
150SUBDIR_DEPEND_libtacplus= libmd
151SUBDIR_DEPEND_libulog= libmd
152SUBDIR_DEPEND_libunbound= ${_libldns}
153SUBDIR_DEPEND_liblzma= ${_libthr}
154
155# NB: keep these sorted by MK_* knobs
156
157.if ${MK_ATM} != "no"
158_libngatm=	libngatm
159.endif
160
161.if ${MK_BLUETOOTH} != "no"
162_libbluetooth=	libbluetooth
163_libsdp=	libsdp
164.endif
165
166.if ${MK_BSNMP} != "no"
167_libbsnmp=	libbsnmp
168.endif
169
170.if ${MK_CASPER} != "no"
171_libcapsicum=	libcapsicum
172_libcasper=	libcasper
173.endif
174
175.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
176_clang=		clang
177.endif
178
179.if ${MK_CUSE} != "no"
180_cuse=		libcuse
181.endif
182
183.if ${MK_TOOLCHAIN} != "no"
184_libelftc=	libelftc
185.endif
186
187.if ${MK_FILE} != "no"
188_libmagic=	libmagic
189.endif
190
191.if ${MK_GPIO} != "no"
192_libgpio=	libgpio
193.endif
194
195.if ${MK_GSSAPI} != "no"
196_libgssapi=	libgssapi
197_librpcsec_gss=	librpcsec_gss
198.endif
199
200.if ${MK_ICONV} != "no"
201_libiconv_modules=	libiconv_modules
202.endif
203
204.if ${MK_KERBEROS_SUPPORT} != "no"
205_libcom_err= libcom_err
206.endif
207
208.if ${MK_LDNS} != "no"
209_libldns=	libldns
210.endif
211
212# The libraries under libclang_rt can only be built by clang, and only make
213# sense to build when clang is enabled at all.  Furthermore, they can only be
214# built for certain architectures.
215.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
216    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
217    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
218    (${MACHINE_CPUARCH} == "i386"))
219_libclang_rt=	libclang_rt
220.endif
221
222.if ${MK_LIBCPLUSPLUS} != "no"
223_libcxxrt=	libcxxrt
224_libcplusplus=	libc++
225.endif
226
227.if ${MK_LIBTHR} != "no"
228_libthr=	libthr
229.endif
230
231.if ${MK_NAND} != "no"
232_libnandfs=	libnandfs
233.endif
234
235.if ${MK_NETGRAPH} != "no"
236_libnetgraph=	libnetgraph
237.endif
238
239.if ${MK_NIS} != "no"
240_libypclnt=	libypclnt
241.endif
242
243.if ${MK_PF} != "no"
244_libevent=	libevent
245.endif
246
247.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
248_libsmb=	libsmb
249_libvgl=	libvgl
250_libproc=	libproc
251_librtld_db=	librtld_db
252.endif
253
254.if ${MACHINE_CPUARCH} == "amd64"
255.if ${MK_BHYVE} != "no"
256_libvmmapi=	libvmmapi
257.endif
258.endif
259
260.if ${MACHINE_CPUARCH} == "mips"
261_libproc=	libproc
262_librtld_db=	librtld_db
263.endif
264
265.if ${MACHINE_CPUARCH} == "powerpc"
266_libproc=	libproc
267_librtld_db=	librtld_db
268_libsmb=	libsmb
269.endif
270
271.if ${MACHINE_CPUARCH} == "sparc64"
272_libsmb=	libsmb
273.endif
274
275.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
276_libsmb=	libsmb
277_libproc=	libproc
278_librtld_db=	librtld_db
279.endif
280
281.if ${MK_OPENSSL} != "no"
282_libmp=		libmp
283.endif
284
285.if ${MK_PMC} != "no"
286_libpmc=	libpmc
287.endif
288
289.if ${MK_RADIUS_SUPPORT} != "no"
290_libradius=	libradius
291.endif
292
293.if ${MK_SENDMAIL} != "no"
294_libmilter=	libmilter
295_libsm=		libsm
296_libsmdb=	libsmdb
297_libsmutil=	libsmutil
298.endif
299
300.if ${MK_TELNET} != "no"
301_libtelnet=	libtelnet
302.endif
303
304.if ${MK_TESTS_SUPPORT} != "no"
305_atf=		atf
306.endif
307.if ${MK_TESTS} != "no"
308_tests=		tests
309.endif
310
311.if ${MK_UNBOUND} != "no"
312_libunbound=	libunbound
313.endif
314
315.if ${MK_USB} != "no"
316_libusbhid=	libusbhid
317_libusb=	libusb
318.endif
319
320.if !defined(LIBRARIES_ONLY)
321afterinstall:
322	${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
323.endif
324
325.if !make(install)
326SUBDIR_PARALLEL=
327.endif
328
329.include <bsd.subdir.mk>
330