xref: /titanic_44/usr/src/lib/Makefile (revision abcc7ef9701284c984bd4626e74d300a5de42dc5)
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	libinetcfg	\
112	libinetutil	\
113	libipadm	\
114	libipmp		\
115	libiscsit	\
116	libkmf		\
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	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	libntfs		\
272	libparted	\
273	libfdisk
274
275sparc_SUBDIRS= .WAIT	\
276	efcode		\
277	libc_psr	.WAIT	\
278	libds		\
279	libdscp		\
280	libprtdiag	.WAIT	\
281	libprtdiag_psr	\
282	libpri		\
283	librsc		\
284	storage		\
285	libpcp		\
286	libtsalarm	\
287	libv12n
288
289FM_sparc_DEPLIBS= libpri
290
291fm:			\
292	libexacct	\
293	libipmi		\
294	libzfs		\
295	scsi		\
296	$(FM_$(MACH)_DEPLIBS)
297
298#
299# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
300# clean and clobber targets (for more information, see those targets, below).
301#
302NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
303
304DCSUBDIRS =		\
305	lvm
306
307MSGSUBDIRS=		\
308	abi		\
309	auditd_plugins	\
310	brand		\
311	cfgadm_plugins	\
312	gss_mechs/mech_dh	\
313	gss_mechs/mech_krb5	\
314	krb5		\
315	libast		\
316	libbsm		\
317	libc		\
318	libcfgadm	\
319	libcmd		\
320	libcontract	\
321	libcurses	\
322	libdhcpsvc 	\
323	libdhcputil	\
324	libipsecutil	\
325	libdiskmgt	\
326	libdladm	\
327	libdll		\
328	libgrubmgmt	\
329	libgss		\
330	libidmap	\
331	libinetcfg	\
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	libinetcfg	\
417	libinetsvc	\
418	libinetutil	\
419	libinstzones	\
420	libipmi		\
421	libipmp		\
422	libipp		\
423	libiscsit	\
424	libkstat	\
425	libkvm		\
426	libmail		\
427	libmd		\
428	libmtmalloc	\
429	libndmp		\
430	libnvpair	\
431	libnsctl	\
432	libnsl		\
433	libnwam		\
434	libpam		\
435	libpctx		\
436	libpicl		\
437	libpicltree	\
438	libplot		\
439	libpool		\
440	libpp		\
441	libproc		\
442	libraidcfg	\
443	librcm		\
444	librdc		\
445	libscf		\
446	libsip		\
447	libsmbios	\
448	librestart	\
449	librpcsvc	\
450	librsm		\
451	librstp		\
452	libsasl		\
453	libsec		\
454	libshell	\
455	libslp		\
456	libsmedia	\
457	libsocket	\
458	libsqlite	\
459	libfcoe		\
460	libsrpt		\
461	libstmf		\
462	libstmfproxy	\
463	libsum		\
464	libsysevent	\
465	libtecla	\
466	libtnf		\
467	libtnfctl	\
468	libtnfprobe	\
469	libtsnet	\
470	libtsol		\
471	libvrrpadm	\
472	libvolmgt	\
473	libumem		\
474	libunistat	\
475	libuutil	\
476	libwanboot	\
477	libwanbootutil	\
478	libwrap		\
479	libxcurses2	\
480	libzfs		\
481	libzfs_jni	\
482	libzoneinfo	\
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
509$(CLOSED_BUILD)HDRSUBDIRS += \
510	$(CLOSED)/lib/libc_i18n	\
511	$(CLOSED)/lib/libike
512
513i386_HDRSUBDIRS=	\
514	libparted	\
515	libfdisk
516
517sparc_HDRSUBDIRS=	\
518	libds		\
519	libdscp		\
520	libpri		\
521	libv12n		\
522	storage
523
524all :=		TARGET= all
525check :=	TARGET= check
526clean :=	TARGET= clean
527clobber :=	TARGET= clobber
528install :=	TARGET= install
529install_h :=	TARGET= install_h
530lint :=		TARGET= lint
531_dc :=		TARGET= _dc
532_msg :=		TARGET= _msg
533
534.KEEP_STATE:
535
536#
537# For the all and install targets, we clearly must respect library
538# dependencies so that the libraries link correctly.  However, for
539# the remaining targets (check, clean, clobber, install_h, lint, _dc
540# and _msg), libraries do not have any dependencies on one another
541# and thus respecting dependencies just slows down the build.
542# As such, for these rules, we use pattern replacement to explicitly
543# avoid triggering the dependency information.  Note that for clean,
544# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
545# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
546#
547
548all:			$(SUBDIRS)
549
550install:		$(SUBDIRS) .WAIT install_extra
551
552# extra libraries kept in other source areas
553install_extra:
554	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
555	@pwd
556
557clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
558
559install_h check:	$(HDRSUBDIRS:%=%-nodepend)
560
561_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
562
563_dc:			$(DCSUBDIRS:%=%-nodepend)
564
565#
566# Library interdependencies are called out explicitly here
567#
568auditd_plugins: libbsm libnsl libsecdb
569gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
570libadt_jni:	libbsm
571$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
572libast: 	libsocket
573libadutils: 	libldap5 libresolv libsocket libnsl
574nsswitch:	libadutils libidmap
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
596libinetcfg:	libnsl libsocket libdlpi libinetutil
597libipadm:	libnsl libinetutil libsocket libdlpi libnvpair libdhcpagent \
598		libdladm libsecdb
599libiscsit:	libc libnvpair libstmf libuuid libnsl
600libkmf:		libcryptoutil pkcs11
601libnsl:		libmd5
602libmapid:	libresolv
603librdc:		libsocket libnsl libnsctl libunistat libdscfg
604libuuid:	libdlpi
605$(CLOSED_BUILD)libike:	libipsecutil libxnet libcryptoutil
606libinetutil:	libsocket
607libipsecutil:	libtecla libsocket
608libinstzones:	libzonecfg libcontract
609libpkg:		libwanboot libscf libadm
610libnwam:	libscf
611libsecdb:	libnsl
612libsasl:	libgss libsocket pkcs11 libmd
613sasl_plugins:	pkcs11 libgss libsocket libsasl
614libsctp:	libsocket
615libshell:	libast libcmd libdll libsocket libsecdb
616libsip:		libmd5
617libsmbfs:	libsocket libnsl libkrb5
618libsocket:	libnsl
619libstmfproxy: 	libstmf libsocket libnsl libpthread
620libsum: 	libast
621libsysevent:	libsecdb
622libldap5:	libsasl libsocket libnsl libmd
623libsldap:	libldap5 libtsol libnsl libc libscf libresolv
624libpool:	libnvpair libexacct
625libpp:		libast
626libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
627		libbrand libpool libscf
628libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
629libproject:	libpool libproc libsecdb
630libtsnet:	libnsl libtsol libsecdb
631libwrap:	libnsl libsocket
632libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
633		libdhcputil
634libwanbootutil:	libnsl
635pam_modules:	libproject passwdutil smbsrv
636libscf:		libuutil libmd libgen libsmbios libnsl
637libinetsvc:	libscf
638librestart:	libuutil libscf
639../cmd/sgs/libdl:	../cmd/sgs/libconv
640../cmd/sgs/libelf:	../cmd/sgs/libconv
641pkcs11:		libcryptoutil
642print:		libldap5
643udapl/udapl_tavor:	udapl/libdat
644libzfs:		libdevid libgen libnvpair libuutil \
645		libadm libavl libefi libidmap libmd
646libzfs_jni:	libdiskmgt libnvpair libzfs
647libzpool:	libavl libumem libnvpair
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 libreparse
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
665pyzfs:		libnvpair libzfs
666pysolaris:	libsec libidmap
667libreparse:	libnvpair
668libhotplug:	libnvpair
669cfgadm_plugins:	libhotplug
670libilb:		libsocket
671$(INTEL_BUILD)libdiskmgt:libfdisk
672
673#
674# The reason this rule checks for the existence of the
675# Makefile is that some of the directories do not exist
676# in certain situations (e.g., exportable source builds,
677# OpenSolaris).
678#
679$(SUBDIRS): FRC
680	@if [ -f $@/Makefile  ]; then \
681		cd $@; pwd; $(MAKE) $(TARGET); \
682	else \
683		true; \
684	fi
685
686$(SUBDIRS:%=%-nodepend):
687	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
688		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
689	else \
690		true; \
691	fi
692
693FRC:
694