xref: /illumos-gate/usr/src/lib/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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	gss_mechs/mech_krb5	.WAIT	\
128	krb5	.WAIT	\
129	smartcard	\
130	passwdutil	\
131	pam_modules	\
132	crypt_modules	\
133	libadt_jni	\
134	auditd_plugins	\
135	libvolmgt	\
136	libdevice	\
137	libdevid	\
138	libdhcpsvc	\
139	libc_db		\
140	libsec		\
141	libtnfprobe	\
142	libtnf		\
143	libtnfctl	\
144	libdhcpagent	\
145	libdhcpdu	\
146	libdhcputil	\
147	libipsecutil	\
148	libike		\
149	nsswitch	\
150	print		\
151	libuutil	\
152	libscf		\
153	libinetsvc	\
154	librestart	\
155	libsched	\
156	libelfsign	\
157	pkcs11		.WAIT	\
158	libpctx		.WAIT	\
159	libcpc		\
160	watchmalloc	\
161	madv		\
162	mpss		\
163	libwrap		\
164	libxcurses	\
165	libxcurses2	\
166	libxnet		\
167	libzonecfg	\
168	libzoneinfo	\
169	gss_mechs/mech_spnego	\
170	gss_mechs/mech_dummy	\
171	gss_mechs/mech_dh	\
172	rpcsec_gss	\
173	librcm		.WAIT	\
174	libcfgadm	.WAIT	\
175	libpicl		.WAIT	\
176	libpicltree	.WAIT \
177	cfgadm_plugins	\
178	libmail		\
179	lvm		\
180	libsmedia	\
181	libipp		\
182	openssl		\
183	libdiskmgt	\
184	liblgrp		\
185	libfsmgt	\
186	fm		\
187	libavl		\
188	libcmdutils	\
189	libcontract	\
190	../cmd/sendmail/libmilter	\
191	sasl_plugins	\
192	udapl		\
193	libzpool	\
194	libzfs		\
195	libzfs_jni	\
196	$($(MACH)_SUBDIRS)
197
198sparc_SUBDIRS= .WAIT	\
199	efcode		\
200	libc_psr	.WAIT	\
201	libmd5_psr	.WAIT	\
202	libprtdiag	.WAIT	\
203	libprtdiag_psr	\
204	librsc		\
205	libfruutils	.WAIT	\
206	libfru		\
207	libwrsmconf	\
208	storage		\
209	wrsm		\
210	libpcp
211
212fm: libexacct
213
214#
215# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
216# clean and clobber targets (for more information, see those targets, below).
217#
218NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
219
220DCSUBDIRS =		\
221	lvm
222
223MSGSUBDIRS=		\
224	abi		\
225	auditd_plugins	\
226	cfgadm_plugins	\
227	gss_mechs/mech_dh	\
228	gss_mechs/mech_krb5	\
229	krb5		\
230	libbsm		\
231	libc		\
232	libcfgadm	\
233	libcontract	\
234	libcurses	\
235	libdhcpsvc 	\
236	libdhcputil	\
237	libgss		\
238	libinetcfg	\
239	libipmp		\
240	libnsl		\
241	libpam		\
242	libpicl		\
243	libpool		\
244	libscf		\
245	libsasl		\
246	libldap5	\
247	libsecdb	\
248	libsldap	\
249	libslp		\
250	libsmedia	\
251	libuutil	\
252	libwanboot	\
253	libwanbootutil	\
254	libzonecfg	\
255	lvm		\
256	madv		\
257	mpss		\
258	pam_modules	\
259	rpcsec_gss	\
260	smartcard	\
261	$($(MACH)_MSGSUBDIRS)
262
263sparc_MSGSUBDIRS=	\
264	libprtdiag	\
265	libprtdiag_psr
266
267HDRSUBDIRS= libaio	\
268	auditd_plugins	\
269	libbsm		\
270	libc		\
271	libc_i18n	\
272	libcmdutils	\
273	libcontract	\
274	libcpc		\
275	libctf		\
276	libcurses	\
277	libcryptoutil	\
278	libdevice	\
279	libdevid	\
280	libdevinfo	\
281	libdiskmgt	\
282	libdladm	\
283	libdlpi		\
284	libdhcpagent	\
285	libdhcpsvc	\
286	libdhcputil	\
287	libdtrace	\
288	libeti		\
289	libgen		\
290	libwanboot	\
291	libwanbootutil	\
292	libipsecutil	\
293	libike		\
294	libinetcfg	\
295	libinetsvc	\
296	libinetutil	\
297	libipmp		\
298	libipp		\
299	libkstat	\
300	libkvm		\
301        liblaadm        \
302	libmacadm	\
303	libmail		\
304	libmtmalloc	\
305	libnvpair	\
306	libpam		\
307	libpctx		\
308	libpicl		\
309	libpicltree	\
310	libplot		\
311	libpool		\
312	libproc		\
313	librcm		\
314	libscf		\
315	libsmbios	\
316	librestart	\
317	librpcsvc	\
318	librsm		\
319	libsasl		\
320	libsec		\
321	libslp		\
322	libsmedia	\
323	libsysevent	\
324	libtecla	\
325	libtnf		\
326	libtnfctl	\
327	libtnfprobe	\
328	libvolmgt	\
329	libumem		\
330	libuutil	\
331	libwrap		\
332	libxcurses2	\
333	libzfs		\
334	libzoneinfo	\
335	lvm		\
336	openssl		\
337	pkcs11		\
338	smartcard	\
339	passwdutil	\
340	../cmd/sendmail/libmilter	\
341	fm		\
342	udapl		\
343	$($(MACH)_HDRSUBDIRS)
344
345sparc_HDRSUBDIRS=	\
346	libwrsmconf
347
348all :=		TARGET= all
349check :=	TARGET= check
350clean :=	TARGET= clean
351clobber :=	TARGET= clobber
352install :=	TARGET= install
353install_h :=	TARGET= install_h
354lint :=		TARGET= lint
355_dc :=		TARGET= _dc
356_msg :=		TARGET= _msg
357
358.KEEP_STATE:
359
360#
361# For the all and install targets, we clearly must respect library
362# dependencies so that the libraries link correctly.  However, for
363# the remaining targets (check, clean, clobber, install_h, lint, _dc
364# and _msg), libraries do not have any dependencies on one another
365# and thus respecting dependencies just slows down the build.
366# As such, for these rules, we use pattern replacement to explicitly
367# avoid triggering the dependency information.  Note that for clean,
368# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
369# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
370#
371
372all:			$(SUBDIRS)
373
374install:		$(SUBDIRS) .WAIT install_extra
375
376# extra libraries kept in other source areas
377install_extra:
378	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
379	@pwd
380
381clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
382
383install_h check:	$(HDRSUBDIRS:%=%-nodepend)
384
385_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
386
387_dc:			$(DCSUBDIRS:%=%-nodepend)
388
389#
390# Library interdependencies are called out explicitly here
391#
392auditd_plugins: libbsm libnsl libsecdb
393gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
394libadt_jni:	libbsm
395libc:		libc_i18n
396libcmdutils:	libavl
397libcontract:	libnvpair
398libdevid:	libdevinfo
399libdevinfo:	libnvpair libsec
400libdhcpagent:	libdhcputil libnsl libsocket
401libdhcpsvc:	libinetutil
402libdhcputil:	libinetutil
403libdladm:	libdlpi libdevinfo
404libdtrace:	libproc libgen libctf
405libefi:		libuuid
406libelfsign:	libike libcryptoutil pkcs11
407libinetcfg:	libnsl libsocket libdevinfo
408libnsl:		libmd5 libscf
409libmacadm:	libdevinfo
410libuuid:	libsocket
411libinetutil:	libsocket
412libsecdb:	libcmd libnsl
413librt:		libaio libmd5
414libsasl:	libgss libsocket pkcs11 libmd5
415sasl_plugins:	pkcs11 libgss libsocket libsasl
416libsctp:	libsocket
417libsocket:	libnsl
418libldap5:	libsasl libsocket libnsl libmd5
419libsldap:	libldap5
420libpool:	libnvpair libexacct
421libproject:	libpool libproc libsecdb
422libwrap:	libnsl libsocket
423libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
424		libdhcputil openssl
425libwanbootutil:	libnsl
426pam_modules:	libproject smartcard
427libscf:		libuutil
428libinetsvc:	libscf
429librestart:	libuutil libscf
430../cmd/sgs/libdl:	../cmd/sgs/libconv
431../cmd/sgs/libelf:	../cmd/sgs/libconv
432pkcs11:		libcryptoutil
433print:		libldap5
434udapl/udapl_tavor:	udapl/libdat
435libzfs:		libdevinfo libdevid libgen libnvpair libuutil
436libzfs_jni:	libdiskmgt libnvpair libzfs
437libzpool:	libavl libumem libnvpair
438
439#
440# The reason this rule checks for the existence of the
441# Makefile is that some of the directories do not exist
442# in our exportable source builds.
443#
444$(SUBDIRS) abi: FRC
445	@if [ -f $@/Makefile  ]; then \
446		cd $@; pwd; $(MAKE) $(TARGET); \
447	else \
448		true; \
449	fi
450
451$(SUBDIRS:%=%-nodepend) abi-nodepend:
452	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
453		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
454	else \
455		true; \
456	fi
457
458FRC:
459