Makefile revision 1.269 1 1.269 christos # $NetBSD: Makefile,v 1.269 2019/03/12 15:14:02 christos Exp $
2 1.8 mycroft # from: @(#)Makefile 5.25.1.1 (Berkeley) 5/7/91
3 1.21 cgd
4 1.62 thorpej .include <bsd.own.mk>
5 1.62 thorpej
6 1.188 joerg SUBDIR= csu .WAIT
7 1.155 plunky
8 1.155 plunky .if (${MKGCC} != "no")
9 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
10 1.155 plunky .endif
11 1.155 plunky
12 1.155 plunky SUBDIR+= libc
13 1.155 plunky SUBDIR+= .WAIT
14 1.155 plunky
15 1.155 plunky #
16 1.155 plunky # The SUBDIRs above are included here for completeness but should be built
17 1.155 plunky # and installed prior to make(dependall) in this file, as libraries listed
18 1.155 plunky # below will depend on versions from DESTDIR only.
19 1.155 plunky #
20 1.155 plunky
21 1.158 plunky SUBDIR+= i18n_module
22 1.158 plunky
23 1.158 plunky SUBDIR+= libarch \
24 1.158 plunky libbluetooth libbsdmalloc libbz2 \
25 1.184 matt libcompat libcrypt \
26 1.265 martin libintl libipsec libkvm libm \
27 1.259 maxv libossaudio libpci libposix libprop libpthread \
28 1.249 kamil libpuffs libresolv librmt librpcsvc librt \
29 1.187 christos libtelnet libterminfo \
30 1.158 plunky libusbhid libutil libwrap liby libz
31 1.158 plunky
32 1.206 matt .if !defined(BSD_MK_COMPAT_FILE)
33 1.206 matt SUBDIR+= libkern
34 1.206 matt .endif
35 1.206 matt
36 1.226 matt .if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
37 1.201 matt LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
38 1.228 joerg LIBC_MACHINE_CPU?=${MACHINE_CPU}
39 1.228 joerg .if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
40 1.197 matt SUBDIR+= libc_vfp
41 1.197 matt .endif
42 1.201 matt .endif
43 1.248 macallan .if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
44 1.247 macallan SUBDIR+= libc_fp
45 1.247 macallan .endif
46 1.187 christos .if (${MKRUMP} != "no")
47 1.187 christos SUBDIR+= librumpclient
48 1.187 christos .endif
49 1.158 plunky .if (${MKSKEY} != "no")
50 1.158 plunky SUBDIR+= libskey
51 1.158 plunky .endif
52 1.60 thorpej
53 1.265 martin .if ${MACHINE_ARCH} == "x86_64" && ${MLIBDIR:Unone} != "i386"
54 1.265 martin SUBDIR+= libnvmm
55 1.265 martin .endif
56 1.265 martin
57 1.266 mrg SUBDIR+= ../external/public-domain/sqlite/lib
58 1.266 mrg
59 1.155 plunky .if (${MKMDNS} != "no")
60 1.155 plunky SUBDIR+= ../external/apache2/mDNSResponder/lib
61 1.155 plunky .endif
62 1.155 plunky
63 1.155 plunky SUBDIR+= ../external/bsd/am-utils/lib
64 1.155 plunky
65 1.155 plunky SUBDIR+= ../external/bsd/flex/lib
66 1.180 christos SUBDIR+= ../external/bsd/tre/lib
67 1.212 christos SUBDIR+= ../external/bsd/elftoolchain/lib/libelf
68 1.163 matt SUBDIR+= ../external/bsd/liblzf/lib
69 1.158 plunky SUBDIR+= ../external/bsd/libpcap/lib
70 1.155 plunky
71 1.214 plunky .if ${MKSLJIT} != "no"
72 1.214 plunky SUBDIR+= ../external/bsd/sljit/lib
73 1.214 plunky SUBDIR+= libbpfjit
74 1.214 plunky .endif
75 1.214 plunky
76 1.261 christos SUBDIR+= ../external/bsd/libnv/lib
77 1.261 christos
78 1.224 matt .if (${MKZFS} != "no")
79 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libavl
80 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libnvpair
81 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libumem
82 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libuutil
83 1.224 matt .endif
84 1.224 matt
85 1.182 tron SUBDIR+= ../external/mit/expat/lib
86 1.155 plunky
87 1.238 christos SUBDIR+= ../external/gpl2/libmalloc
88 1.155 plunky
89 1.269 christos SUBDIR+= ../external/bsd/jemalloc/lib
90 1.269 christos
91 1.155 plunky .if (${MKGCC} != "no")
92 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
93 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
94 1.173 mrg # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
95 1.173 mrg # specific build area, but we get better parallelism this way.
96 1.215 mrg # We don't build compat versions of these.
97 1.252 mrg . if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
98 1.172 matt SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
99 1.174 plunky SUBDIR+= ../external/lgpl3/mpfr/lib/libmpfr
100 1.209 mrg SUBDIR+= ../external/lgpl3/mpc/lib/libmpc
101 1.174 plunky . endif
102 1.155 plunky .endif
103 1.144 christos
104 1.89 lukem #
105 1.89 lukem # Libraries that depend upon any listed previously
106 1.93 lukem # (and those that depend upon these [and ...])
107 1.89 lukem #
108 1.97 christos #==================== 1st library dependency barrier ====================
109 1.97 christos SUBDIR+= .WAIT
110 1.97 christos
111 1.235 christos .if ${MKDTRACE} != "no"
112 1.229 christos SUBDIR+= ../external/bsd/librtld_db/lib # depends on libutil
113 1.234 christos .endif
114 1.229 christos
115 1.240 riastrad .if ${MKCTF} != "no"
116 1.227 christos SUBDIR+= ../external/cddl/osnet/lib/libctf
117 1.227 christos .endif
118 1.227 christos
119 1.221 mrg SUBDIR+= ../external/public-domain/xz/lib # depends on libpthread
120 1.208 mrg SUBDIR+= ../crypto/external/bsd/netpgp/libmj
121 1.208 mrg SUBDIR+= ../crypto/external/bsd/netpgp/lib/verify # depends on libz
122 1.237 christos SUBDIR+= ../external/bsd/blacklist/lib # depends on libpthread
123 1.212 christos SUBDIR+= ../external/bsd/elftoolchain/lib/libdwarf # depends on libelf
124 1.208 mrg SUBDIR+= ../external/mit/lua/lib # depends on libm
125 1.158 plunky SUBDIR+= libcurses # depends on libterminfo
126 1.162 haad SUBDIR+= libdm # depends on libprop
127 1.158 plunky SUBDIR+= libedit # depends on libterminfo
128 1.184 matt SUBDIR+= libexecinfo # depends on libelf
129 1.176 dyoung SUBDIR+= libppath # depends on libprop
130 1.175 plunky SUBDIR+= libperfuse # depends on libpuffs
131 1.165 bouyer SUBDIR+= libquota # depends on libprop and librpcsvc
132 1.113 pooka SUBDIR+= librefuse # depends on libpuffs
133 1.207 joerg SUBDIR+= libisns # depends on libpthread
134 1.187 christos .if (${MKRUMP} != "no")
135 1.253 christos SUBDIR+= librumphijack # depends on librumpclient and libpthread
136 1.253 christos SUBDIR+= librumpres # depends on librumpclient
137 1.126 pooka SUBDIR+= librumpuser # depends on libpthread
138 1.187 christos .endif
139 1.126 pooka
140 1.161 rmind .if (${MKNPF} != "no")
141 1.261 christos SUBDIR+= libnpf # depends on libnv
142 1.161 rmind .endif
143 1.161 rmind
144 1.254 christos SUBDIR+= ../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib # depends on libcrypt
145 1.155 plunky SUBDIR+= ../external/bsd/file/lib # depends on libz
146 1.155 plunky
147 1.155 plunky .if (${MKISCSI} != "no")
148 1.155 plunky SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
149 1.155 plunky .endif
150 1.155 plunky
151 1.224 matt .if (${MKZFS} != "no")
152 1.257 chs SUBDIR+= ../external/cddl/osnet/lib/libzfs_core
153 1.224 matt SUBDIR+= ../external/cddl/osnet/lib/libzpool
154 1.224 matt .endif
155 1.224 matt
156 1.163 matt .if (${MKLVM} != "no")
157 1.163 matt SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
158 1.163 matt .endif
159 1.163 matt
160 1.155 plunky .if (${MKBINUTILS} != "no")
161 1.239 christos SUBDIR+= ../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib # libbfd depends on libz
162 1.155 plunky .endif
163 1.155 plunky
164 1.202 joerg .if (${MKLIBCXX} != "no")
165 1.202 joerg SUBDIR+= ../external/bsd/libc++
166 1.202 joerg .endif
167 1.202 joerg
168 1.203 joerg .if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
169 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
170 1.211 mrg SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
171 1.155 plunky .endif
172 1.222 christos
173 1.222 christos #==================== 2nd library dependency barrier ====================
174 1.222 christos SUBDIR+= .WAIT
175 1.222 christos
176 1.258 christos .for sanitizer in asan lsan ubsan
177 1.245 christos .if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
178 1.245 christos SUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
179 1.245 christos .endif
180 1.245 christos .endfor
181 1.155 plunky
182 1.221 mrg SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
183 1.221 mrg
184 1.208 mrg .if (${MKNPF} != "no")
185 1.208 mrg SUBDIR+= npf # depends on libnpf
186 1.208 mrg .endif
187 1.208 mrg
188 1.185 christos .if (${MKATF} != "no")
189 1.186 christos SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
190 1.185 christos .endif
191 1.185 christos
192 1.198 jmmv .if (${MKKYUA} != "no")
193 1.198 jmmv SUBDIR+= ../external/bsd/lutok/lib # depends on lua and libstdc++
194 1.198 jmmv .endif
195 1.198 jmmv
196 1.158 plunky SUBDIR+= libform # depends on libcurses
197 1.175 plunky SUBDIR+= libmenu # depends on libcurses
198 1.236 kamil SUBDIR+= libpanel # depends on libcurses
199 1.251 riastrad SUBDIR+= libradius # depends on libcrypto
200 1.187 christos .if (${MKRUMP} != "no")
201 1.175 plunky SUBDIR+= librump # depends on librumpuser
202 1.187 christos .endif
203 1.158 plunky
204 1.100 christos .if (${MKKERBEROS} != "no")
205 1.166 elric SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
206 1.166 elric # libedit, libterminfo,
207 1.100 christos .endif
208 1.100 christos
209 1.158 plunky SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
210 1.158 plunky SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
211 1.199 christos SUBDIR+= ../external/bsd/libevent/lib # depends on libcrypto
212 1.235 christos .if ${MKDTRACE} != "no"
213 1.234 christos SUBDIR+= ../external/bsd/libproc/lib # depends on libstdc++, libctf
214 1.234 christos .endif
215 1.158 plunky SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
216 1.158 plunky
217 1.158 plunky .if (${MKLDAP} != "no")
218 1.158 plunky SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
219 1.158 plunky .endif
220 1.158 plunky
221 1.257 chs .if (${MKZFS} != "no")
222 1.257 chs SUBDIR+= ../external/cddl/osnet/lib/libzfs
223 1.257 chs .endif
224 1.257 chs
225 1.256 sevan SUBDIR+= ../libexec/httpd/libbozohttpd # depends on libssl & libcrypto
226 1.256 sevan
227 1.124 lukem #==================== 3rd library dependency barrier ====================
228 1.124 lukem SUBDIR+= .WAIT
229 1.124 lukem
230 1.255 christos SUBDIR+= ../crypto/external/bsd/netpgp/bindings/lua # depends on netpgp/lib
231 1.260 christos SUBDIR+= ../external/mpl/bind/lib # depends on heimdal, libcrypto
232 1.251 riastrad .if ${MKUNBOUND} != "no"
233 1.246 christos SUBDIR+= ../external/bsd/unbound/lib # depends on libcrypto
234 1.246 christos .endif
235 1.204 joerg
236 1.230 christos .if ${MKDTRACE} != "no"
237 1.230 christos SUBDIR+= ../external/cddl/osnet/lib/libdtrace # depends on libproc
238 1.230 christos .endif
239 1.230 christos
240 1.187 christos .if (${MKRUMP} != "no")
241 1.143 pooka SUBDIR+= librumpdev # depends on librump
242 1.128 pooka SUBDIR+= librumpnet # depends on librump
243 1.130 pooka SUBDIR+= librumpvfs # depends on librump
244 1.187 christos .endif
245 1.126 pooka
246 1.175 plunky .if (${MKPAM} != "no")
247 1.175 plunky SUBDIR+= libpam # depends on heimdal
248 1.175 plunky .endif
249 1.175 plunky
250 1.175 plunky SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
251 1.181 joerg SUBDIR+= ../external/bsd/mdocml/lib
252 1.181 joerg
253 1.187 christos .if (${MKRUMP} != "no")
254 1.126 pooka #==================== 4th library dependency barrier ====================
255 1.126 pooka SUBDIR+= .WAIT
256 1.158 plunky
257 1.158 plunky SUBDIR+= libukfs # depends on librumpvfs, librump
258 1.131 pooka
259 1.190 christos .if (${MKTPM} != "no")
260 1.190 christos SUBDIR+= ../crypto/external/cpl/trousers/lib
261 1.190 christos .endif
262 1.190 christos
263 1.131 pooka #==================== 5th library dependency barrier ====================
264 1.131 pooka SUBDIR+= .WAIT
265 1.158 plunky
266 1.158 plunky SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
267 1.188 joerg
268 1.192 christos .if (${MKTPM} != "no")
269 1.192 christos SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers
270 1.192 christos .endif
271 1.192 christos
272 1.188 joerg .if !defined(BSD_MK_COMPAT_FILE)
273 1.188 joerg SUBDIR+= ../sys/rump/dev/lib
274 1.188 joerg SUBDIR+= ../sys/rump/fs/lib
275 1.188 joerg SUBDIR+= ../sys/rump/kern/lib
276 1.188 joerg SUBDIR+= ../sys/rump/net/lib
277 1.188 joerg .endif
278 1.187 christos .endif
279 1.158 plunky
280 1.178 mbalmer # Lua bindings come last, they might depend on anything
281 1.178 mbalmer SUBDIR+= lua
282 1.178 mbalmer
283 1.210 christos # Needed by rump and rescue which are outside the smbfs tree
284 1.210 christos SUBDIR+= ../external/bsd/smbfs/lib
285 1.210 christos
286 1.251 riastrad .for S in ${SUBDIR}
287 1.251 riastrad .if ${S} != ".WAIT"
288 1.251 riastrad SUBLIB_${S}!= cd ${S} && ${MAKE} -V LIB
289 1.251 riastrad SUBDEP_${S}!= cd ${S} && ${MAKE} -V LIBDPLIBS
290 1.251 riastrad .endif
291 1.251 riastrad .endfor
292 1.251 riastrad
293 1.251 riastrad showdeps:
294 1.251 riastrad .for S in ${SUBDIR}
295 1.251 riastrad .if ${S} != ".WAIT"
296 1.251 riastrad .for DL DD in ${SUBDEP_${S}}
297 1.251 riastrad @echo ${S} ${SUBLIB_${S}} ${DL} ${DD:C,^${.CURDIR}/,,}
298 1.251 riastrad .endfor
299 1.251 riastrad .endif
300 1.251 riastrad .endfor
301 1.251 riastrad
302 1.195 joerg .include <bsd.buildinstall.mk>
303 1.1 cgd .include <bsd.subdir.mk>
304