xref: /titanic_51/usr/src/lib/Makefile (revision 14ea4bb737263733ad80a36b4f73f681c30a6b45)
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	libwladm	\
189	libwrap		\
190	libxcurses	\
191	libxcurses2	\
192	libxnet		\
193	libbrand	.WAIT   \
194	libzonecfg	\
195	libzoneinfo	\
196	libtsnet	\
197	libtsol		\
198	gss_mechs/mech_spnego	\
199	gss_mechs/mech_dummy	\
200	gss_mechs/mech_dh	\
201	rpcsec_gss	\
202	librcm		.WAIT	\
203	libcfgadm	.WAIT	\
204	libpicl		.WAIT	\
205	libpicltree	.WAIT \
206	cfgadm_plugins	\
207	libmail		\
208	lvm		\
209	libsmedia	\
210	libipp		\
211	openssl		\
212	libdiskmgt	\
213	liblgrp		\
214	libfsmgt	\
215	fm		\
216	libavl		\
217	libcmdutils	\
218	libcontract	\
219	../cmd/sendmail/libmilter	\
220	sasl_plugins	\
221	udapl		\
222	libzpool	\
223	libzfs		\
224	libzfs_jni	\
225	libmapid	\
226	brand		\
227	policykit	\
228	hal		\
229	libshare	\
230	$($(MACH)_SUBDIRS)
231
232sparc_SUBDIRS= .WAIT	\
233	efcode		\
234	libc_psr	.WAIT	\
235	libdscp		\
236	libprtdiag	.WAIT	\
237	libprtdiag_psr	\
238	librsc		\
239	libfruutils	.WAIT	\
240	libfru		\
241	libwrsmconf	\
242	storage		\
243	wrsm		\
244	libpcp
245
246fm: libexacct
247
248#
249# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
250# clean and clobber targets (for more information, see those targets, below).
251#
252NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
253
254DCSUBDIRS =		\
255	lvm
256
257MSGSUBDIRS=		\
258	abi		\
259	auditd_plugins	\
260	brand		\
261	cfgadm_plugins	\
262	gss_mechs/mech_dh	\
263	gss_mechs/mech_krb5	\
264	krb5		\
265	libbsm		\
266	libc		\
267	libcfgadm	\
268	libcontract	\
269	libcurses	\
270	libdhcpsvc 	\
271	libdhcputil	\
272	libdladm	\
273	libgss		\
274	libinetcfg	\
275	libipmp		\
276	libnsl		\
277	libpam		\
278	libpicl		\
279	libpool		\
280	libscf		\
281	libsasl		\
282	libldap5	\
283	libsecdb	\
284	libshare	\
285	libsldap	\
286	libslp		\
287	libsmedia	\
288	libtsol		\
289	libuutil	\
290	libwanboot	\
291	libwanbootutil	\
292	libwladm	\
293	libzonecfg	\
294	lvm		\
295	madv		\
296	mpss		\
297	pam_modules	\
298	rpcsec_gss
299$(CLOSED_BUILD)MSGSUBDIRS += \
300	$(CLOSED)/lib/smartcard
301MSGSUBDIRS += \
302	$($(MACH)_MSGSUBDIRS)
303
304sparc_MSGSUBDIRS=	\
305	libprtdiag	\
306	libprtdiag_psr
307
308HDRSUBDIRS=		\
309	auditd_plugins	\
310	libbrand	\
311	libbsm		\
312	libc		\
313	libcmdutils	\
314	libcontract	\
315	libcpc		\
316	libctf		\
317	libcurses	\
318	libcryptoutil	\
319	libdevice	\
320	libdevid	\
321	libdevinfo	\
322	libdiskmgt	\
323	libdladm	\
324	libdlpi		\
325	libdhcpagent	\
326	libdhcpsvc	\
327	libdhcputil	\
328	libdisasm	\
329	libdtrace	\
330	libdtrace_jni	\
331	libeti		\
332	libfstyp	\
333	libgen		\
334	libwanboot	\
335	libwanbootutil	\
336	libipsecutil	\
337	libinetcfg	\
338	libinetsvc	\
339	libinetutil	\
340	libipmp		\
341	libipp		\
342	libiscsitgt	\
343	libkstat	\
344	libkvm		\
345        liblaadm        \
346	libmacadm	\
347	libmail		\
348	libmd		\
349	libmtmalloc	\
350	libnvpair	\
351	libnsl		\
352	libpam		\
353	libpctx		\
354	libpicl		\
355	libpicltree	\
356	libplot		\
357	libpool		\
358	libproc		\
359	librcm		\
360	libscf		\
361	libsip		\
362	libsmbios	\
363	librestart	\
364	librpcsvc	\
365	librsm		\
366	libsasl		\
367	libsec		\
368	libslp		\
369	libsmedia	\
370	libsysevent	\
371	libtecla	\
372	libtnf		\
373	libtnfctl	\
374	libtnfprobe	\
375	libtsnet	\
376	libtsol		\
377	libvolmgt	\
378	libumem		\
379	libuutil	\
380	libwladm	\
381	libwrap		\
382	libxcurses2	\
383	libzfs		\
384	libzfs_jni	\
385	libzoneinfo	\
386	hal		\
387	policykit	\
388	lvm		\
389	openssl		\
390	pkcs11		\
391	passwdutil	\
392	../cmd/sendmail/libmilter	\
393	fm		\
394	udapl		\
395	libmapid	\
396	libkrb5		\
397	libshare	\
398	$($(MACH)_HDRSUBDIRS)
399
400$(CLOSED_BUILD)HDRSUBDIRS += \
401	$(CLOSED)/lib/libc_i18n	\
402	$(CLOSED)/lib/libike	\
403	$(CLOSED)/lib/smartcard
404
405sparc_HDRSUBDIRS=	\
406	libdscp		\
407	libwrsmconf
408
409all :=		TARGET= all
410check :=	TARGET= check
411clean :=	TARGET= clean
412clobber :=	TARGET= clobber
413install :=	TARGET= install
414install_h :=	TARGET= install_h
415lint :=		TARGET= lint
416_dc :=		TARGET= _dc
417_msg :=		TARGET= _msg
418
419.KEEP_STATE:
420
421#
422# For the all and install targets, we clearly must respect library
423# dependencies so that the libraries link correctly.  However, for
424# the remaining targets (check, clean, clobber, install_h, lint, _dc
425# and _msg), libraries do not have any dependencies on one another
426# and thus respecting dependencies just slows down the build.
427# As such, for these rules, we use pattern replacement to explicitly
428# avoid triggering the dependency information.  Note that for clean,
429# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
430# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
431#
432
433all:			$(SUBDIRS)
434
435install:		$(SUBDIRS) .WAIT install_extra
436
437# extra libraries kept in other source areas
438install_extra:
439	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
440	@pwd
441
442clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
443
444install_h check:	$(HDRSUBDIRS:%=%-nodepend)
445
446_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
447
448_dc:			$(DCSUBDIRS:%=%-nodepend)
449
450# dependencies for pam_modules (see below)
451$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
452
453#
454# Library interdependencies are called out explicitly here
455#
456auditd_plugins: libbsm libnsl libsecdb
457gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
458libadt_jni:	libbsm
459$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
460libbsm:		libtsol
461libcmdutils:	libavl
462libcontract:	libnvpair
463libdevid:	libdevinfo
464libdevinfo:	libnvpair libsec
465libdhcpagent:	libdhcputil libnsl libsocket
466libdhcpsvc:	libinetutil
467libdhcputil:	libinetutil
468libdladm:	libdlpi libdevinfo libwladm libinetutil
469libdtrace:	libproc libgen libctf
470libdtrace_jni:	libuutil libdtrace
471libefi:		libuuid
472libfstyp:	libnvpair
473$(CLOSED_BUILD)$(CLOSED)/lib/libelfsign: \
474			$(CLOSED)/lib/libike libcryptoutil pkcs11
475libinetcfg:	libnsl libsocket libdevinfo
476libkmf:		libcryptoutil pkcs11 openssl
477libnsl:		libmd5 libscf
478libmapid:	libresolv
479libmacadm:	libdevinfo
480libuuid:	libsocket
481libinetutil:	libsocket
482libsecdb:	libnsl
483libsasl:	libgss libsocket pkcs11 libmd
484sasl_plugins:	pkcs11 libgss libsocket libsasl
485libsctp:	libsocket
486libsip:		libmd5
487libsocket:	libnsl
488libldap5:	libsasl libsocket libnsl libmd
489libsldap:	libldap5 libtsol
490libpool:	libnvpair libexacct
491libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
492		libbrand libpool libscf
493libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
494libproject:	libpool libproc libsecdb
495libtsnet:	libnsl libtsol libsecdb
496libwrap:	libnsl libsocket
497libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
498		libdhcputil openssl
499libwanbootutil:	libnsl
500libwladm:	libdevinfo libsocket
501pam_modules:	libproject passwdutil $(SMARTCARD)
502libscf:		libuutil libmd
503libinetsvc:	libscf
504librestart:	libuutil libscf
505../cmd/sgs/libdl:	../cmd/sgs/libconv
506../cmd/sgs/libelf:	../cmd/sgs/libconv
507pkcs11:		libcryptoutil
508print:		libldap5
509udapl/udapl_tavor:	udapl/libdat
510libzfs:		libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
511libzfs_jni:	libdiskmgt libnvpair libzfs
512libzpool:	libavl libumem libnvpair
513libsec:		libavl
514brand:		libc libsocket
515libshare:	libscf libzfs libuuid libfsmgt libsecdb
516
517#
518# The reason this rule checks for the existence of the
519# Makefile is that some of the directories do not exist
520# in certain situations (e.g., exportable source builds,
521# OpenSolaris).
522#
523$(SUBDIRS): FRC
524	@if [ -f $@/Makefile  ]; then \
525		cd $@; pwd; $(MAKE) $(TARGET); \
526	else \
527		true; \
528	fi
529
530$(SUBDIRS:%=%-nodepend):
531	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
532		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
533	else \
534		true; \
535	fi
536
537FRC:
538