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