xref: /titanic_41/usr/src/lib/Makefile (revision aa59c4cb15a6ac5d4e585dadf7a055b580abf579)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
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
48#
49# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
50# but required due to the "dependencies" of using .WAIT to barrier the
51# parallel dmake builds.  once 4631488 has been fixed, they can be
52# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
53# shown in HDRSUBDIRS
54#
55SUBDIRS= \
56	common			.WAIT	\
57	../cmd/sgs/libconv		\
58	../cmd/sgs/libdl	.WAIT
59
60$(CLOSED_BUILD)SUBDIRS += \
61	$(CLOSED)/lib/libc_i18n
62
63SUBDIRS += \
64	libc			.WAIT	\
65	../cmd/sgs/libelf	.WAIT	\
66	libmd				\
67	libmd5				\
68	librsm				\
69	libmp			.WAIT	\
70	libnsl			\
71	libsecdb		.WAIT	\
72	librpcsvc			\
73	libsocket		.WAIT	\
74	libsctp			\
75	libsip			\
76	libresolv			\
77	libresolv2		.WAIT	\
78	libw			.WAIT	\
79	libintl			.WAIT	\
80	../cmd/sgs/librtld_db	\
81	libaio			\
82	librt			\
83	libadm			\
84	libctf			\
85	libdtrace		\
86	libdtrace_jni		\
87	libcurses		\
88	libgen			\
89	libgss			\
90	libpam			\
91	libuuid			\
92	libthread		\
93	libpthread	.WAIT	\
94	libslp		\
95	libbsdmalloc	\
96	libcmd		\
97	libdoor		\
98	libdevinfo	\
99	libdladm	\
100	libdlpi		\
101	libeti		\
102	libcrypt	\
103	libefi		\
104	libfstyp	\
105	libwanboot	\
106	libwanbootutil	\
107	libcryptoutil	\
108	libinetcfg	\
109	libinetutil	\
110	libipmp		\
111	libiscsitgt	\
112	libkmf		\
113	libkstat	\
114	libkvm		\
115	liblm		\
116	libmalloc	\
117	libmapmalloc	\
118	libmtmalloc	\
119	libnls		\
120	libsmbios	\
121	libtecla	\
122	libumem		\
123	libnvpair	.WAIT	\
124	libexacct	\
125	libplot		\
126	libldap4	\
127	libsasl		\
128	libldap5	\
129	libsldap	.WAIT	\
130	libbsm		\
131	libsys		\
132	libsysevent	\
133	libnisdb	\
134	libpool		\
135	libproc		\
136	libproject	\
137	libsendfile	\
138	nametoaddr	\
139	ncad_addr	\
140	gss_mechs/mech_krb5	.WAIT	\
141	libkrb5	.WAIT	\
142	krb5	.WAIT
143$(CLOSED_BUILD)SUBDIRS += \
144	$(CLOSED)/lib/smartcard
145SUBDIRS += \
146	passwdutil	\
147	pam_modules	\
148	crypt_modules	\
149	libadt_jni	\
150	abi		\
151	auditd_plugins	\
152	libvolmgt	\
153	libdevice	\
154	libdevid	\
155	libdhcpsvc	\
156	libc_db		\
157	libsec		\
158	libtnfprobe	\
159	libtnf		\
160	libtnfctl	\
161	libdhcpagent	\
162	libdhcpdu	\
163	libdhcputil	\
164	libipsecutil
165$(CLOSED_BUILD)SUBDIRS += \
166	$(CLOSED)/lib/libike
167SUBDIRS += \
168	nsswitch	\
169	print		\
170	libuutil	\
171	libscf		\
172	libinetsvc	\
173	librestart	\
174	libsched
175$(CLOSED_BUILD)SUBDIRS += \
176	$(CLOSED)/lib/libelfsign
177SUBDIRS += \
178	pkcs11		.WAIT	\
179	libpctx		.WAIT	\
180	libcpc		\
181	watchmalloc	\
182	extendedFILE	\
183	madv		\
184	mpss		\
185	libdisasm	\
186	libwrap		\
187	libxcurses	\
188	libxcurses2	\
189	libxnet		\
190	libbrand	.WAIT   \
191	libzonecfg	\
192	libzoneinfo	\
193	libtsnet	\
194	libtsol		\
195	gss_mechs/mech_spnego	\
196	gss_mechs/mech_dummy	\
197	gss_mechs/mech_dh	\
198	rpcsec_gss	\
199	libraidcfg	.WAIT	\
200	librcm		.WAIT	\
201	libcfgadm	.WAIT	\
202	libpicl		.WAIT	\
203	libpicltree	.WAIT \
204	raidcfg_plugins	\
205	cfgadm_plugins	\
206	libmail		\
207	lvm		\
208	libsmedia	\
209	libipp		\
210	openssl		\
211	libdiskmgt	\
212	liblgrp		\
213	libfsmgt	\
214	fm		\
215	libavl		\
216	libcmdutils	\
217	libcontract	\
218	../cmd/sendmail/libmilter	\
219	sasl_plugins	\
220	udapl		\
221	libzpool	\
222	libzfs		\
223	libzfs_jni	\
224	libmapid	\
225	brand		\
226	policykit	\
227	hal		\
228	libshare	\
229	libipmi		\
230	$($(MACH)_SUBDIRS)
231
232sparc_SUBDIRS= .WAIT	\
233	efcode		\
234	libc_psr	.WAIT	\
235	libdscp		\
236	libprtdiag	.WAIT	\
237	libprtdiag_psr	\
238	libpri		\
239	librsc		\
240	libfruutils	.WAIT	\
241	libfru		\
242	libwrsmconf	\
243	storage		\
244	wrsm		\
245	libpcp
246
247FM_sparc_DEPLIBS= libpri
248
249fm: libexacct $(FM_$(MACH)_DEPLIBS)
250
251#
252# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
253# clean and clobber targets (for more information, see those targets, below).
254#
255NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
256
257DCSUBDIRS =		\
258	lvm
259
260MSGSUBDIRS=		\
261	abi		\
262	auditd_plugins	\
263	brand		\
264	cfgadm_plugins	\
265	gss_mechs/mech_dh	\
266	gss_mechs/mech_krb5	\
267	krb5		\
268	libbsm		\
269	libc		\
270	libcfgadm	\
271	libcontract	\
272	libcurses	\
273	libdhcpsvc 	\
274	libdhcputil	\
275	libdladm	\
276	libgss		\
277	libinetcfg	\
278	libipmp		\
279	libnsl		\
280	libpam		\
281	libpicl		\
282	libpool		\
283	libscf		\
284	libsasl		\
285	libldap5	\
286	libsecdb	\
287	libshare	\
288	libsldap	\
289	libslp		\
290	libsmedia	\
291	libtsol		\
292	libuutil	\
293	libwanboot	\
294	libwanbootutil	\
295	libzfs		\
296	libzonecfg	\
297	lvm		\
298	madv		\
299	mpss		\
300	pam_modules	\
301	rpcsec_gss
302$(CLOSED_BUILD)MSGSUBDIRS += \
303	$(CLOSED)/lib/smartcard
304MSGSUBDIRS += \
305	$($(MACH)_MSGSUBDIRS)
306
307sparc_MSGSUBDIRS=	\
308	libprtdiag	\
309	libprtdiag_psr
310
311HDRSUBDIRS=		\
312	auditd_plugins	\
313	libbrand	\
314	libbsm		\
315	libc		\
316	libcmdutils	\
317	libcontract	\
318	libcpc		\
319	libctf		\
320	libcurses	\
321	libcryptoutil	\
322	libdevice	\
323	libdevid	\
324	libdevinfo	\
325	libdiskmgt	\
326	libdladm	\
327	libdlpi		\
328	libdhcpagent	\
329	libdhcpsvc	\
330	libdhcputil	\
331	libdisasm	\
332	libdtrace	\
333	libdtrace_jni	\
334	libeti		\
335	libfstyp	\
336	libgen		\
337	libwanboot	\
338	libwanbootutil	\
339	libipsecutil	\
340	libinetcfg	\
341	libinetsvc	\
342	libinetutil	\
343	libipmi		\
344	libipmp		\
345	libipp		\
346	libiscsitgt	\
347	libkstat	\
348	libkvm		\
349	libmail		\
350	libmd		\
351	libmtmalloc	\
352	libnvpair	\
353	libnsl		\
354	libpam		\
355	libpctx		\
356	libpicl		\
357	libpicltree	\
358	libplot		\
359	libpool		\
360	libproc		\
361	libraidcfg	\
362	librcm		\
363	libscf		\
364	libsip		\
365	libsmbios	\
366	librestart	\
367	librpcsvc	\
368	librsm		\
369	libsasl		\
370	libsec		\
371	libslp		\
372	libsmedia	\
373	libsysevent	\
374	libtecla	\
375	libtnf		\
376	libtnfctl	\
377	libtnfprobe	\
378	libtsnet	\
379	libtsol		\
380	libvolmgt	\
381	libumem		\
382	libuutil	\
383	libwrap		\
384	libxcurses2	\
385	libzfs		\
386	libzfs_jni	\
387	libzoneinfo	\
388	hal		\
389	policykit	\
390	lvm		\
391	openssl		\
392	pkcs11		\
393	passwdutil	\
394	../cmd/sendmail/libmilter	\
395	fm		\
396	udapl		\
397	libmapid	\
398	libkrb5		\
399	libshare	\
400	$($(MACH)_HDRSUBDIRS)
401
402$(CLOSED_BUILD)HDRSUBDIRS += \
403	$(CLOSED)/lib/libc_i18n	\
404	$(CLOSED)/lib/libike	\
405	$(CLOSED)/lib/smartcard
406
407sparc_HDRSUBDIRS=	\
408	libdscp		\
409	libpri		\
410	libwrsmconf
411
412all :=		TARGET= all
413check :=	TARGET= check
414clean :=	TARGET= clean
415clobber :=	TARGET= clobber
416install :=	TARGET= install
417install_h :=	TARGET= install_h
418lint :=		TARGET= lint
419_dc :=		TARGET= _dc
420_msg :=		TARGET= _msg
421
422.KEEP_STATE:
423
424#
425# For the all and install targets, we clearly must respect library
426# dependencies so that the libraries link correctly.  However, for
427# the remaining targets (check, clean, clobber, install_h, lint, _dc
428# and _msg), libraries do not have any dependencies on one another
429# and thus respecting dependencies just slows down the build.
430# As such, for these rules, we use pattern replacement to explicitly
431# avoid triggering the dependency information.  Note that for clean,
432# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
433# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
434#
435
436all:			$(SUBDIRS)
437
438install:		$(SUBDIRS) .WAIT install_extra
439
440# extra libraries kept in other source areas
441install_extra:
442	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
443	@pwd
444
445clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
446
447install_h check:	$(HDRSUBDIRS:%=%-nodepend)
448
449_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
450
451_dc:			$(DCSUBDIRS:%=%-nodepend)
452
453# dependencies for pam_modules (see below)
454$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
455
456#
457# Library interdependencies are called out explicitly here
458#
459auditd_plugins: libbsm libnsl libsecdb
460gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
461libadt_jni:	libbsm
462$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
463libbsm:		libtsol
464libcmdutils:	libavl
465libcontract:	libnvpair
466libdevid:	libdevinfo
467libdevinfo:	libnvpair libsec
468libdhcpagent:	libsocket libdhcputil libuuid libdlpi
469libdhcpsvc:	libinetutil
470libdhcputil:	libnsl libgen libinetutil libdlpi
471libdladm:	libdlpi libdevinfo libinetutil libsocket
472libdlpi:	libinetutil
473libdtrace:	libproc libgen libctf
474libdtrace_jni:	libuutil libdtrace
475libefi:		libuuid
476libfstyp:	libnvpair
477$(CLOSED_BUILD)$(CLOSED)/lib/libelfsign: \
478			$(CLOSED)/lib/libike libcryptoutil pkcs11
479libinetcfg:	libnsl libsocket libdevinfo
480libkmf:		libcryptoutil pkcs11 openssl
481libnsl:		libmd5 libscf
482libmapid:	libresolv
483libuuid:	libsocket
484libinetutil:	libsocket
485libsecdb:	libnsl
486libsasl:	libgss libsocket pkcs11 libmd
487sasl_plugins:	pkcs11 libgss libsocket libsasl
488libsctp:	libsocket
489libsip:		libmd5
490libsocket:	libnsl
491libldap5:	libsasl libsocket libnsl libmd
492libsldap:	libldap5 libtsol
493libpool:	libnvpair libexacct
494libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
495		libbrand libpool libscf
496libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
497libproject:	libpool libproc libsecdb
498libtsnet:	libnsl libtsol libsecdb
499libwrap:	libnsl libsocket
500libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
501		libdhcputil openssl
502libwanbootutil:	libnsl
503pam_modules:	libproject passwdutil $(SMARTCARD)
504libscf:		libuutil libmd
505libinetsvc:	libscf
506librestart:	libuutil libscf
507../cmd/sgs/libdl:	../cmd/sgs/libconv
508../cmd/sgs/libelf:	../cmd/sgs/libconv
509pkcs11:		libcryptoutil
510print:		libldap5
511udapl/udapl_tavor:	udapl/libdat
512libzfs:		libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
513libzfs_jni:	libdiskmgt libnvpair libzfs
514libzpool:	libavl libumem libnvpair
515libsec:		libavl
516brand:		libc libsocket
517libshare:	libscf libzfs libuuid libfsmgt libsecdb
518
519#
520# The reason this rule checks for the existence of the
521# Makefile is that some of the directories do not exist
522# in certain situations (e.g., exportable source builds,
523# OpenSolaris).
524#
525$(SUBDIRS): FRC
526	@if [ -f $@/Makefile  ]; then \
527		cd $@; pwd; $(MAKE) $(TARGET); \
528	else \
529		true; \
530	fi
531
532$(SUBDIRS:%=%-nodepend):
533	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
534		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
535	else \
536		true; \
537	fi
538
539FRC:
540