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