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