Makefile revision 1.247
1#	$NetBSD: Makefile,v 1.247 2016/10/11 17:02:28 macallan Exp $
2#	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
3
4.include <bsd.own.mk>
5
6SUBDIR=		csu .WAIT
7
8.if (${MKGCC} != "no")
9SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
10.endif
11
12SUBDIR+=	libc
13SUBDIR+=	.WAIT
14
15#
16# The SUBDIRs above are included here for completeness but should be built
17# and installed prior to make(dependall) in this file, as libraries listed
18# below will depend on versions from DESTDIR only.
19#
20
21SUBDIR+=	i18n_module
22
23SUBDIR+=	libarch \
24		libbluetooth libbsdmalloc libbz2 \
25		libcompat libcrypt \
26		libintl libipsec libkvm libm \
27		libossaudio libpci libpmc libposix libprop libpthread \
28		libpthread_dbg libpuffs libresolv librmt librpcsvc librt \
29		libtelnet libterminfo \
30		libusbhid libutil libwrap liby libz
31
32.if !defined(BSD_MK_COMPAT_FILE)
33SUBDIR+=	libkern
34.endif
35
36.if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
37LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
38LIBC_MACHINE_CPU?=${MACHINE_CPU}
39.if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
40SUBDIR+=	libc_vfp
41.endif
42.endif
43.if ${MACHINE_CPU} == "mips"
44SUBDIR+=	libc_fp
45.endif
46.if (${MKRUMP} != "no")
47SUBDIR+=	librumpclient
48.endif
49.if (${MKSKEY} != "no")
50SUBDIR+=	libskey
51.endif
52
53.if (${MKMDNS} != "no")
54SUBDIR+=	../external/apache2/mDNSResponder/lib
55.endif
56
57SUBDIR+=	../external/bsd/am-utils/lib
58
59SUBDIR+=	../external/bsd/flex/lib
60SUBDIR+=	../external/bsd/tre/lib
61SUBDIR+=	../external/bsd/elftoolchain/lib/libelf
62SUBDIR+=	../external/bsd/liblzf/lib
63SUBDIR+=	../external/bsd/libpcap/lib
64
65.if ${MKSLJIT} != "no"
66SUBDIR+=	../external/bsd/sljit/lib
67SUBDIR+=	libbpfjit
68.endif
69
70.if (${MKZFS} != "no")
71SUBDIR+=        ../external/cddl/osnet/lib/libavl
72SUBDIR+=        ../external/cddl/osnet/lib/libnvpair
73SUBDIR+=        ../external/cddl/osnet/lib/libumem
74SUBDIR+=        ../external/cddl/osnet/lib/libuutil
75.endif
76
77SUBDIR+=	../external/mit/expat/lib
78
79SUBDIR+=	../external/public-domain/sqlite/lib
80
81SUBDIR+=	../external/gpl2/libmalloc
82
83.if (${MKGCC} != "no")
84SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
85SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
86. if ${HAVE_GCC} == 48
87SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libmudflap
88SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libmudflapth
89. endif
90# Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
91# specific build area, but we get better parallelism this way.
92# We don't build compat versions of these.
93. if !defined(MLIBDIR)
94SUBDIR+=	../external/lgpl3/gmp/lib/libgmp
95SUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
96SUBDIR+=	../external/lgpl3/mpc/lib/libmpc
97. endif
98.endif
99
100#
101# Libraries that depend upon any listed previously
102# (and those that depend upon these [and ...])
103#
104#==================== 1st library dependency barrier ====================
105SUBDIR+=	.WAIT
106
107.if ${MKDTRACE} != "no"
108SUBDIR+=	../external/bsd/librtld_db/lib		# depends on libutil
109.endif
110
111.if ${MKCTF} != "no"
112SUBDIR+=        ../external/cddl/osnet/lib/libctf
113.endif
114
115SUBDIR+=	../external/public-domain/xz/lib	# depends on libpthread
116
117.if (${MKCRYPTO} != "no")
118SUBDIR+=	../crypto/external/bsd/netpgp/libmj
119SUBDIR+=	../crypto/external/bsd/netpgp/lib/verify # depends on libz
120.endif
121
122SUBDIR+=	../external/bsd/blacklist/lib		# depends on libpthread
123SUBDIR+=	../external/bsd/elftoolchain/lib/libdwarf # depends on libelf
124SUBDIR+=	../external/mit/lua/lib # depends on libm
125SUBDIR+=	libcurses	# depends on libterminfo
126SUBDIR+=	libdm		# depends on libprop
127SUBDIR+=	libedit		# depends on libterminfo
128SUBDIR+=	libexecinfo 	# depends on libelf
129SUBDIR+=	libppath	# depends on libprop
130SUBDIR+=	libperfuse	# depends on libpuffs
131SUBDIR+=	libquota	# depends on libprop and librpcsvc
132SUBDIR+=	librefuse	# depends on libpuffs
133SUBDIR+=	libisns 	# depends on libpthread
134.if (${MKRUMP} != "no")
135SUBDIR+=	librumpuser	# depends on libpthread
136SUBDIR+=	librumphijack	# depends on librumpclient and libpthread
137.endif
138
139.if (${MKNPF} != "no")
140SUBDIR+=	libnpf		# depends on libprop
141.endif
142
143.if (${MKCRYPTO} != "no")
144SUBDIR+=	../crypto/external/bsd/openssl/lib # depends on libcrypt
145.endif
146
147SUBDIR+=	../external/bsd/file/lib	# depends on libz
148
149.if (${MKISCSI} != "no")
150SUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
151.endif
152
153.if (${MKZFS} != "no")
154SUBDIR+=        ../external/cddl/osnet/lib/libzfs
155SUBDIR+=        ../external/cddl/osnet/lib/libzpool
156.endif
157
158.if (${MKLVM} != "no")
159SUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
160.endif
161
162.if (${MKBINUTILS} != "no")
163SUBDIR+=	../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib	# libbfd depends on libz
164.endif
165
166.if (${MKLIBCXX} != "no")
167SUBDIR+=	../external/bsd/libc++
168.endif
169
170.if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
171SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
172SUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
173.endif
174
175#==================== 2nd library dependency barrier ====================
176SUBDIR+=	.WAIT
177
178.for sanitizer in asan ubsan
179.if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
180SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
181.endif
182.endfor
183
184SUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
185
186.if (${MKNPF} != "no")
187SUBDIR+=	npf		# depends on libnpf
188.endif
189
190.if (${MKATF} != "no")
191SUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
192.endif
193
194.if (${MKKYUA} != "no")
195SUBDIR+=	../external/bsd/lutok/lib	# depends on lua and libstdc++
196.endif
197
198SUBDIR+=	libform		# depends on libcurses
199SUBDIR+=	libmenu		# depends on libcurses
200SUBDIR+=	libpanel	# depends on libcurses
201SUBDIR+=	libradius	# depends on libcrypto if (${MKCRYPTO} != "no")
202.if (${MKRUMP} != "no")
203SUBDIR+=	librump		# depends on librumpuser
204.endif
205
206.if (${MKKERBEROS} != "no")
207SUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
208							# libedit, libterminfo,
209.endif
210
211.if (${MKCRYPTO} != "no")
212SUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
213SUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
214.endif
215
216SUBDIR+=	../external/bsd/libevent/lib	# depends on libcrypto
217.if ${MKDTRACE} != "no"
218SUBDIR+=	../external/bsd/libproc/lib	# depends on libstdc++, libctf
219.endif
220SUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
221
222.if (${MKLDAP} != "no")
223SUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
224.endif
225
226#==================== 3rd library dependency barrier ====================
227SUBDIR+=	.WAIT
228
229SUBDIR+=	../external/bsd/bind/lib	# depends on heimdal, libcrypto
230.if ${MKCRYPTO} != "no" && ${MKUNBOUND} != "no"
231SUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
232.endif
233
234.if ${MKDTRACE} != "no"
235SUBDIR+=        ../external/cddl/osnet/lib/libdtrace	# depends on libproc
236.endif
237
238.if (${MKRUMP} != "no")
239SUBDIR+=	librumpdev	# depends on librump
240SUBDIR+=	librumpnet	# depends on librump
241SUBDIR+=	librumpvfs	# depends on librump
242.endif
243
244.if (${MKPAM} != "no")
245SUBDIR+=	libpam		# depends on heimdal
246.endif
247
248.if (${MKCRYPTO} != "no")
249SUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
250.endif
251
252SUBDIR+=	../external/bsd/mdocml/lib
253
254.if (${MKRUMP} != "no")
255#==================== 4th library dependency barrier ====================
256SUBDIR+=	.WAIT
257
258SUBDIR+=	libukfs		# depends on librumpvfs, librump
259
260.if (${MKTPM} != "no")
261SUBDIR+=	../crypto/external/cpl/trousers/lib
262.endif
263
264#==================== 5th library dependency barrier ====================
265SUBDIR+=	.WAIT
266
267SUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
268
269.if (${MKTPM} != "no")
270SUBDIR+=	../crypto/external/cpl/tpm-tools/lib	# depends on trousers
271.endif
272
273.if !defined(BSD_MK_COMPAT_FILE)
274SUBDIR+=	../sys/rump/dev/lib
275SUBDIR+=	../sys/rump/fs/lib
276SUBDIR+=	../sys/rump/kern/lib
277SUBDIR+=	../sys/rump/net/lib
278.endif
279.endif
280
281# Lua bindings come last, they might depend on anything
282SUBDIR+=	lua
283
284# Needed by rump and rescue which are outside the smbfs tree
285SUBDIR+=	../external/bsd/smbfs/lib
286
287.include <bsd.buildinstall.mk>
288.include <bsd.subdir.mk>
289