Makefile revision 1.188 1 # $NetBSD: Makefile,v 1.188 2012/08/17 16:22:27 joerg 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 . if ${HAVE_GCC} == 4
10 . if (${USE_COMPILERCRTSTUFF} == "yes")
11 SUBDIR+= ../gnu/lib/crtstuff4 .WAIT
12 . endif
13 SUBDIR+= ../gnu/lib/libgcc4 .WAIT
14 . else
15 . if (${USE_COMPILERCRTSTUFF} == "yes")
16 SUBDIR+= ../external/gpl3/gcc/lib/crtstuff .WAIT
17 . endif
18 SUBDIR+= ../external/gpl3/gcc/lib/libgcc .WAIT
19 . endif
20 .endif
21
22 SUBDIR+= libc
23 SUBDIR+= .WAIT
24
25 #
26 # The SUBDIRs above are included here for completeness but should be built
27 # and installed prior to make(dependall) in this file, as libraries listed
28 # below will depend on versions from DESTDIR only.
29 #
30
31 SUBDIR+= i18n_module
32
33 SUBDIR+= libarch \
34 libbluetooth libbsdmalloc libbz2 \
35 libcompat libcrypt \
36 libintl libipsec libisns libkvm libm \
37 libossaudio libpci libpmc libposix libprop libpthread \
38 libpthread_dbg libpuffs libresolv librmt librpcsvc librt \
39 libtelnet libterminfo \
40 libusbhid libutil libwrap liby libz
41
42 .if (${MKRUMP} != "no")
43 SUBDIR+= librumpclient
44 .endif
45 .if (${MKSKEY} != "no")
46 SUBDIR+= libskey
47 .endif
48
49 .if (${MKCRYPTO} != "no")
50 SUBDIR+= ../crypto/external/bsd/netpgp/libmj
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/libdwarf/lib
62 SUBDIR+= ../external/bsd/libelf/lib
63 SUBDIR+= ../external/bsd/libevent/lib
64 SUBDIR+= ../external/bsd/liblzf/lib
65 SUBDIR+= ../external/bsd/libpcap/lib
66
67 SUBDIR+= ../external/mit/lua/lib
68 SUBDIR+= ../external/mit/expat/lib
69
70 SUBDIR+= ../external/public-domain/sqlite/lib
71 SUBDIR+= ../external/public-domain/xz/lib
72
73 SUBDIR+= ../gnu/lib/libmalloc
74
75 .if (${MKGCC} != "no")
76 . if ${HAVE_GCC} == 4
77 SUBDIR+= ../gnu/lib/libobjc4
78 . else
79 SUBDIR+= ../external/gpl3/gcc/lib/libobjc
80 SUBDIR+= ../external/gpl3/gcc/lib/libgomp
81 . endif
82 . if ${HAVE_GCC} >= 45 && !defined(MLIBDIR)
83 # Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
84 # specific build area, but we get better parallelism this way.
85 SUBDIR+= ../external/lgpl3/gmp/lib/libgmp
86 SUBDIR+= ../external/lgpl3/mpfr/lib/libmpfr
87 SUBDIR+= ../external/lgpl2/mpc/lib/libmpc
88 . endif
89 .endif
90
91 #
92 # Libraries that depend upon any listed previously
93 # (and those that depend upon these [and ...])
94 #
95 #==================== 1st library dependency barrier ====================
96 SUBDIR+= .WAIT
97
98 SUBDIR+= libcurses # depends on libterminfo
99 SUBDIR+= libdm # depends on libprop
100 SUBDIR+= libedit # depends on libterminfo
101 SUBDIR+= libexecinfo # depends on libelf
102 SUBDIR+= libppath # depends on libprop
103 SUBDIR+= libperfuse # depends on libpuffs
104 SUBDIR+= libquota # depends on libprop and librpcsvc
105 SUBDIR+= librefuse # depends on libpuffs
106 .if (${MKRUMP} != "no")
107 SUBDIR+= librumpuser # depends on libpthread
108 SUBDIR+= librumphijack # depends on librumpclient and libpthread
109 .endif
110
111 .if (${MKNPF} != "no")
112 SUBDIR+= libnpf # depends on libprop
113 .endif
114
115 .if (${MKCRYPTO} != "no")
116 SUBDIR+= ../crypto/external/bsd/openssl/lib # depends on libcrypt
117 .endif
118
119 SUBDIR+= ../external/bsd/file/lib # depends on libz
120
121 .if (${MKISCSI} != "no")
122 SUBDIR+= ../external/bsd/iscsi/lib # depends on libpthread
123 .endif
124
125 SUBDIR+= ../external/bsd/libarchive/lib # depends on libxz
126
127 .if (${MKLVM} != "no")
128 SUBDIR+= ../external/gpl2/lvm2/lib # depends on libprop
129 .endif
130
131 .if (${MKBINUTILS} != "no")
132 SUBDIR+= ../external/gpl3/binutils/lib # libbfd depends on libz
133 .endif
134
135 .if (${MKGCC} != "no" && ${MKCXX} != "no")
136 . if ${HAVE_GCC} == 4
137 SUBDIR+= ../gnu/lib/libstdc++-v3_4 # depends on libm
138 SUBDIR+= ../gnu/lib/libsupc++4
139 . else
140 SUBDIR+= ../external/gpl3/gcc/lib/libstdc++-v3
141 SUBDIR+= ../external/gpl3/gcc/lib/libsupc++
142 . endif
143 .endif
144
145 #==================== 2nd library dependency barrier ====================
146 SUBDIR+= .WAIT
147
148 .if (${MKATF} != "no")
149 SUBDIR+= ../external/bsd/atf/lib # depends on libstdc++
150 .endif
151
152 SUBDIR+= libform # depends on libcurses
153 SUBDIR+= libmenu # depends on libcurses
154 SUBDIR+= libradius # depends on libcrypto if (${MKCRYPTO} != "no")
155 .if (${MKRUMP} != "no")
156 SUBDIR+= librump # depends on librumpuser
157 .endif
158
159 .if (${MKKERBEROS} != "no")
160 SUBDIR+= ../crypto/external/bsd/heimdal/lib # depends on libcrypto
161 # libedit, libterminfo,
162 .endif
163
164 .if (${MKCRYPTO} != "no")
165 SUBDIR+= ../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
166 SUBDIR+= ../crypto/external/bsd/netpgp/lib # depends on libcrypto, ...
167 .endif
168
169 SUBDIR+= ../external/bsd/bind/lib # depends on libcrypto
170 SUBDIR+= ../external/bsd/fetch/lib # depends on libssl
171
172 .if (${MKLDAP} != "no")
173 SUBDIR+= ../external/bsd/openldap/lib # depends on libcrypto, ...
174 .endif
175
176 #==================== 3rd library dependency barrier ====================
177 SUBDIR+= .WAIT
178
179 .if (${MKRUMP} != "no")
180 SUBDIR+= librumpdev # depends on librump
181 SUBDIR+= librumpnet # depends on librump
182 SUBDIR+= librumpvfs # depends on librump
183 .endif
184
185 .if (${MKPAM} != "no")
186 SUBDIR+= libpam # depends on heimdal
187 .endif
188
189 .if (${MKCRYPTO} != "no")
190 SUBDIR+= ../crypto/external/bsd/libsaslc # depends on heimdal, openssl
191 .endif
192
193 SUBDIR+= ../external/bsd/mdocml/lib
194
195 .if (${MKRUMP} != "no")
196 #==================== 4th library dependency barrier ====================
197 SUBDIR+= .WAIT
198
199 SUBDIR+= libukfs # depends on librumpvfs, librump
200
201 #==================== 5th library dependency barrier ====================
202 SUBDIR+= .WAIT
203
204 SUBDIR+= libp2k # depends on libukfs, librumpvfs, libpuffs
205
206 .if !defined(BSD_MK_COMPAT_FILE)
207 SUBDIR+= ../sys/rump/dev/lib
208 SUBDIR+= ../sys/rump/fs/lib
209 SUBDIR+= ../sys/rump/kern/lib
210 SUBDIR+= ../sys/rump/net/lib
211 .endif
212 .endif
213
214 # Lua bindings come last, they might depend on anything
215 SUBDIR+= lua
216
217 #
218 # build_install logic for src/Makefile.
219 # Compute a list of subdirectories delimited by .WAIT.
220 # Run "make dependall && make install" for all subdirectories in a group
221 # concurrently, but wait after each group.
222 #
223 SUBDIR_GROUPS= 1
224 CUR_GROUP:= 1
225 .for dir in ${SUBDIR}
226 . if ${dir} == ".WAIT"
227 CUR_GROUP:= ${CUR_GROUP}1
228 SUBDIR_GROUPS:= ${SUBDIR_GROUPS} ${CUR_GROUP}
229 . else
230 SUBDIR_GROUP.${CUR_GROUP}+= ${dir}
231 .endif
232
233 .endfor
234
235 build_install:
236 .for group in ${SUBDIR_GROUPS}
237 . if !empty(SUBDIR_GROUP.${group})
238 ${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
239 ${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
240 . endif
241 .endfor
242
243 .include <bsd.subdir.mk>
244