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