xref: /titanic_50/usr/src/lib/Makefile (revision 10db1377dafab8ba3feedef26db9c5d8539a5cd1)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26
27include ../Makefile.master
28
29#	Note that libcurses installs commands along with its library.
30#	This is a minor bug which probably should be fixed.
31#	Note also that a few extra libraries are kept in cmd source.
32#
33# Certain libraries are linked with, hence depend on, other libraries.
34#
35# Although we have historically used .WAIT to express dependencies, it
36# reduces the amount of parallelism and thus lengthens the time it
37# takes to build the libraries.  Thus, we now require that any new
38# libraries explicitly call out their dependencies.  Eventually, all
39# the library dependencies will be called out explicitly.  See
40# "Library interdependencies" near the end of this file.
41#
42# Aside from explicit dependencies (and legacy .WAITs), all libraries
43# are built in parallel.
44#
45.PARALLEL:
46
47#
48# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
49# but required due to the "dependencies" of using .WAIT to barrier the
50# parallel dmake builds.  once 4631488 has been fixed, they can be
51# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
52# shown in HDRSUBDIRS
53#
54SUBDIRS= \
55	common			.WAIT	\
56	abi/apptrace		.WAIT	\
57	../cmd/abi/spectrans	.WAIT	\
58	../cmd/sgs/libconv		\
59	../cmd/sgs/libdl	.WAIT
60
61$(CLOSED_BUILD)SUBDIRS += \
62	$(CLOSED)/lib/libc_i18n
63
64SUBDIRS += \
65	libc			.WAIT	\
66	libmapmalloc		.WAIT	\
67	../cmd/sgs/libelf	.WAIT	\
68	libmd				\
69	libmd5				\
70	librsm				\
71	libmp			.WAIT	\
72	libcmd			\
73	libnsl			\
74	libsecdb		.WAIT	\
75	librpcsvc			\
76	libsocket		.WAIT	\
77	libsctp			\
78	libresolv			\
79	libresolv2		.WAIT	\
80	libw			.WAIT	\
81	libintl			.WAIT	\
82	../cmd/sgs/librtld_db	\
83	libaio			\
84	librt			\
85	libadm			\
86	libctf			\
87	libdtrace		\
88	libdtrace_jni		\
89	libcurses		\
90	libgen			\
91	libgss			\
92	libpam			\
93	libuuid			\
94	libthread		\
95	libpthread	.WAIT	\
96	libslp		\
97	libbsdmalloc	\
98	libdoor		\
99	libdevinfo	\
100	libdladm	\
101	libdlpi		\
102	libeti		\
103	libcrypt	\
104	libefi		\
105	libwanboot	\
106	libwanbootutil	\
107	libcryptoutil	\
108	libinetcfg	\
109	libinetutil	\
110	libipmp		\
111	libkstat	\
112	libkvm		\
113        liblaadm        \
114	liblm		\
115	libmacadm	\
116	libmalloc	\
117	libmtmalloc	\
118	libnls		\
119	libsmbios	\
120	libtecla	\
121	libumem		\
122	libnvpair	.WAIT	\
123	libexacct	\
124	libplot		\
125	libldap4	\
126	libsasl		\
127	libldap5	\
128	libsldap	.WAIT	\
129	libbsm		\
130	libsys		\
131	libsysevent	\
132	libnisdb	\
133	libpool		\
134	libproc		\
135	libproject	\
136	libsendfile	\
137	nametoaddr	\
138	ncad_addr	\
139	gss_mechs/mech_krb5	.WAIT	\
140	libkrb5	.WAIT	\
141	krb5	.WAIT
142$(CLOSED_BUILD)SUBDIRS += \
143	$(CLOSED)/lib/smartcard
144SUBDIRS += \
145	passwdutil	\
146	pam_modules	\
147	crypt_modules	\
148	libadt_jni	\
149	auditd_plugins	\
150	libvolmgt	\
151	libdevice	\
152	libdevid	\
153	libdhcpsvc	\
154	libc_db		\
155	libsec		\
156	libtnfprobe	\
157	libtnf		\
158	libtnfctl	\
159	libdhcpagent	\
160	libdhcpdu	\
161	libdhcputil	\
162	libipsecutil
163$(CLOSED_BUILD)SUBDIRS += \
164	$(CLOSED)/lib/libike
165SUBDIRS += \
166	nsswitch	\
167	print		\
168	libuutil	\
169	libscf		\
170	libinetsvc	\
171	librestart	\
172	libsched
173$(CLOSED_BUILD)SUBDIRS += \
174	$(CLOSED)/lib/libelfsign
175SUBDIRS += \
176	pkcs11		.WAIT	\
177	libpctx		.WAIT	\
178	libcpc		\
179	watchmalloc	\
180	madv		\
181	mpss		\
182	libdisasm	\
183	libwrap		\
184	libxcurses	\
185	libxcurses2	\
186	libxnet		\
187	libzonecfg	\
188	libzoneinfo	\
189	libtsnet	\
190	libtsol		\
191	gss_mechs/mech_spnego	\
192	gss_mechs/mech_dummy	\
193	gss_mechs/mech_dh	\
194	rpcsec_gss	\
195	librcm		.WAIT	\
196	libcfgadm	.WAIT	\
197	libpicl		.WAIT	\
198	libpicltree	.WAIT \
199	cfgadm_plugins	\
200	libmail		\
201	lvm		\
202	libsmedia	\
203	libipp		\
204	openssl		\
205	libdiskmgt	\
206	liblgrp		\
207	libfsmgt	\
208	fm		\
209	libavl		\
210	libcmdutils	\
211	libcontract	\
212	../cmd/sendmail/libmilter	\
213	sasl_plugins	\
214	udapl		\
215	libzpool	\
216	libzfs		\
217	libzfs_jni	\
218	libmapid	\
219	$($(MACH)_SUBDIRS)
220
221sparc_SUBDIRS= .WAIT	\
222	efcode		\
223	libc_psr	.WAIT	\
224	libprtdiag	.WAIT	\
225	libprtdiag_psr	\
226	librsc		\
227	libfruutils	.WAIT	\
228	libfru		\
229	libwrsmconf	\
230	storage		\
231	wrsm		\
232	libpcp
233
234fm: libexacct
235
236#
237# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
238# clean and clobber targets (for more information, see those targets, below).
239#
240NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
241
242DCSUBDIRS =		\
243	lvm
244
245MSGSUBDIRS=		\
246	abi		\
247	auditd_plugins	\
248	cfgadm_plugins	\
249	gss_mechs/mech_dh	\
250	gss_mechs/mech_krb5	\
251	krb5		\
252	libbsm		\
253	libc		\
254	libcfgadm	\
255	libcontract	\
256	libcurses	\
257	libdhcpsvc 	\
258	libdhcputil	\
259	libgss		\
260	libinetcfg	\
261	libipmp		\
262	libnsl		\
263	libpam		\
264	libpicl		\
265	libpool		\
266	libscf		\
267	libsasl		\
268	libldap5	\
269	libsecdb	\
270	libsldap	\
271	libslp		\
272	libsmedia	\
273	libtsol		\
274	libuutil	\
275	libwanboot	\
276	libwanbootutil	\
277	libzonecfg	\
278	lvm		\
279	madv		\
280	mpss		\
281	pam_modules	\
282	rpcsec_gss
283$(CLOSED_BUILD)MSGSUBDIRS += \
284	$(CLOSED)/lib/smartcard
285MSGSUBDIRS += \
286	$($(MACH)_MSGSUBDIRS)
287
288sparc_MSGSUBDIRS=	\
289	libprtdiag	\
290	libprtdiag_psr
291
292HDRSUBDIRS= libaio	\
293	auditd_plugins	\
294	libbsm		\
295	libc		\
296	libcmdutils	\
297	libcontract	\
298	libcpc		\
299	libctf		\
300	libcurses	\
301	libcryptoutil	\
302	libdevice	\
303	libdevid	\
304	libdevinfo	\
305	libdiskmgt	\
306	libdladm	\
307	libdlpi		\
308	libdhcpagent	\
309	libdhcpsvc	\
310	libdhcputil	\
311	libdisasm	\
312	libdtrace	\
313	libdtrace_jni	\
314	libeti		\
315	libgen		\
316	libwanboot	\
317	libwanbootutil	\
318	libipsecutil	\
319	libinetcfg	\
320	libinetsvc	\
321	libinetutil	\
322	libipmp		\
323	libipp		\
324	libkstat	\
325	libkvm		\
326        liblaadm        \
327	libmacadm	\
328	libmail		\
329	libmd		\
330	libmtmalloc	\
331	libnvpair	\
332	libnsl		\
333	libpam		\
334	libpctx		\
335	libpicl		\
336	libpicltree	\
337	libplot		\
338	libpool		\
339	libproc		\
340	librcm		\
341	libscf		\
342	libsmbios	\
343	librestart	\
344	librpcsvc	\
345	librsm		\
346	libsasl		\
347	libsec		\
348	libslp		\
349	libsmedia	\
350	libsysevent	\
351	libtecla	\
352	libtnf		\
353	libtnfctl	\
354	libtnfprobe	\
355	libtsnet	\
356	libtsol		\
357	libvolmgt	\
358	libumem		\
359	libuutil	\
360	libwrap		\
361	libxcurses2	\
362	libzfs		\
363	libzfs_jni	\
364	libzoneinfo	\
365	lvm		\
366	openssl		\
367	pkcs11		\
368	passwdutil	\
369	../cmd/sendmail/libmilter	\
370	fm		\
371	udapl		\
372	libmapid	\
373	libkrb5		\
374	$($(MACH)_HDRSUBDIRS)
375
376$(CLOSED_BUILD)HDRSUBDIRS += \
377	$(CLOSED)/lib/libc_i18n	\
378	$(CLOSED)/lib/libike	\
379	$(CLOSED)/lib/smartcard
380
381sparc_HDRSUBDIRS=	\
382	libwrsmconf
383
384all :=		TARGET= all
385check :=	TARGET= check
386clean :=	TARGET= clean
387clobber :=	TARGET= clobber
388install :=	TARGET= install
389install_h :=	TARGET= install_h
390lint :=		TARGET= lint
391_dc :=		TARGET= _dc
392_msg :=		TARGET= _msg
393
394.KEEP_STATE:
395
396#
397# For the all and install targets, we clearly must respect library
398# dependencies so that the libraries link correctly.  However, for
399# the remaining targets (check, clean, clobber, install_h, lint, _dc
400# and _msg), libraries do not have any dependencies on one another
401# and thus respecting dependencies just slows down the build.
402# As such, for these rules, we use pattern replacement to explicitly
403# avoid triggering the dependency information.  Note that for clean,
404# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
405# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
406#
407
408all:			$(SUBDIRS)
409
410install:		$(SUBDIRS) .WAIT install_extra
411
412# extra libraries kept in other source areas
413install_extra:
414	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
415	@pwd
416
417clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
418
419install_h check:	$(HDRSUBDIRS:%=%-nodepend)
420
421_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
422
423_dc:			$(DCSUBDIRS:%=%-nodepend)
424
425# dependencies for pam_modules (see below)
426$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
427
428#
429# Library interdependencies are called out explicitly here
430#
431auditd_plugins: libbsm libnsl libsecdb
432gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
433libadt_jni:	libbsm
434$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
435libbsm:		libtsol
436libcmdutils:	libavl
437libcontract:	libnvpair
438libdevid:	libdevinfo
439libdevinfo:	libnvpair libsec
440libdhcpagent:	libdhcputil libnsl libsocket
441libdhcpsvc:	libinetutil
442libdhcputil:	libinetutil
443libdladm:	libdlpi libdevinfo
444libdtrace:	libproc libgen libctf
445libdtrace_jni:	libuutil libdtrace
446libefi:		libuuid
447$(CLOSED_BUILD)$(CLOSED)/lib/libelfsign: \
448			$(CLOSED)/lib/libike libcryptoutil pkcs11
449libinetcfg:	libnsl libsocket libdevinfo
450libnsl:		libmd5 libscf
451libmapid:	libresolv libcmd
452libmacadm:	libdevinfo
453libuuid:	libsocket
454libinetutil:	libsocket
455libsecdb:	libcmd libnsl
456librt:		libaio libmd
457libsasl:	libgss libsocket pkcs11 libmd
458sasl_plugins:	pkcs11 libgss libsocket libsasl
459libsctp:	libsocket
460libsocket:	libnsl
461libldap5:	libsasl libsocket libnsl libmd
462libsldap:	libldap5 libtsol
463libpool:	libnvpair libexacct
464libproject:	libpool libproc libsecdb
465libtsnet:	libnsl libtsol libsecdb
466libwrap:	libnsl libsocket
467libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
468		libdhcputil openssl
469libwanbootutil:	libnsl
470pam_modules:	libproject passwdutil $(SMARTCARD)
471libscf:		libuutil libmd
472libinetsvc:	libscf
473librestart:	libuutil libscf
474../cmd/sgs/libdl:	../cmd/sgs/libconv
475../cmd/sgs/libelf:	../cmd/sgs/libconv
476pkcs11:		libcryptoutil
477print:		libldap5
478udapl/udapl_tavor:	udapl/libdat
479libzfs:		libdevinfo libdevid libgen libnvpair libuutil
480libzfs_jni:	libdiskmgt libnvpair libzfs
481libzpool:	libavl libumem libnvpair
482libsec:		libavl
483
484#
485# The reason this rule checks for the existence of the
486# Makefile is that some of the directories do not exist
487# in certain situations (e.g., exportable source builds,
488# OpenSolaris).
489#
490$(SUBDIRS) abi: FRC
491	@if [ -f $@/Makefile  ]; then \
492		cd $@; pwd; $(MAKE) $(TARGET); \
493	else \
494		true; \
495	fi
496
497$(SUBDIRS:%=%-nodepend) abi-nodepend:
498	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
499		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
500	else \
501		true; \
502	fi
503
504FRC:
505