xref: /illumos-gate/usr/src/lib/Makefile (revision 088e9d477eee66081e407fbc5a33c4da25f66f6a)
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	libzfs_jni	\
335	libzoneinfo	\
336	lvm		\
337	openssl		\
338	pkcs11		\
339	smartcard	\
340	passwdutil	\
341	../cmd/sendmail/libmilter	\
342	fm		\
343	udapl		\
344	$($(MACH)_HDRSUBDIRS)
345
346sparc_HDRSUBDIRS=	\
347	libwrsmconf
348
349all :=		TARGET= all
350check :=	TARGET= check
351clean :=	TARGET= clean
352clobber :=	TARGET= clobber
353install :=	TARGET= install
354install_h :=	TARGET= install_h
355lint :=		TARGET= lint
356_dc :=		TARGET= _dc
357_msg :=		TARGET= _msg
358
359.KEEP_STATE:
360
361#
362# For the all and install targets, we clearly must respect library
363# dependencies so that the libraries link correctly.  However, for
364# the remaining targets (check, clean, clobber, install_h, lint, _dc
365# and _msg), libraries do not have any dependencies on one another
366# and thus respecting dependencies just slows down the build.
367# As such, for these rules, we use pattern replacement to explicitly
368# avoid triggering the dependency information.  Note that for clean,
369# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
370# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
371#
372
373all:			$(SUBDIRS)
374
375install:		$(SUBDIRS) .WAIT install_extra
376
377# extra libraries kept in other source areas
378install_extra:
379	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
380	@pwd
381
382clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
383
384install_h check:	$(HDRSUBDIRS:%=%-nodepend)
385
386_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
387
388_dc:			$(DCSUBDIRS:%=%-nodepend)
389
390#
391# Library interdependencies are called out explicitly here
392#
393auditd_plugins: libbsm libnsl libsecdb
394gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
395libadt_jni:	libbsm
396libc:		libc_i18n
397libcmdutils:	libavl
398libcontract:	libnvpair
399libdevid:	libdevinfo
400libdevinfo:	libnvpair libsec
401libdhcpagent:	libdhcputil libnsl libsocket
402libdhcpsvc:	libinetutil
403libdhcputil:	libinetutil
404libdladm:	libdlpi libdevinfo
405libdtrace:	libproc libgen libctf
406libefi:		libuuid
407libelfsign:	libike libcryptoutil pkcs11
408libinetcfg:	libnsl libsocket libdevinfo
409libnsl:		libmd5 libscf
410libmacadm:	libdevinfo
411libuuid:	libsocket
412libinetutil:	libsocket
413libsecdb:	libcmd libnsl
414librt:		libaio libmd5
415libsasl:	libgss libsocket pkcs11 libmd5
416sasl_plugins:	pkcs11 libgss libsocket libsasl
417libsctp:	libsocket
418libsocket:	libnsl
419libldap5:	libsasl libsocket libnsl libmd5
420libsldap:	libldap5
421libpool:	libnvpair libexacct
422libproject:	libpool libproc libsecdb
423libwrap:	libnsl libsocket
424libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
425		libdhcputil openssl
426libwanbootutil:	libnsl
427pam_modules:	libproject smartcard
428libscf:		libuutil
429libinetsvc:	libscf
430librestart:	libuutil libscf
431../cmd/sgs/libdl:	../cmd/sgs/libconv
432../cmd/sgs/libelf:	../cmd/sgs/libconv
433pkcs11:		libcryptoutil
434print:		libldap5
435udapl/udapl_tavor:	udapl/libdat
436libzfs:		libdevinfo libdevid libgen libnvpair libuutil
437libzfs_jni:	libdiskmgt libnvpair libzfs
438libzpool:	libavl libumem libnvpair
439
440#
441# The reason this rule checks for the existence of the
442# Makefile is that some of the directories do not exist
443# in our exportable source builds.
444#
445$(SUBDIRS) abi: FRC
446	@if [ -f $@/Makefile  ]; then \
447		cd $@; pwd; $(MAKE) $(TARGET); \
448	else \
449		true; \
450	fi
451
452$(SUBDIRS:%=%-nodepend) abi-nodepend:
453	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
454		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
455	else \
456		true; \
457	fi
458
459FRC:
460