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