xref: /titanic_51/usr/src/lib/Makefile (revision b127ac411761a3d8d642d9342d9cac2785e1faaa)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#
26
27include ../Makefile.master
28
29#	Note that libcurses installs commands along with its library.
30#	This is a minor bug which probably should be fixed.
31#	Note also that a few extra libraries are kept in cmd source.
32#
33# Certain libraries are linked with, hence depend on, other libraries.
34#
35# Although we have historically used .WAIT to express dependencies, it
36# reduces the amount of parallelism and thus lengthens the time it
37# takes to build the libraries.  Thus, we now require that any new
38# libraries explicitly call out their dependencies.  Eventually, all
39# the library dependencies will be called out explicitly.  See
40# "Library interdependencies" near the end of this file.
41#
42# Aside from explicit dependencies (and legacy .WAITs), all libraries
43# are built in parallel.
44#
45.PARALLEL:
46
47#
48# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
49# but required due to the "dependencies" of using .WAIT to barrier the
50# parallel dmake builds.  once 4631488 has been fixed, they can be
51# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
52# shown in HDRSUBDIRS
53#
54SUBDIRS= \
55	common			.WAIT	\
56	../cmd/sgs/libconv		\
57	../cmd/sgs/libdl	.WAIT
58
59$(CLOSED_BUILD)SUBDIRS += \
60	$(CLOSED)/lib/libc_i18n
61
62SUBDIRS += \
63	libc			.WAIT	\
64	../cmd/sgs/libelf	.WAIT	\
65	c_synonyms			\
66	libmd				\
67	libmd5				\
68	librsm				\
69	libmp			.WAIT	\
70	libnsl			\
71	libsecdb		.WAIT	\
72	librpcsvc			\
73	libsocket		.WAIT	\
74	libsctp			\
75	libsip			\
76	libcommputil		\
77	libresolv			\
78	libresolv2		.WAIT	\
79	libw			.WAIT	\
80	libintl			.WAIT	\
81	../cmd/sgs/librtld_db	\
82	libaio			\
83	libast			\
84	libdll			\
85	libcmd			\
86	libshell		\
87	librt			\
88	libadm			\
89	libctf			\
90	libdtrace		\
91	libdtrace_jni		\
92	libcurses		\
93	libgen			\
94	libgss			\
95	libpam			\
96	libuuid			\
97	libthread		\
98	libpthread	.WAIT	\
99	libslp		\
100	libbsdmalloc	\
101	libdoor		\
102	libdevinfo	\
103	libdladm	\
104	libdlpi		\
105	libeti		\
106	libcrypt	\
107	libdns_sd	\
108	libefi		\
109	libfstyp	\
110	libwanboot	\
111	libwanbootutil	\
112	libcryptoutil	\
113	libinetcfg	\
114	libinetutil	\
115	libipmp		\
116	libiscsit	\
117	libiscsitgt	\
118	libkmf		\
119	libkstat	\
120	libkvm		\
121	liblm		\
122	libmalloc	\
123	libmapmalloc	\
124	libmtmalloc	\
125	libnls		\
126	libnwam		\
127	libsmbios	\
128	libtecla	\
129	libumem		\
130	libnvpair	.WAIT	\
131	libexacct	\
132	libplot		\
133	libldap4	\
134	libsasl		\
135	libldap5	\
136	libsldap	.WAIT	\
137	libbsm		\
138	libsys		\
139	libsysevent	\
140	libnisdb	\
141	libpool		\
142	libpp		\
143	libproc		\
144	libproject	\
145	libsendfile	\
146	nametoaddr	\
147	ncad_addr	\
148	hbaapi		\
149	sun_fc		\
150	gss_mechs/mech_krb5	.WAIT	\
151	libkrb5	.WAIT	\
152	krb5	.WAIT	\
153	libsmbfs	\
154	libstmf		\
155	libnsctl	\
156	libunistat	\
157	libdscfg	\
158	librdc
159$(CLOSED_BUILD)SUBDIRS += \
160	$(CLOSED)/lib/smartcard
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	libipsecutil
182$(CLOSED_BUILD)SUBDIRS += \
183	$(CLOSED)/lib/libike
184SUBDIRS += \
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	watchmalloc	\
197	extendedFILE	\
198	madv		\
199	mpss		\
200	libdisasm	\
201	libwrap		\
202	libxcurses	\
203	libxcurses2	\
204	libxnet		\
205	libbrand	.WAIT   \
206	libzonecfg	\
207	libzoneinfo	\
208	libtsnet	\
209	libtsol		\
210	gss_mechs/mech_spnego	\
211	gss_mechs/mech_dummy	\
212	gss_mechs/mech_dh	\
213	rpcsec_gss	\
214	libraidcfg	.WAIT	\
215	librcm		.WAIT	\
216	libcfgadm	.WAIT	\
217	libpicl		.WAIT	\
218	libpicltree	.WAIT \
219	raidcfg_plugins	\
220	cfgadm_plugins	\
221	libmail		\
222	lvm		\
223	libsmedia	\
224	libipp		\
225	openssl		\
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	libzfs_jni	\
239	libmapid	\
240	brand		\
241	policykit	\
242	hal		\
243	libshare	\
244	libsqlite	\
245	libidmap	\
246	libipmi		\
247	libexacct/demo	\
248	libvscan	\
249	smbsrv		\
250	scsi		\
251	mms		\
252	libima		\
253	libsun_ima	\
254	mpapi		\
255	$($(MACH)_SUBDIRS)
256
257sparc_SUBDIRS= .WAIT	\
258	efcode		\
259	libc_psr	.WAIT	\
260	libds		\
261	libdscp		\
262	libprtdiag	.WAIT	\
263	libprtdiag_psr	\
264	libpri		\
265	librsc		\
266	libfruutils	.WAIT	\
267	libfru		\
268	storage		\
269	libpcp		\
270	libtsalarm
271
272FM_sparc_DEPLIBS= libpri
273
274fm:			\
275	libexacct	\
276	libipmi		\
277	scsi		\
278	$(FM_$(MACH)_DEPLIBS)
279
280#
281# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
282# clean and clobber targets (for more information, see those targets, below).
283#
284NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
285
286DCSUBDIRS =		\
287	lvm
288
289MSGSUBDIRS=		\
290	abi		\
291	auditd_plugins	\
292	brand		\
293	cfgadm_plugins	\
294	gss_mechs/mech_dh	\
295	gss_mechs/mech_krb5	\
296	krb5		\
297	libast		\
298	libbsm		\
299	libc		\
300	libcfgadm	\
301	libcmd		\
302	libcontract	\
303	libcurses	\
304	libdhcpsvc 	\
305	libdhcputil	\
306	libipsecutil	\
307	libdiskmgt	\
308	libdladm	\
309	libdll		\
310	libgss		\
311	libidmap	\
312	libinetcfg	\
313	libipmp		\
314	libnsl		\
315	libpam		\
316	libpicl		\
317	libpool		\
318	libpp		\
319	libscf		\
320	libsasl		\
321	libldap5	\
322	libsecdb	\
323	libshare	\
324	libshell	\
325	libsldap	\
326	libslp		\
327	libsmbfs	\
328	libsmedia	\
329	libtsol		\
330	libuutil	\
331	libvscan	\
332	libwanboot	\
333	libwanbootutil	\
334	libzfs		\
335	libzonecfg	\
336	lvm		\
337	madv		\
338	mms		\
339	mpss		\
340	pam_modules	\
341	rpcsec_gss
342$(CLOSED_BUILD)MSGSUBDIRS += \
343	$(CLOSED)/lib/smartcard
344MSGSUBDIRS += \
345	$($(MACH)_MSGSUBDIRS)
346
347sparc_MSGSUBDIRS=	\
348	libprtdiag	\
349	libprtdiag_psr
350
351HDRSUBDIRS=		\
352	auditd_plugins	\
353	libast		\
354	libbrand	\
355	libbsm		\
356	libc		\
357	libcmd		\
358	libcmdutils	\
359	libcontract	\
360	libcpc		\
361	libctf		\
362	libcurses	\
363	libcryptoutil	\
364	libdevice	\
365	libdevid	\
366	libdevinfo	\
367	libdiskmgt	\
368	libdladm	\
369	libdll		\
370	libdlpi		\
371	libdhcpagent	\
372	libdhcpsvc	\
373	libdhcputil	\
374	libdisasm	\
375	libdns_sd	\
376	libdscfg	\
377	libdtrace	\
378	libdtrace_jni	\
379	libelfsign	\
380	libeti		\
381	libfstyp	\
382	libgen		\
383	libwanboot	\
384	libwanbootutil	\
385	libipsecutil	\
386	libinetcfg	\
387	libinetsvc	\
388	libinetutil	\
389	libipmi		\
390	libipmp		\
391	libipp		\
392	libiscsit	\
393	libiscsitgt	\
394	libkstat	\
395	libkvm		\
396	libmail		\
397	libmd		\
398	libmtmalloc	\
399	libndmp		\
400	libnvpair	\
401	libnsctl	\
402	libnsl		\
403	libnwam		\
404	libpam		\
405	libpctx		\
406	libpicl		\
407	libpicltree	\
408	libplot		\
409	libpool		\
410	libpp		\
411	libproc		\
412	libraidcfg	\
413	librcm		\
414	librdc		\
415	libscf		\
416	libsip		\
417	libcommputil	\
418	libsmbios	\
419	librestart	\
420	librpcsvc	\
421	librsm		\
422	libsasl		\
423	libsec		\
424	libshell	\
425	libslp		\
426	libsmedia	\
427	libsqlite	\
428	libstmf		\
429	libsysevent	\
430	libtecla	\
431	libtnf		\
432	libtnfctl	\
433	libtnfprobe	\
434	libtsnet	\
435	libtsol		\
436	libvolmgt	\
437	libumem		\
438	libunistat	\
439	libuutil	\
440	libwrap		\
441	libxcurses2	\
442	libzfs		\
443	libzfs_jni	\
444	libzoneinfo	\
445	hal		\
446	policykit	\
447	lvm		\
448	openssl		\
449	pkcs11		\
450	passwdutil	\
451	../cmd/sendmail/libmilter	\
452	fm		\
453	udapl		\
454	libmapid	\
455	libkrb5		\
456	libshare	\
457	libidmap	\
458	libvscan	\
459	smbsrv		\
460	scsi		\
461	hbaapi		\
462	libima		\
463	libsun_ima	\
464	mpapi		\
465	$($(MACH)_HDRSUBDIRS)
466
467$(CLOSED_BUILD)HDRSUBDIRS += \
468	$(CLOSED)/lib/libc_i18n	\
469	$(CLOSED)/lib/libike	\
470	$(CLOSED)/lib/smartcard
471
472sparc_HDRSUBDIRS=	\
473	libds		\
474	libdscp		\
475	libpri		\
476	storage
477
478all :=		TARGET= all
479check :=	TARGET= check
480clean :=	TARGET= clean
481clobber :=	TARGET= clobber
482install :=	TARGET= install
483install_h :=	TARGET= install_h
484lint :=		TARGET= lint
485_dc :=		TARGET= _dc
486_msg :=		TARGET= _msg
487
488.KEEP_STATE:
489
490#
491# For the all and install targets, we clearly must respect library
492# dependencies so that the libraries link correctly.  However, for
493# the remaining targets (check, clean, clobber, install_h, lint, _dc
494# and _msg), libraries do not have any dependencies on one another
495# and thus respecting dependencies just slows down the build.
496# As such, for these rules, we use pattern replacement to explicitly
497# avoid triggering the dependency information.  Note that for clean,
498# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
499# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
500#
501
502all:			$(SUBDIRS)
503
504install:		$(SUBDIRS) .WAIT install_extra
505
506# extra libraries kept in other source areas
507install_extra:
508	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
509	@pwd
510
511clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
512
513install_h check:	$(HDRSUBDIRS:%=%-nodepend)
514
515_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
516
517_dc:			$(DCSUBDIRS:%=%-nodepend)
518
519# dependencies for pam_modules (see below)
520$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
521
522#
523# Library interdependencies are called out explicitly here
524#
525auditd_plugins: libbsm libnsl libsecdb
526gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
527libadt_jni:	libbsm
528$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
529libast: 	libsocket
530libbsm:		libtsol
531libcmd: 	libast libsocket libnsl
532libcmdutils:	libavl
533libcontract:	libnvpair
534libdevid:	libdevinfo
535libdevinfo:	libnvpair libsec
536libdhcpagent:	libsocket libdhcputil libuuid libdlpi
537libdhcpsvc:	libinetutil
538libdhcputil:	libnsl libgen libinetutil libdlpi
539libdladm:	libdevinfo libinetutil libsocket
540libdll: 	libast
541libdlpi:	libinetutil libdladm
542libdscfg:	libnsctl libunistat libsocket libnsl
543libdtrace:	libproc libgen libctf
544libdtrace_jni:	libuutil libdtrace
545libefi:		libuuid
546libfstyp:	libnvpair
547libelfsign:	libcryptoutil libkmf
548libidmap:	libnsl
549libinetcfg:	libnsl libsocket libdlpi
550libiscsit:	libc libnvpair libstmf libuuid libnsl
551libkmf:		libcryptoutil pkcs11 openssl
552libnsl:		libmd5 libscf
553libmapid:	libresolv
554libnwam:	libdoor
555librdc:		libsocket libnsl libnsctl libunistat libdscfg
556libuuid:	libdlpi
557libinetutil:	libsocket
558libsecdb:	libnsl
559libsasl:	libgss libsocket pkcs11 libmd
560sasl_plugins:	pkcs11 libgss libsocket libsasl
561libsctp:	libsocket
562libshell:	libast libcmd libdll libsocket libsecdb
563libsip:		libmd5
564libsmbfs:	libsocket libnsl libkrb5
565libsocket:	libnsl
566libldap5:	libsasl libsocket libnsl libmd
567libsldap:	libldap5 libtsol libnsl libc libscf libresolv
568libpool:	libnvpair libexacct
569libpp:		libast
570libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
571		libbrand libpool libscf
572libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
573libproject:	libpool libproc libsecdb
574libtsnet:	libnsl libtsol libsecdb
575libwrap:	libnsl libsocket
576libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
577		libdhcputil openssl
578libwanbootutil:	libnsl
579pam_modules:	libproject passwdutil $(SMARTCARD) smbsrv
580libscf:		libuutil libmd libgen
581libinetsvc:	libscf
582librestart:	libuutil libscf
583../cmd/sgs/libdl:	../cmd/sgs/libconv
584../cmd/sgs/libelf:	../cmd/sgs/libconv
585pkcs11:		libcryptoutil
586print:		libldap5
587udapl/udapl_tavor:	udapl/libdat
588libzfs:		libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
589libzfs_jni:	libdiskmgt libnvpair libzfs
590libzpool:	libavl libumem libnvpair
591libsec:		libavl
592brand:		libc libsocket
593libshare:	libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
594libexacct/demo:	libexacct libproject libsocket libnsl
595libtsalarm:	libpcp
596smbsrv:		libsocket libnsl libmd libxnet libpthread librt \
597		libshare libidmap pkcs11 libsqlite
598libvscan:	libscf
599scsi:		libnvpair
600mpapi:		libpthread libdevinfo libsysevent libnvpair
601
602#
603# The reason this rule checks for the existence of the
604# Makefile is that some of the directories do not exist
605# in certain situations (e.g., exportable source builds,
606# OpenSolaris).
607#
608$(SUBDIRS): FRC
609	@if [ -f $@/Makefile  ]; then \
610		cd $@; pwd; $(MAKE) $(TARGET); \
611	else \
612		true; \
613	fi
614
615$(SUBDIRS:%=%-nodepend):
616	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
617		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
618	else \
619		true; \
620	fi
621
622FRC:
623