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