xref: /titanic_51/usr/src/lib/Makefile (revision 3d09a4fec6be19a6f09e277d5d5d17942bb4abf4)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#
26
27include ../Makefile.master
28
29#	Note that libcurses installs commands along with its library.
30#	This is a minor bug which probably should be fixed.
31#	Note also that a few extra libraries are kept in cmd source.
32#
33# Certain libraries are linked with, hence depend on, other libraries.
34#
35# Although we have historically used .WAIT to express dependencies, it
36# reduces the amount of parallelism and thus lengthens the time it
37# takes to build the libraries.  Thus, we now require that any new
38# libraries explicitly call out their dependencies.  Eventually, all
39# the library dependencies will be called out explicitly.  See
40# "Library interdependencies" near the end of this file.
41#
42# Aside from explicit dependencies (and legacy .WAITs), all libraries
43# are built in parallel.
44#
45.PARALLEL:
46
47#
48# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
49# but required due to the "dependencies" of using .WAIT to barrier the
50# parallel dmake builds.  once 4631488 has been fixed, they can be
51# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
52# shown in HDRSUBDIRS
53#
54SUBDIRS= \
55	common			.WAIT	\
56	../cmd/sgs/libconv		\
57	../cmd/sgs/libdl	.WAIT
58
59$(CLOSED_BUILD)SUBDIRS += \
60	$(CLOSED)/lib/libc_i18n
61
62SUBDIRS += \
63	libc			.WAIT	\
64	../cmd/sgs/libelf	.WAIT	\
65	c_synonyms			\
66	libmd				\
67	libmd5				\
68	librsm				\
69	libmp			.WAIT	\
70	libnsl			\
71	libsecdb		.WAIT	\
72	librpcsvc			\
73	libsocket		.WAIT	\
74	libsctp			\
75	libsip			\
76	libcommputil		\
77	libresolv			\
78	libresolv2		.WAIT	\
79	libw			.WAIT	\
80	libintl			.WAIT	\
81	../cmd/sgs/librtld_db	\
82	libaio			\
83	libast			\
84	libdll			\
85	libcmd			\
86	libshell		\
87	libsum			\
88	librt			\
89	libadm			\
90	libctf			\
91	libdtrace		\
92	libdtrace_jni		\
93	libcurses		\
94	libgen			\
95	libgss			\
96	libpam			\
97	libuuid			\
98	libthread		\
99	libpthread	.WAIT	\
100	libslp		\
101	libbsdmalloc	\
102	libdoor		\
103	libdevinfo	\
104	libdladm	\
105	libdlpi		\
106	libeti		\
107	libcrypt	\
108	libdns_sd	\
109	libefi		\
110	libfstyp	\
111	libwanboot	\
112	libwanbootutil	\
113	libcryptoutil	\
114	libinetcfg	\
115	libinetutil	\
116	libipmp		\
117	libiscsit	\
118	libiscsitgt	\
119	libkmf		\
120	libkstat	\
121	libkvm		\
122	liblm		\
123	libmalloc	\
124	libmapmalloc	\
125	libmtmalloc	\
126	libnls		\
127	libnwam		\
128	libsmbios	\
129	libtecla	\
130	libumem		\
131	libnvpair	.WAIT	\
132	libexacct	\
133	libplot		\
134	libldap4	\
135	libsasl		\
136	libldap5	\
137	libsldap	.WAIT	\
138	libbsm		\
139	libsys		\
140	libsysevent	\
141	libnisdb	\
142	libpool		\
143	libpp		\
144	libproc		\
145	libproject	\
146	libsendfile	\
147	nametoaddr	\
148	ncad_addr	\
149	hbaapi		\
150	sun_fc		\
151	gss_mechs/mech_krb5	.WAIT	\
152	libkrb5	.WAIT	\
153	krb5	.WAIT	\
154	libsmbfs	\
155	libfcoe		\
156	libstmf		\
157	libnsctl	\
158	libunistat	\
159	libdscfg	\
160	librdc
161$(CLOSED_BUILD)SUBDIRS += \
162	$(CLOSED)/lib/smartcard
163SUBDIRS += \
164	passwdutil	\
165	pam_modules	\
166	crypt_modules	\
167	libadt_jni	\
168	abi		\
169	auditd_plugins	\
170	libvolmgt	\
171	libdevice	\
172	libdevid	\
173	libdhcpsvc	\
174	libc_db		\
175	libndmp		\
176	libsec		\
177	libtnfprobe	\
178	libtnf		\
179	libtnfctl	\
180	libdhcpagent	\
181	libdhcpdu	\
182	libdhcputil	\
183	libipsecutil
184$(CLOSED_BUILD)SUBDIRS += \
185	$(CLOSED)/lib/libike
186SUBDIRS += \
187	nsswitch	\
188	print		\
189	libuutil	\
190	libscf		\
191	libinetsvc	\
192	librestart	\
193	libsched	\
194	libelfsign	\
195	pkcs11		.WAIT	\
196	libpctx		.WAIT	\
197	libcpc		\
198	watchmalloc	\
199	extendedFILE	\
200	madv		\
201	mpss		\
202	libdisasm	\
203	libwrap		\
204	libxcurses	\
205	libxcurses2	\
206	libxnet		\
207	libbrand	.WAIT   \
208	libzonecfg	\
209	libzoneinfo	\
210	libtsnet	\
211	libtsol		\
212	gss_mechs/mech_spnego	\
213	gss_mechs/mech_dummy	\
214	gss_mechs/mech_dh	\
215	rpcsec_gss	\
216	libraidcfg	.WAIT	\
217	librcm		.WAIT	\
218	libcfgadm	.WAIT	\
219	libpicl		.WAIT	\
220	libpicltree	.WAIT \
221	raidcfg_plugins	\
222	cfgadm_plugins	\
223	libmail		\
224	lvm		\
225	libsmedia	\
226	libipp		\
227	openssl		\
228	libdiskmgt	\
229	liblgrp		\
230	libfsmgt	\
231	fm		\
232	libavl		\
233	libcmdutils	\
234	libcontract	\
235	../cmd/sendmail/libmilter	\
236	sasl_plugins	\
237	udapl		\
238	libzpool	\
239	libzfs		\
240	libzfs_jni	\
241	libmapid	\
242	brand		\
243	policykit	\
244	hal		\
245	libshare	\
246	libsqlite	\
247	libidmap	\
248	libadutils	\
249	libipmi		\
250	libexacct/demo	\
251	libvscan	\
252	smbsrv		\
253	scsi		\
254	mms		\
255	libima		\
256	libsun_ima	\
257	mpapi		\
258	$($(MACH)_SUBDIRS)
259
260sparc_SUBDIRS= .WAIT	\
261	efcode		\
262	libc_psr	.WAIT	\
263	libds		\
264	libdscp		\
265	libprtdiag	.WAIT	\
266	libprtdiag_psr	\
267	libpri		\
268	librsc		\
269	libfruutils	.WAIT	\
270	libfru		\
271	storage		\
272	libpcp		\
273	libtsalarm
274
275FM_sparc_DEPLIBS= libpri
276
277fm:			\
278	libexacct	\
279	libipmi		\
280	libzfs		\
281	scsi		\
282	$(FM_$(MACH)_DEPLIBS)
283
284#
285# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
286# clean and clobber targets (for more information, see those targets, below).
287#
288NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
289
290DCSUBDIRS =		\
291	lvm
292
293MSGSUBDIRS=		\
294	abi		\
295	auditd_plugins	\
296	brand		\
297	cfgadm_plugins	\
298	gss_mechs/mech_dh	\
299	gss_mechs/mech_krb5	\
300	krb5		\
301	libast		\
302	libbsm		\
303	libc		\
304	libcfgadm	\
305	libcmd		\
306	libcontract	\
307	libcurses	\
308	libdhcpsvc 	\
309	libdhcputil	\
310	libipsecutil	\
311	libdiskmgt	\
312	libdladm	\
313	libdll		\
314	libgss		\
315	libidmap	\
316	libinetcfg	\
317	libipmp		\
318	libinetutil	\
319	libnsl		\
320	libpam		\
321	libpicl		\
322	libpool		\
323	libpp		\
324	libscf		\
325	libsasl		\
326	libldap5	\
327	libsecdb	\
328	libshare	\
329	libshell	\
330	libsldap	\
331	libslp		\
332	libsmbfs	\
333	libsmedia	\
334	libsum		\
335	libtsol		\
336	libuutil	\
337	libvscan	\
338	libwanboot	\
339	libwanbootutil	\
340	libzfs		\
341	libzonecfg	\
342	lvm		\
343	madv		\
344	mms		\
345	mpss		\
346	pam_modules	\
347	rpcsec_gss
348$(CLOSED_BUILD)MSGSUBDIRS += \
349	$(CLOSED)/lib/smartcard
350MSGSUBDIRS += \
351	$($(MACH)_MSGSUBDIRS)
352
353sparc_MSGSUBDIRS=	\
354	libprtdiag	\
355	libprtdiag_psr
356
357HDRSUBDIRS=		\
358	auditd_plugins	\
359	libast		\
360	libbrand	\
361	libbsm		\
362	libc		\
363	libcmd		\
364	libcmdutils	\
365	libcontract	\
366	libcpc		\
367	libctf		\
368	libcurses	\
369	libcryptoutil	\
370	libdevice	\
371	libdevid	\
372	libdevinfo	\
373	libdiskmgt	\
374	libdladm	\
375	libdll		\
376	libdlpi		\
377	libdhcpagent	\
378	libdhcpsvc	\
379	libdhcputil	\
380	libdisasm	\
381	libdns_sd	\
382	libdscfg	\
383	libdtrace	\
384	libdtrace_jni	\
385	libelfsign	\
386	libeti		\
387	libfstyp	\
388	libgen		\
389	libwanboot	\
390	libwanbootutil	\
391	libipsecutil	\
392	libinetcfg	\
393	libinetsvc	\
394	libinetutil	\
395	libipmi		\
396	libipmp		\
397	libipp		\
398	libiscsit	\
399	libiscsitgt	\
400	libkstat	\
401	libkvm		\
402	libmail		\
403	libmd		\
404	libmtmalloc	\
405	libndmp		\
406	libnvpair	\
407	libnsctl	\
408	libnsl		\
409	libnwam		\
410	libpam		\
411	libpctx		\
412	libpicl		\
413	libpicltree	\
414	libplot		\
415	libpool		\
416	libpp		\
417	libproc		\
418	libraidcfg	\
419	librcm		\
420	librdc		\
421	libscf		\
422	libsip		\
423	libcommputil	\
424	libsmbios	\
425	librestart	\
426	librpcsvc	\
427	librsm		\
428	libsasl		\
429	libsec		\
430	libshell	\
431	libslp		\
432	libsmedia	\
433	libsqlite	\
434	libfcoe		\
435	libstmf		\
436	libsum		\
437	libsysevent	\
438	libtecla	\
439	libtnf		\
440	libtnfctl	\
441	libtnfprobe	\
442	libtsnet	\
443	libtsol		\
444	libvolmgt	\
445	libumem		\
446	libunistat	\
447	libuutil	\
448	libwrap		\
449	libxcurses2	\
450	libzfs		\
451	libzfs_jni	\
452	libzoneinfo	\
453	hal		\
454	policykit	\
455	lvm		\
456	openssl		\
457	pkcs11		\
458	passwdutil	\
459	../cmd/sendmail/libmilter	\
460	fm		\
461	udapl		\
462	libmapid	\
463	libkrb5		\
464	libshare	\
465	libidmap	\
466	libvscan	\
467	smbsrv		\
468	scsi		\
469	hbaapi		\
470	libima		\
471	libsun_ima	\
472	mpapi		\
473	mms		\
474	$($(MACH)_HDRSUBDIRS)
475
476$(CLOSED_BUILD)HDRSUBDIRS += \
477	$(CLOSED)/lib/libc_i18n	\
478	$(CLOSED)/lib/libike	\
479	$(CLOSED)/lib/smartcard
480
481sparc_HDRSUBDIRS=	\
482	libds		\
483	libdscp		\
484	libpri		\
485	storage
486
487all :=		TARGET= all
488check :=	TARGET= check
489clean :=	TARGET= clean
490clobber :=	TARGET= clobber
491install :=	TARGET= install
492install_h :=	TARGET= install_h
493lint :=		TARGET= lint
494_dc :=		TARGET= _dc
495_msg :=		TARGET= _msg
496
497.KEEP_STATE:
498
499#
500# For the all and install targets, we clearly must respect library
501# dependencies so that the libraries link correctly.  However, for
502# the remaining targets (check, clean, clobber, install_h, lint, _dc
503# and _msg), libraries do not have any dependencies on one another
504# and thus respecting dependencies just slows down the build.
505# As such, for these rules, we use pattern replacement to explicitly
506# avoid triggering the dependency information.  Note that for clean,
507# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
508# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
509#
510
511all:			$(SUBDIRS)
512
513install:		$(SUBDIRS) .WAIT install_extra
514
515# extra libraries kept in other source areas
516install_extra:
517	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
518	@pwd
519
520clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
521
522install_h check:	$(HDRSUBDIRS:%=%-nodepend)
523
524_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
525
526_dc:			$(DCSUBDIRS:%=%-nodepend)
527
528# dependencies for pam_modules (see below)
529$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
530
531#
532# Library interdependencies are called out explicitly here
533#
534auditd_plugins: libbsm libnsl libsecdb
535gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
536libadt_jni:	libbsm
537$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
538libast: 	libsocket
539libadutils: 	libldap5 libresolv libsocket libnsl
540nsswitch:	libadutils libidmap
541libbsm:		libtsol
542libcmd: 	libsum libast libsocket libnsl
543libcmdutils:	libavl
544libcontract:	libnvpair
545libdevid:	libdevinfo
546libdevinfo:	libnvpair libsec
547libdhcpagent:	libsocket libdhcputil libuuid libdlpi
548libdhcpsvc:	libinetutil
549libdhcputil:	libnsl libgen libinetutil libdlpi
550libdladm:	libdevinfo libinetutil libsocket libscf librcm libnvpair \
551		libexacct libnsl libkstat libcurses
552libdll: 	libast
553libdlpi:	libinetutil libdladm
554libdscfg:	libnsctl libunistat libsocket libnsl
555libdtrace:	libproc libgen libctf
556libdtrace_jni:	libuutil libdtrace
557libefi:		libuuid
558libfstyp:	libnvpair
559libelfsign:	libcryptoutil libkmf
560libidmap:	libadutils libldap5 libavl libsldap
561libinetcfg:	libnsl libsocket libdlpi
562libiscsit:	libc libnvpair libstmf libuuid libnsl
563libkmf:		libcryptoutil pkcs11 openssl
564libnsl:		libmd5 libscf
565libmapid:	libresolv
566libnwam:	libdoor
567librdc:		libsocket libnsl libnsctl libunistat libdscfg
568libuuid:	libdlpi
569libinetutil:	libsocket
570libsecdb:	libnsl
571libsasl:	libgss libsocket pkcs11 libmd
572sasl_plugins:	pkcs11 libgss libsocket libsasl
573libsctp:	libsocket
574libshell:	libast libcmd libdll libsocket libsecdb
575libsip:		libmd5
576libsmbfs:	libsocket libnsl libkrb5
577libsocket:	libnsl
578libsum: 	libast
579libldap5:	libsasl libsocket libnsl libmd
580libsldap:	libldap5 libtsol libnsl libc libscf libresolv
581libpool:	libnvpair libexacct
582libpp:		libast
583libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
584		libbrand libpool libscf
585libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
586libproject:	libpool libproc libsecdb
587libtsnet:	libnsl libtsol libsecdb
588libwrap:	libnsl libsocket
589libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
590		libdhcputil openssl
591libwanbootutil:	libnsl
592pam_modules:	libproject passwdutil $(SMARTCARD) smbsrv
593libscf:		libuutil libmd libgen
594libinetsvc:	libscf
595librestart:	libuutil libscf
596../cmd/sgs/libdl:	../cmd/sgs/libconv
597../cmd/sgs/libelf:	../cmd/sgs/libconv
598pkcs11:		libcryptoutil
599print:		libldap5
600udapl/udapl_tavor:	udapl/libdat
601libzfs:		libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
602libzfs_jni:	libdiskmgt libnvpair libzfs
603libzpool:	libavl libumem libnvpair
604libsec:		libavl libidmap
605brand:		libc libsocket
606libshare:	libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
607libexacct/demo:	libexacct libproject libsocket libnsl
608libtsalarm:	libpcp
609smbsrv:		libsocket libnsl libmd libxnet libpthread librt \
610		libshare libidmap pkcs11 libsqlite
611libvscan:	libscf
612scsi:		libnvpair
613mpapi:		libpthread libdevinfo libsysevent libnvpair
614
615#
616# The reason this rule checks for the existence of the
617# Makefile is that some of the directories do not exist
618# in certain situations (e.g., exportable source builds,
619# OpenSolaris).
620#
621$(SUBDIRS): FRC
622	@if [ -f $@/Makefile  ]; then \
623		cd $@; pwd; $(MAKE) $(TARGET); \
624	else \
625		true; \
626	fi
627
628$(SUBDIRS:%=%-nodepend):
629	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
630		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
631	else \
632		true; \
633	fi
634
635FRC:
636