xref: /titanic_44/usr/src/lib/Makefile (revision 6a3e8e8695d5c7d1d18c6800d676990d7f61a2a4)
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
25include ../Makefile.master
26
27#	Note that libcurses installs commands along with its library.
28#	This is a minor bug which probably should be fixed.
29#	Note also that a few extra libraries are kept in cmd source.
30#
31# Certain libraries are linked with, hence depend on, other libraries.
32#
33# Although we have historically used .WAIT to express dependencies, it
34# reduces the amount of parallelism and thus lengthens the time it
35# takes to build the libraries.  Thus, we now require that any new
36# libraries explicitly call out their dependencies.  Eventually, all
37# the library dependencies will be called out explicitly.  See
38# "Library interdependencies" near the end of this file.
39#
40# Aside from explicit dependencies (and legacy .WAITs), all libraries
41# are built in parallel.
42#
43.PARALLEL:
44
45#
46# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
47# but required due to the "dependencies" of using .WAIT to barrier the
48# parallel dmake builds.  once 4631488 has been fixed, they can be
49# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
50# shown in HDRSUBDIRS
51#
52SUBDIRS= \
53	common			.WAIT	\
54	../cmd/sgs/libconv		\
55	../cmd/sgs/libdl	.WAIT
56
57SUBDIRS += \
58	libc			.WAIT	\
59	../cmd/sgs/libelf	.WAIT	\
60	c_synonyms			\
61	libmd				\
62	libmd5				\
63	librsm				\
64	libmp			.WAIT	\
65	libnsl			\
66	libsecdb		.WAIT	\
67	librpcsvc			\
68	libsocket		.WAIT	\
69	libsctp			\
70	libsip			\
71	libcommputil		\
72	libresolv			\
73	libresolv2		.WAIT	\
74	libw			.WAIT	\
75	libintl			.WAIT	\
76	../cmd/sgs/librtld_db	\
77	libaio			\
78	libast			\
79	libdll			\
80	libcmd			\
81	libshell		\
82	libsum			\
83	librt			\
84	libadm			\
85	libctf			\
86	libdtrace		\
87	libdtrace_jni		\
88	libcurses		\
89	libtermcap		\
90	libgen			\
91	libgss			\
92	libpam			\
93	libuuid			\
94	libthread		\
95	libpthread	.WAIT	\
96	libslp		\
97	libbsdmalloc	\
98	libdoor		\
99	libdevinfo	\
100	libdladm	\
101	libdlpi		\
102	libeti		\
103	libcrypt	\
104	libdns_sd	\
105	libefi		\
106	libfstyp	\
107	libwanboot	\
108	libwanbootutil	\
109	libcryptoutil	\
110	libinetutil	\
111	libipadm	\
112	libipmp		\
113	libiscsit	\
114	libkmf		\
115	libkstat	\
116	libkvm		\
117	liblm		\
118	libmalloc	\
119	libmapmalloc	\
120	libmtmalloc	\
121	libnls		\
122	libnwam		\
123	libsmbios	\
124	libtecla	\
125	libumem		\
126	libnvpair	.WAIT	\
127	libexacct	\
128	libsasl		\
129	libldap5	\
130	libsldap	.WAIT	\
131	libbsm		\
132	libsys		\
133	libsysevent	\
134	libnisdb	\
135	libpool		\
136	libpp		\
137	libproc		\
138	libproject	\
139	libsendfile	\
140	nametoaddr	\
141	ncad_addr	\
142	hbaapi		\
143	smhba		\
144	sun_fc		\
145	sun_sas		\
146	gss_mechs/mech_krb5	.WAIT	\
147	libkrb5	.WAIT	\
148	krb5	.WAIT	\
149	libsmbfs	\
150	libfcoe		\
151	libsrpt		\
152	libstmf		\
153	libstmfproxy	\
154	libnsctl	\
155	libunistat	\
156	libdscfg	\
157	librdc		\
158	libinstzones	\
159	libpkg
160
161SUBDIRS += \
162	passwdutil	\
163	pam_modules	\
164	crypt_modules	\
165	libadt_jni	\
166	abi		\
167	auditd_plugins	\
168	libvolmgt	\
169	libdevice	\
170	libdevid	\
171	libdhcpsvc	\
172	libc_db		\
173	libndmp		\
174	libsec		\
175	libtnfprobe	\
176	libtnf		\
177	libtnfctl	\
178	libdhcpagent	\
179	libdhcpdu	\
180	libdhcputil	\
181	libxnet		\
182	libipsecutil
183$(CLOSED_BUILD)SUBDIRS += \
184	$(CLOSED)/lib/libike
185SUBDIRS += \
186	nsswitch	\
187	print		\
188	libuutil	\
189	libscf		\
190	libinetsvc	\
191	librestart	\
192	libsched	\
193	libelfsign	\
194	pkcs11		.WAIT	\
195	libpctx		.WAIT	\
196	libcpc		\
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		\
238	libbe 		\
239	pylibbe 	\
240	libzfs_jni	\
241	pyzfs		\
242	pysolaris	\
243	libmapid	\
244	brand		\
245	policykit	\
246	hal		\
247	libshare	\
248	libsqlite	\
249	libidmap	\
250	libadutils	\
251	libipmi		\
252	libexacct/demo	\
253	libvrrpadm	\
254	libvscan	\
255	libgrubmgmt	\
256	smbsrv		\
257	libilb		\
258	scsi		\
259	libima		\
260	libsun_ima	\
261	mpapi		\
262	librstp		\
263	libreparse	\
264	libhotplug	\
265	libfruutils	.WAIT	\
266	libfru		\
267	$($(MACH)_SUBDIRS)
268
269i386_SUBDIRS=		\
270	libntfs		\
271	libparted	\
272	libfdisk
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	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	libpool		\
436	libpp		\
437	libproc		\
438	libraidcfg	\
439	librcm		\
440	librdc		\
441	libscf		\
442	libsip		\
443	libsmbios	\
444	librestart	\
445	librpcsvc	\
446	librsm		\
447	librstp		\
448	libsasl		\
449	libsec		\
450	libshell	\
451	libslp		\
452	libsmedia	\
453	libsocket	\
454	libsqlite	\
455	libfcoe		\
456	libsrpt		\
457	libstmf		\
458	libstmfproxy	\
459	libsum		\
460	libsysevent	\
461	libtecla	\
462	libtnf		\
463	libtnfctl	\
464	libtnfprobe	\
465	libtsnet	\
466	libtsol		\
467	libvrrpadm	\
468	libvolmgt	\
469	libumem		\
470	libunistat	\
471	libuutil	\
472	libwanboot	\
473	libwanbootutil	\
474	libwrap		\
475	libxcurses2	\
476	libzfs		\
477	libzfs_jni	\
478	libzoneinfo	\
479	libzonestat	\
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/libike
508
509i386_HDRSUBDIRS=	\
510	libparted	\
511	libfdisk
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
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
596libnsl:		libmd5
597libmapid:	libresolv
598librdc:		libsocket libnsl libnsctl libunistat libdscfg
599libuuid:	libdlpi
600$(CLOSED_BUILD)libike:	libipsecutil libxnet libcryptoutil
601libinetutil:	libsocket
602libipsecutil:	libtecla libsocket
603libinstzones:	libzonecfg libcontract
604libpkg:		libwanboot libscf libadm
605libnwam:	libscf
606libsecdb:	libnsl
607libsasl:	libgss libsocket pkcs11 libmd
608sasl_plugins:	pkcs11 libgss libsocket libsasl
609libsctp:	libsocket
610libshell:	libast libcmd libdll libsocket libsecdb
611libsip:		libmd5
612libsmbfs:	libcmdutils libsocket libnsl libkrb5
613libsocket:	libnsl
614libstmfproxy: 	libstmf libsocket libnsl libpthread
615libsum: 	libast
616libsysevent:	libsecdb
617libldap5:	libsasl libsocket libnsl libmd
618libsldap:	libldap5 libtsol libnsl libc libscf libresolv
619libpool:	libnvpair libexacct
620libpp:		libast
621libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
622		libbrand libpool libscf
623libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
624libproject:	libpool libproc libsecdb
625libtermcap:	libcurses
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
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
662pylibbe: 	libbe libzfs
663pyzfs:		libnvpair libzfs
664pysolaris:	libsec libidmap
665libreparse:	libnvpair
666libhotplug:	libnvpair
667cfgadm_plugins:	libhotplug
668libilb:		libsocket
669$(INTEL_BUILD)libdiskmgt:libfdisk
670
671#
672# The reason this rule checks for the existence of the
673# Makefile is that some of the directories do not exist
674# in certain situations (e.g., exportable source builds,
675# OpenSolaris).
676#
677$(SUBDIRS): FRC
678	@if [ -f $@/Makefile  ]; then \
679		cd $@; pwd; $(MAKE) $(TARGET); \
680	else \
681		true; \
682	fi
683
684$(SUBDIRS:%=%-nodepend):
685	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
686		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
687	else \
688		true; \
689	fi
690
691FRC:
692