xref: /netbsd/lib/Makefile (revision 00238ff2)
1#	$NetBSD: Makefile,v 1.190 2012/11/04 16:28:11 christos Exp $
2#	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
3
4.include <bsd.own.mk>
5
6SUBDIR=		csu .WAIT
7
8.if (${MKGCC} != "no")
9. if ${HAVE_GCC} == 4
10.  if (${USE_COMPILERCRTSTUFF} == "yes")
11SUBDIR+=	../gnu/lib/crtstuff4 .WAIT
12.  endif
13SUBDIR+=	../gnu/lib/libgcc4 .WAIT
14. else
15.  if (${USE_COMPILERCRTSTUFF} == "yes")
16SUBDIR+=	../external/gpl3/gcc/lib/crtstuff .WAIT
17.  endif
18SUBDIR+=	../external/gpl3/gcc/lib/libgcc .WAIT
19. endif
20.endif
21
22SUBDIR+=	libc
23SUBDIR+=	.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
31SUBDIR+=	i18n_module
32
33SUBDIR+=	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")
43SUBDIR+=	librumpclient
44.endif
45.if (${MKSKEY} != "no")
46SUBDIR+=	libskey
47.endif
48
49.if (${MKCRYPTO} != "no")
50SUBDIR+=	../crypto/external/bsd/netpgp/libmj
51.endif
52
53.if (${MKMDNS} != "no")
54SUBDIR+=	../external/apache2/mDNSResponder/lib
55.endif
56
57SUBDIR+=	../external/bsd/am-utils/lib
58
59SUBDIR+=	../external/bsd/flex/lib
60SUBDIR+=	../external/bsd/tre/lib
61SUBDIR+=	../external/bsd/libdwarf/lib
62SUBDIR+=	../external/bsd/libelf/lib
63SUBDIR+=	../external/bsd/libevent/lib
64SUBDIR+=	../external/bsd/liblzf/lib
65SUBDIR+=	../external/bsd/libpcap/lib
66
67SUBDIR+=	../external/mit/lua/lib
68SUBDIR+=	../external/mit/expat/lib
69
70SUBDIR+=	../external/public-domain/sqlite/lib
71SUBDIR+=	../external/public-domain/xz/lib
72
73SUBDIR+=	../gnu/lib/libmalloc
74
75.if (${MKGCC} != "no")
76. if ${HAVE_GCC} == 4
77SUBDIR+=	../gnu/lib/libobjc4
78. else
79SUBDIR+=	../external/gpl3/gcc/lib/libobjc
80SUBDIR+=	../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.
85SUBDIR+=	../external/lgpl3/gmp/lib/libgmp
86SUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
87SUBDIR+=	../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 ====================
96SUBDIR+=	.WAIT
97
98SUBDIR+=	libcurses	# depends on libterminfo
99SUBDIR+=	libdm		# depends on libprop
100SUBDIR+=	libedit		# depends on libterminfo
101SUBDIR+=	libexecinfo 	# depends on libelf
102SUBDIR+=	libppath	# depends on libprop
103SUBDIR+=	libperfuse	# depends on libpuffs
104SUBDIR+=	libquota	# depends on libprop and librpcsvc
105SUBDIR+=	librefuse	# depends on libpuffs
106.if (${MKRUMP} != "no")
107SUBDIR+=	librumpuser	# depends on libpthread
108SUBDIR+=	librumphijack	# depends on librumpclient and libpthread
109.endif
110
111.if (${MKNPF} != "no")
112SUBDIR+=	libnpf		# depends on libprop
113SUBDIR+=	npf
114.endif
115
116.if (${MKCRYPTO} != "no")
117SUBDIR+=	../crypto/external/bsd/openssl/lib # depends on libcrypt
118.endif
119
120SUBDIR+=	../external/bsd/file/lib	# depends on libz
121
122.if (${MKISCSI} != "no")
123SUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
124.endif
125
126SUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
127
128.if (${MKLVM} != "no")
129SUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
130.endif
131
132.if (${MKBINUTILS} != "no")
133SUBDIR+=	../external/gpl3/binutils/lib	# libbfd depends on libz
134.endif
135
136.if (${MKGCC} != "no" && ${MKCXX} != "no")
137. if ${HAVE_GCC} == 4
138SUBDIR+=	../gnu/lib/libstdc++-v3_4	# depends on libm
139SUBDIR+=	../gnu/lib/libsupc++4
140. else
141SUBDIR+=	../external/gpl3/gcc/lib/libstdc++-v3
142SUBDIR+=	../external/gpl3/gcc/lib/libsupc++
143. endif
144.endif
145
146#==================== 2nd library dependency barrier ====================
147SUBDIR+=	.WAIT
148
149.if (${MKATF} != "no")
150SUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
151.endif
152
153SUBDIR+=	libform		# depends on libcurses
154SUBDIR+=	libmenu		# depends on libcurses
155SUBDIR+=	libradius	# depends on libcrypto if (${MKCRYPTO} != "no")
156.if (${MKRUMP} != "no")
157SUBDIR+=	librump		# depends on librumpuser
158.endif
159
160.if (${MKKERBEROS} != "no")
161SUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
162							# libedit, libterminfo,
163.endif
164
165.if (${MKCRYPTO} != "no")
166SUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
167SUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
168.endif
169
170SUBDIR+=	../external/bsd/bind/lib	# depends on libcrypto
171SUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
172
173.if (${MKLDAP} != "no")
174SUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
175.endif
176
177#==================== 3rd library dependency barrier ====================
178SUBDIR+=	.WAIT
179
180.if (${MKRUMP} != "no")
181SUBDIR+=	librumpdev	# depends on librump
182SUBDIR+=	librumpnet	# depends on librump
183SUBDIR+=	librumpvfs	# depends on librump
184.endif
185
186.if (${MKPAM} != "no")
187SUBDIR+=	libpam		# depends on heimdal
188.endif
189
190.if (${MKCRYPTO} != "no")
191SUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
192.endif
193
194SUBDIR+=	../external/bsd/mdocml/lib
195
196.if (${MKRUMP} != "no")
197#==================== 4th library dependency barrier ====================
198SUBDIR+=	.WAIT
199
200SUBDIR+=	libukfs		# depends on librumpvfs, librump
201
202.if (${MKTPM} != "no")
203SUBDIR+=	../crypto/external/cpl/trousers/lib
204SUBDIR+=	../crypto/external/cpl/tpm_tools/lib
205.endif
206
207#==================== 5th library dependency barrier ====================
208SUBDIR+=	.WAIT
209
210SUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
211
212.if !defined(BSD_MK_COMPAT_FILE)
213SUBDIR+=	../sys/rump/dev/lib
214SUBDIR+=	../sys/rump/fs/lib
215SUBDIR+=	../sys/rump/kern/lib
216SUBDIR+=	../sys/rump/net/lib
217.endif
218.endif
219
220# Lua bindings come last, they might depend on anything
221SUBDIR+=	lua
222
223#
224# build_install logic for src/Makefile.
225# Compute a list of subdirectories delimited by .WAIT.
226# Run "make dependall && make install" for all subdirectories in a group
227# concurrently, but wait after each group.
228#
229SUBDIR_GROUPS=	1
230CUR_GROUP:=	1
231.for dir in ${SUBDIR}
232.  if ${dir} == ".WAIT"
233CUR_GROUP:=	${CUR_GROUP}1
234SUBDIR_GROUPS:=	${SUBDIR_GROUPS} ${CUR_GROUP}
235.  else
236SUBDIR_GROUP.${CUR_GROUP}+=	${dir}
237.endif
238
239.endfor
240
241build_install:
242.for group in ${SUBDIR_GROUPS}
243.  if !empty(SUBDIR_GROUP.${group})
244	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
245	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
246.  endif
247.endfor
248
249.include <bsd.subdir.mk>
250