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