xref: /titanic_44/usr/src/lib/Makefile (revision dd51520e127b452179a2ce4ea3bd8dee949f9afe)
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	libbe 		\
242	pylibbe 	\
243	libzfs_jni	\
244	pyzfs		\
245	pysolaris	\
246	libmapid	\
247	brand		\
248	policykit	\
249	hal		\
250	libshare	\
251	libsqlite	\
252	libidmap	\
253	libadutils	\
254	libipmi		\
255	libexacct/demo	\
256	libvrrpadm	\
257	libvscan	\
258	libgrubmgmt	\
259	smbsrv		\
260	libilb		\
261	scsi		\
262	libima		\
263	libsun_ima	\
264	mpapi		\
265	librstp		\
266	libreparse	\
267	libhotplug	\
268	libfruutils	.WAIT	\
269	libfru		\
270	$($(MACH)_SUBDIRS)
271
272i386_SUBDIRS=		\
273	libntfs		\
274	libparted	\
275	libfdisk
276
277sparc_SUBDIRS= .WAIT	\
278	efcode		\
279	libds		\
280	libdscp		\
281	libprtdiag	.WAIT	\
282	libprtdiag_psr	\
283	libpri		\
284	librsc		\
285	storage		\
286	libpcp		\
287	libtsalarm	\
288	libv12n
289
290FM_sparc_DEPLIBS= libpri
291
292fm:			\
293	libexacct	\
294	libipmi		\
295	libzfs		\
296	scsi		\
297	$(FM_$(MACH)_DEPLIBS)
298
299#
300# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
301# clean and clobber targets (for more information, see those targets, below).
302#
303NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
304
305DCSUBDIRS =		\
306	lvm
307
308MSGSUBDIRS=		\
309	abi		\
310	auditd_plugins	\
311	brand		\
312	cfgadm_plugins	\
313	gss_mechs/mech_dh	\
314	gss_mechs/mech_krb5	\
315	krb5		\
316	libast		\
317	libbsm		\
318	libc		\
319	libcfgadm	\
320	libcmd		\
321	libcontract	\
322	libcurses	\
323	libdhcpsvc 	\
324	libdhcputil	\
325	libipsecutil	\
326	libdiskmgt	\
327	libdladm	\
328	libdll		\
329	libgrubmgmt	\
330	libgss		\
331	libidmap	\
332	libipmp		\
333	libilb		\
334	libinetutil	\
335	libinstzones	\
336	libipadm	\
337	libnsl		\
338	libnwam		\
339	libpam		\
340	libpicl		\
341	libpool		\
342	libpkg		\
343	libpp		\
344	libscf		\
345	libsasl		\
346	libldap5	\
347	libsecdb	\
348	libshare	\
349	libshell	\
350	libsldap	\
351	libslp		\
352	libsmbfs	\
353	libsmedia	\
354	libsum		\
355	libtsol		\
356	libuutil	\
357	libvrrpadm	\
358	libvscan	\
359	libwanboot	\
360	libwanbootutil	\
361	libzfs		\
362	libzonecfg	\
363	lvm		\
364	madv		\
365	mpss		\
366	pam_modules	\
367	pyzfs		\
368	pysolaris	\
369	rpcsec_gss	\
370	libreparse
371MSGSUBDIRS += \
372	$($(MACH)_MSGSUBDIRS)
373
374sparc_MSGSUBDIRS=	\
375	libprtdiag	\
376	libprtdiag_psr
377
378i386_MSGSUBDIRS= libfdisk
379
380HDRSUBDIRS=		\
381	auditd_plugins	\
382	libast		\
383	libbrand	\
384	libbsm		\
385	libc		\
386	libcmd		\
387	libcmdutils	\
388	libcommputil	\
389	libcontract	\
390	libcpc		\
391	libctf		\
392	libcurses	\
393	libcryptoutil	\
394	libdevice	\
395	libdevid	\
396	libdevinfo	\
397	libdiskmgt	\
398	libdladm	\
399	libdll		\
400	libdlpi		\
401	libdhcpagent	\
402	libdhcpsvc	\
403	libdhcputil	\
404	libdisasm	\
405	libdns_sd	\
406	libdscfg	\
407	libdtrace	\
408	libdtrace_jni	\
409	libelfsign	\
410	libeti		\
411	libfru		\
412	libfstyp	\
413	libgen		\
414	libipadm	\
415	libipsecutil	\
416	libinetsvc	\
417	libinetutil	\
418	libinstzones	\
419	libipmi		\
420	libipmp		\
421	libipp		\
422	libiscsit	\
423	libkstat	\
424	libkvm		\
425	libmail		\
426	libmd		\
427	libmtmalloc	\
428	libndmp		\
429	libnvpair	\
430	libnsctl	\
431	libnsl		\
432	libnwam		\
433	libpam		\
434	libpctx		\
435	libpicl		\
436	libpicltree	\
437	libplot		\
438	libpool		\
439	libpp		\
440	libproc		\
441	libraidcfg	\
442	librcm		\
443	librdc		\
444	libscf		\
445	libsip		\
446	libsmbios	\
447	librestart	\
448	librpcsvc	\
449	librsm		\
450	librstp		\
451	libsasl		\
452	libsec		\
453	libshell	\
454	libslp		\
455	libsmedia	\
456	libsocket	\
457	libsqlite	\
458	libfcoe		\
459	libsrpt		\
460	libstmf		\
461	libstmfproxy	\
462	libsum		\
463	libsysevent	\
464	libtecla	\
465	libtnf		\
466	libtnfctl	\
467	libtnfprobe	\
468	libtsnet	\
469	libtsol		\
470	libvrrpadm	\
471	libvolmgt	\
472	libumem		\
473	libunistat	\
474	libuutil	\
475	libwanboot	\
476	libwanbootutil	\
477	libwrap		\
478	libxcurses2	\
479	libzfs		\
480	libzfs_jni	\
481	libzoneinfo	\
482	hal		\
483	policykit	\
484	lvm		\
485	pkcs11		\
486	passwdutil	\
487	../cmd/sendmail/libmilter	\
488	fm		\
489	udapl		\
490	libmapid	\
491	libkrb5		\
492	libsmbfs	\
493	libshare	\
494	libidmap	\
495	libvscan	\
496	libgrubmgmt	\
497	smbsrv		\
498	libilb		\
499	scsi		\
500	hbaapi		\
501	smhba		\
502	libima		\
503	libsun_ima	\
504	mpapi		\
505	libreparse	\
506	$($(MACH)_HDRSUBDIRS)
507
508$(CLOSED_BUILD)HDRSUBDIRS += \
509	$(CLOSED)/lib/libc_i18n	\
510	$(CLOSED)/lib/libike
511
512i386_HDRSUBDIRS=	\
513	libparted	\
514	libfdisk
515
516sparc_HDRSUBDIRS=	\
517	libds		\
518	libdscp		\
519	libpri		\
520	libv12n		\
521	storage
522
523all :=		TARGET= all
524check :=	TARGET= check
525clean :=	TARGET= clean
526clobber :=	TARGET= clobber
527install :=	TARGET= install
528install_h :=	TARGET= install_h
529lint :=		TARGET= lint
530_dc :=		TARGET= _dc
531_msg :=		TARGET= _msg
532
533.KEEP_STATE:
534
535#
536# For the all and install targets, we clearly must respect library
537# dependencies so that the libraries link correctly.  However, for
538# the remaining targets (check, clean, clobber, install_h, lint, _dc
539# and _msg), libraries do not have any dependencies on one another
540# and thus respecting dependencies just slows down the build.
541# As such, for these rules, we use pattern replacement to explicitly
542# avoid triggering the dependency information.  Note that for clean,
543# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
544# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
545#
546
547all:			$(SUBDIRS)
548
549install:		$(SUBDIRS) .WAIT install_extra
550
551# extra libraries kept in other source areas
552install_extra:
553	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
554	@pwd
555
556clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
557
558install_h check:	$(HDRSUBDIRS:%=%-nodepend)
559
560_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
561
562_dc:			$(DCSUBDIRS:%=%-nodepend)
563
564#
565# Library interdependencies are called out explicitly here
566#
567auditd_plugins: libbsm libnsl libsecdb
568gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
569libadt_jni:	libbsm
570$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
571libast: 	libsocket
572libadutils: 	libldap5 libresolv libsocket libnsl
573nsswitch:	libadutils libidmap
574libbe: 		libzfs
575libbsm:		libtsol
576libcmd: 	libsum libast libsocket libnsl
577libcmdutils:	libavl
578libcontract:	libnvpair
579libdevid:	libdevinfo
580libdevinfo:	libnvpair libsec
581libdhcpagent:	libsocket libdhcputil libuuid libdlpi libcontract
582libdhcpsvc:	libinetutil
583libdhcputil:	libnsl libgen libinetutil libdlpi
584libdladm:	libdevinfo libinetutil libsocket libscf librcm libnvpair \
585		libexacct libnsl libkstat libcurses
586libdll: 	libast
587libdlpi:	libinetutil libdladm
588libds:		libsysevent
589libdscfg:	libnsctl libunistat libsocket libnsl
590libdtrace:	libproc libgen libctf
591libdtrace_jni:	libuutil libdtrace
592libefi:		libuuid
593libfstyp:	libnvpair
594libelfsign:	libcryptoutil libkmf
595libidmap:	libadutils libldap5 libavl libsldap libuutil
596libipadm:	libnsl libinetutil libsocket libdlpi libnvpair libdhcpagent \
597		libdladm libsecdb
598libiscsit:	libc libnvpair libstmf libuuid libnsl
599libkmf:		libcryptoutil pkcs11
600libnsl:		libmd5
601libmapid:	libresolv
602librdc:		libsocket libnsl libnsctl libunistat libdscfg
603libuuid:	libdlpi
604$(CLOSED_BUILD)libike:	libipsecutil libxnet libcryptoutil
605libinetutil:	libsocket
606libipsecutil:	libtecla libsocket
607libinstzones:	libzonecfg libcontract
608libpkg:		libwanboot libscf libadm
609libnwam:	libscf
610libsecdb:	libnsl
611libsasl:	libgss libsocket pkcs11 libmd
612sasl_plugins:	pkcs11 libgss libsocket libsasl
613libsctp:	libsocket
614libshell:	libast libcmd libdll libsocket libsecdb
615libsip:		libmd5
616libsmbfs:	libcmdutils libsocket libnsl libkrb5
617libsocket:	libnsl
618libstmfproxy: 	libstmf libsocket libnsl libpthread
619libsum: 	libast
620libsysevent:	libsecdb
621libldap5:	libsasl libsocket libnsl libmd
622libsldap:	libldap5 libtsol libnsl libc libscf libresolv
623libpool:	libnvpair libexacct
624libpp:		libast
625libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
626		libbrand libpool libscf
627libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
628libproject:	libpool libproc libsecdb
629libtsnet:	libnsl libtsol libsecdb
630libwrap:	libnsl libsocket
631libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
632		libdhcputil
633libwanbootutil:	libnsl
634pam_modules:	libproject passwdutil smbsrv
635libscf:		libuutil libmd libgen libsmbios libnsl
636libinetsvc:	libscf
637librestart:	libuutil libscf
638../cmd/sgs/libdl:	../cmd/sgs/libconv
639../cmd/sgs/libelf:	../cmd/sgs/libconv
640pkcs11:		libcryptoutil libkmsagent
641print:		libldap5
642udapl/udapl_tavor:	udapl/libdat
643libzfs:		libdevid libgen libnvpair libuutil \
644		libadm libavl libefi libidmap libmd
645libzfs_jni:	libdiskmgt libnvpair libzfs
646libzpool:	libavl libumem libnvpair libcmdutils
647libsec:		libavl libidmap
648brand:		libc libsocket
649libshare:	libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
650libexacct/demo:	libexacct libproject libsocket libnsl
651libtsalarm:	libpcp
652smbsrv:		libsocket libnsl libmd libxnet libpthread librt \
653		libshare libidmap pkcs11 libsqlite libcryptoutil \
654		libreparse libcmdutils
655libv12n:	libds libuuid
656libvrrpadm:	libsocket libdladm libscf
657libvscan:	libscf
658libfru:		libfruutils
659scsi:		libnvpair libfru
660mpapi:		libpthread libdevinfo libsysevent libnvpair
661sun_fc:		libdevinfo libsysevent libnvpair
662libsun_ima:	libdevinfo libsysevent libnsl
663sun_sas:	libdevinfo libsysevent libnvpair libkstat libdevid
664libgrubmgmt:	libdevinfo libzfs libfstyp
665pylibbe: 	libbe libzfs
666pyzfs:		libnvpair libzfs
667pysolaris:	libsec libidmap
668libreparse:	libnvpair
669libhotplug:	libnvpair
670cfgadm_plugins:	libhotplug
671libilb:		libsocket
672$(INTEL_BUILD)libdiskmgt:libfdisk
673
674#
675# The reason this rule checks for the existence of the
676# Makefile is that some of the directories do not exist
677# in certain situations (e.g., exportable source builds,
678# OpenSolaris).
679#
680$(SUBDIRS): FRC
681	@if [ -f $@/Makefile  ]; then \
682		cd $@; pwd; $(MAKE) $(TARGET); \
683	else \
684		true; \
685	fi
686
687$(SUBDIRS:%=%-nodepend):
688	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
689		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
690	else \
691		true; \
692	fi
693
694FRC:
695