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