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