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