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