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