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