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