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