Makefile revision 1.251 1 # $NetBSD: Makefile,v 1.251 2017/05/21 15:28:41 riastradh 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)
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+= librumpuser # depends on libpthread
128 SUBDIR+= librumphijack # depends on librumpclient and libpthread
129 .endif
130
131 .if (${MKNPF} != "no")
132 SUBDIR+= libnpf # depends on libprop
133 .endif
134
135 SUBDIR+= ../crypto/external/bsd/openssl/lib # depends on libcrypt
136 SUBDIR+= ../external/bsd/file/lib # depends on libz
137
138 .if (${MKISCSI} != "no")
139 SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
140 .endif
141
142 .if (${MKZFS} != "no")
143 SUBDIR+= ../external/cddl/osnet/lib/libzfs
144 SUBDIR+= ../external/cddl/osnet/lib/libzpool
145 .endif
146
147 .if (${MKLVM} != "no")
148 SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
149 .endif
150
151 .if (${MKBINUTILS} != "no")
152 SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
153 .endif
154
155 .if (${MKLIBCXX} != "no")
156 SUBDIR+= ../external/bsd/libc++
157 .endif
158
159 .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
160 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
161 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
162 .endif
163
164 #==================== 2nd library dependency barrier ====================
165 SUBDIR+= .WAIT
166
167 .for sanitizer in asan ubsan
168 .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
169 SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
170 .endif
171 .endfor
172
173 SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
174
175 .if (${MKNPF} != "no")
176 SUBDIR+= npf # depends on libnpf
177 .endif
178
179 .if (${MKATF} != "no")
180 SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
181 .endif
182
183 .if (${MKKYUA} != "no")
184 SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
185 .endif
186
187 SUBDIR+= libform # depends on libcurses
188 SUBDIR+= libmenu # depends on libcurses
189 SUBDIR+= libpanel # depends on libcurses
190 SUBDIR+= libradius # depends on libcrypto
191 .if (${MKRUMP} != "no")
192 SUBDIR+= librump # depends on librumpuser
193 .endif
194
195 .if (${MKKERBEROS} != "no")
196 SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
197 # libedit, libterminfo,
198 .endif
199
200 SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
201 SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
202 SUBDIR+= ../external/bsd/libevent/lib # depends on libcrypto
203 .if ${MKDTRACE} != "no"
204 SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
205 .endif
206 SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
207
208 .if (${MKLDAP} != "no")
209 SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
210 .endif
211
212 #==================== 3rd library dependency barrier ====================
213 SUBDIR+= .WAIT
214
215 SUBDIR+= ../external/bsd/bind/lib # depends on heimdal, libcrypto
216 .if ${MKUNBOUND} != "no"
217 SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
218 .endif
219
220 .if ${MKDTRACE} != "no"
221 SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
222 .endif
223
224 .if (${MKRUMP} != "no")
225 SUBDIR+= librumpdev # depends on librump
226 SUBDIR+= librumpnet # depends on librump
227 SUBDIR+= librumpvfs # depends on librump
228 .endif
229
230 .if (${MKPAM} != "no")
231 SUBDIR+= libpam # depends on heimdal
232 .endif
233
234 SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
235 SUBDIR+= ../external/bsd/mdocml/lib
236
237 .if (${MKRUMP} != "no")
238 #==================== 4th library dependency barrier ====================
239 SUBDIR+= .WAIT
240
241 SUBDIR+= libukfs # depends on librumpvfs, librump
242
243 .if (${MKTPM} != "no")
244 SUBDIR+= ../crypto/external/cpl/trousers/lib
245 .endif
246
247 #==================== 5th library dependency barrier ====================
248 SUBDIR+= .WAIT
249
250 SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
251
252 .if (${MKTPM} != "no")
253 SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
254 .endif
255
256 .if !defined(BSD_MK_COMPAT_FILE)
257 SUBDIR+= ../sys/rump/dev/lib
258 SUBDIR+= ../sys/rump/fs/lib
259 SUBDIR+= ../sys/rump/kern/lib
260 SUBDIR+= ../sys/rump/net/lib
261 .endif
262 .endif
263
264 # Lua bindings come last, they might depend on anything
265 SUBDIR+= lua
266
267 # Needed by rump and rescue which are outside the smbfs tree
268 SUBDIR+= ../external/bsd/smbfs/lib
269
270 .for S in ${SUBDIR}
271 .if ${S} != ".WAIT"
272 SUBLIB_${S}!= cd ${S} && ${MAKE} -V LIB
273 SUBDEP_${S}!= cd ${S} && ${MAKE} -V LIBDPLIBS
274 .endif
275 .endfor
276
277 showdeps:
278 .for S in ${SUBDIR}
279 .if ${S} != ".WAIT"
280 .for DL DD in ${SUBDEP_${S}}
281 @echo ${S} ${SUBLIB_${S}} ${DL} ${DD:C,^${.CURDIR}/,,}
282 .endfor
283 .endif
284 .endfor
285
286 .include <bsd.buildinstall.mk>
287 .include <bsd.subdir.mk>
288