Makefile revision 1.257 1 # $NetBSD: Makefile,v 1.257 2018/05/28 21:05:00 chs 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 libpmc 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 .if (${MKZFS} != "no")
71 SUBDIR+= ../external/cddl/osnet/lib/libavl
72 SUBDIR+= ../external/cddl/osnet/lib/libnvpair
73 SUBDIR+= ../external/cddl/osnet/lib/libumem
74 SUBDIR+= ../external/cddl/osnet/lib/libuutil
75 .endif
76
77 SUBDIR+= ../external/mit/expat/lib
78
79 SUBDIR+= ../external/public-domain/sqlite/lib
80
81 SUBDIR+= ../external/gpl2/libmalloc
82
83 .if (${MKGCC} != "no")
84 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
85 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
86 # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
87 # specific build area, but we get better parallelism this way.
88 # We don't build compat versions of these.
89 . if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
90 SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
91 SUBDIR+= ../external/lgpl3/mpfr/lib/libmpfr
92 SUBDIR+= ../external/lgpl3/mpc/lib/libmpc
93 . endif
94 .endif
95
96 #
97 # Libraries that depend upon any listed previously
98 # (and those that depend upon these [and ...])
99 #
100 #==================== 1st library dependency barrier ====================
101 SUBDIR+= .WAIT
102
103 .if ${MKDTRACE} != "no"
104 SUBDIR+= ../external/bsd/librtld_db/lib # depends on libutil
105 .endif
106
107 .if ${MKCTF} != "no"
108 SUBDIR+= ../external/cddl/osnet/lib/libctf
109 .endif
110
111 SUBDIR+= ../external/public-domain/xz/lib # depends on libpthread
112 SUBDIR+= ../crypto/external/bsd/netpgp/libmj
113 SUBDIR+= ../crypto/external/bsd/netpgp/lib/verify # depends on libz
114 SUBDIR+= ../external/bsd/blacklist/lib # depends on libpthread
115 SUBDIR+= ../external/bsd/elftoolchain/lib/libdwarf # depends on libelf
116 SUBDIR+= ../external/mit/lua/lib # depends on libm
117 SUBDIR+= libcurses # depends on libterminfo
118 SUBDIR+= libdm # depends on libprop
119 SUBDIR+= libedit # depends on libterminfo
120 SUBDIR+= libexecinfo # depends on libelf
121 SUBDIR+= libppath # depends on libprop
122 SUBDIR+= libperfuse # depends on libpuffs
123 SUBDIR+= libquota # depends on libprop and librpcsvc
124 SUBDIR+= librefuse # depends on libpuffs
125 SUBDIR+= libisns # depends on libpthread
126 .if (${MKRUMP} != "no")
127 SUBDIR+= librumphijack # depends on librumpclient and libpthread
128 SUBDIR+= librumpres # depends on librumpclient
129 SUBDIR+= librumpuser # depends on libpthread
130 .endif
131
132 .if (${MKNPF} != "no")
133 SUBDIR+= libnpf # depends on libprop
134 .endif
135
136 SUBDIR+= ../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib # depends on libcrypt
137 SUBDIR+= ../external/bsd/file/lib # depends on libz
138
139 .if (${MKISCSI} != "no")
140 SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
141 .endif
142
143 .if (${MKZFS} != "no")
144 SUBDIR+= ../external/cddl/osnet/lib/libzfs_core
145 SUBDIR+= ../external/cddl/osnet/lib/libzpool
146 .endif
147
148 .if (${MKLVM} != "no")
149 SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
150 .endif
151
152 .if (${MKBINUTILS} != "no")
153 SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
154 .endif
155
156 .if (${MKLIBCXX} != "no")
157 SUBDIR+= ../external/bsd/libc++
158 .endif
159
160 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
161 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
162 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
163 .endif
164
165 #==================== 2nd library dependency barrier ====================
166 SUBDIR+= .WAIT
167
168 .for sanitizer in asan ubsan
169 .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
170 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
171 .endif
172 .endfor
173
174 SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
175
176 .if (${MKNPF} != "no")
177 SUBDIR+= npf # depends on libnpf
178 .endif
179
180 .if (${MKATF} != "no")
181 SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
182 .endif
183
184 .if (${MKKYUA} != "no")
185 SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
186 .endif
187
188 SUBDIR+= libform # depends on libcurses
189 SUBDIR+= libmenu # depends on libcurses
190 SUBDIR+= libpanel # depends on libcurses
191 SUBDIR+= libradius # depends on libcrypto
192 .if (${MKRUMP} != "no")
193 SUBDIR+= librump # depends on librumpuser
194 .endif
195
196 .if (${MKKERBEROS} != "no")
197 SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
198 # libedit, libterminfo,
199 .endif
200
201 SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
202 SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
203 SUBDIR+= ../external/bsd/libevent/lib # depends on libcrypto
204 .if ${MKDTRACE} != "no"
205 SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
206 .endif
207 SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
208
209 .if (${MKLDAP} != "no")
210 SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
211 .endif
212
213 .if (${MKZFS} != "no")
214 SUBDIR+= ../external/cddl/osnet/lib/libzfs
215 .endif
216
217 SUBDIR+= ../libexec/httpd/libbozohttpd # depends on libssl & libcrypto
218
219 #==================== 3rd library dependency barrier ====================
220 SUBDIR+= .WAIT
221
222 SUBDIR+= ../crypto/external/bsd/netpgp/bindings/lua # depends on netpgp/lib
223 SUBDIR+= ../external/bsd/bind/lib # depends on heimdal, libcrypto
224 .if ${MKUNBOUND} != "no"
225 SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
226 .endif
227
228 .if ${MKDTRACE} != "no"
229 SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
230 .endif
231
232 .if (${MKRUMP} != "no")
233 SUBDIR+= librumpdev # depends on librump
234 SUBDIR+= librumpnet # depends on librump
235 SUBDIR+= librumpvfs # depends on librump
236 .endif
237
238 .if (${MKPAM} != "no")
239 SUBDIR+= libpam # depends on heimdal
240 .endif
241
242 SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
243 SUBDIR+= ../external/bsd/mdocml/lib
244
245 .if (${MKRUMP} != "no")
246 #==================== 4th library dependency barrier ====================
247 SUBDIR+= .WAIT
248
249 SUBDIR+= libukfs # depends on librumpvfs, librump
250
251 .if (${MKTPM} != "no")
252 SUBDIR+= ../crypto/external/cpl/trousers/lib
253 .endif
254
255 #==================== 5th library dependency barrier ====================
256 SUBDIR+= .WAIT
257
258 SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
259
260 .if (${MKTPM} != "no")
261 SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
262 .endif
263
264 .if !defined(BSD_MK_COMPAT_FILE)
265 SUBDIR+= ../sys/rump/dev/lib
266 SUBDIR+= ../sys/rump/fs/lib
267 SUBDIR+= ../sys/rump/kern/lib
268 SUBDIR+= ../sys/rump/net/lib
269 .endif
270 .endif
271
272 # Lua bindings come last, they might depend on anything
273 SUBDIR+= lua
274
275 # Needed by rump and rescue which are outside the smbfs tree
276 SUBDIR+= ../external/bsd/smbfs/lib
277
278 .for S in ${SUBDIR}
279 .if ${S} != ".WAIT"
280 SUBLIB_${S}!= cd ${S} && ${MAKE} -V LIB
281 SUBDEP_${S}!= cd ${S} && ${MAKE} -V LIBDPLIBS
282 .endif
283 .endfor
284
285 showdeps:
286 .for S in ${SUBDIR}
287 .if ${S} != ".WAIT"
288 .for DL DD in ${SUBDEP_${S}}
289 @echo ${S} ${SUBLIB_${S}} ${DL} ${DD:C,^${.CURDIR}/,,}
290 .endfor
291 .endif
292 .endfor
293
294 .include <bsd.buildinstall.mk>
295 .include <bsd.subdir.mk>
296