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