xref: /titanic_50/usr/src/lib/Makefile (revision d00d0b26c4591469742c6f5e781603b0d18de013)
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	libstmf		\
156	libnsctl	\
157	libunistat	\
158	libdscfg	\
159	librdc
160$(CLOSED_BUILD)SUBDIRS += \
161	$(CLOSED)/lib/smartcard
162SUBDIRS += \
163	passwdutil	\
164	pam_modules	\
165	crypt_modules	\
166	libadt_jni	\
167	abi		\
168	auditd_plugins	\
169	libvolmgt	\
170	libdevice	\
171	libdevid	\
172	libdhcpsvc	\
173	libc_db		\
174	libndmp		\
175	libsec		\
176	libtnfprobe	\
177	libtnf		\
178	libtnfctl	\
179	libdhcpagent	\
180	libdhcpdu	\
181	libdhcputil	\
182	libipsecutil
183$(CLOSED_BUILD)SUBDIRS += \
184	$(CLOSED)/lib/libike
185SUBDIRS += \
186	nsswitch	\
187	print		\
188	libuutil	\
189	libscf		\
190	libinetsvc	\
191	librestart	\
192	libsched	\
193	libelfsign	\
194	pkcs11		.WAIT	\
195	libpctx		.WAIT	\
196	libcpc		\
197	watchmalloc	\
198	extendedFILE	\
199	madv		\
200	mpss		\
201	libdisasm	\
202	libwrap		\
203	libxcurses	\
204	libxcurses2	\
205	libxnet		\
206	libbrand	.WAIT   \
207	libzonecfg	\
208	libzoneinfo	\
209	libtsnet	\
210	libtsol		\
211	gss_mechs/mech_spnego	\
212	gss_mechs/mech_dummy	\
213	gss_mechs/mech_dh	\
214	rpcsec_gss	\
215	libraidcfg	.WAIT	\
216	librcm		.WAIT	\
217	libcfgadm	.WAIT	\
218	libpicl		.WAIT	\
219	libpicltree	.WAIT \
220	raidcfg_plugins	\
221	cfgadm_plugins	\
222	libmail		\
223	lvm		\
224	libsmedia	\
225	libipp		\
226	openssl		\
227	libdiskmgt	\
228	liblgrp		\
229	libfsmgt	\
230	fm		\
231	libavl		\
232	libcmdutils	\
233	libcontract	\
234	../cmd/sendmail/libmilter	\
235	sasl_plugins	\
236	udapl		\
237	libzpool	\
238	libzfs		\
239	libzfs_jni	\
240	libmapid	\
241	brand		\
242	policykit	\
243	hal		\
244	libshare	\
245	libsqlite	\
246	libidmap	\
247	libadutils	\
248	libipmi		\
249	libexacct/demo	\
250	libvscan	\
251	smbsrv		\
252	scsi		\
253	mms		\
254	libima		\
255	libsun_ima	\
256	mpapi		\
257	$($(MACH)_SUBDIRS)
258
259sparc_SUBDIRS= .WAIT	\
260	efcode		\
261	libc_psr	.WAIT	\
262	libds		\
263	libdscp		\
264	libprtdiag	.WAIT	\
265	libprtdiag_psr	\
266	libpri		\
267	librsc		\
268	libfruutils	.WAIT	\
269	libfru		\
270	storage		\
271	libpcp		\
272	libtsalarm
273
274FM_sparc_DEPLIBS= libpri
275
276fm:			\
277	libexacct	\
278	libipmi		\
279	libzfs		\
280	scsi		\
281	$(FM_$(MACH)_DEPLIBS)
282
283#
284# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
285# clean and clobber targets (for more information, see those targets, below).
286#
287NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
288
289DCSUBDIRS =		\
290	lvm
291
292MSGSUBDIRS=		\
293	abi		\
294	auditd_plugins	\
295	brand		\
296	cfgadm_plugins	\
297	gss_mechs/mech_dh	\
298	gss_mechs/mech_krb5	\
299	krb5		\
300	libast		\
301	libbsm		\
302	libc		\
303	libcfgadm	\
304	libcmd		\
305	libcontract	\
306	libcurses	\
307	libdhcpsvc 	\
308	libdhcputil	\
309	libipsecutil	\
310	libdiskmgt	\
311	libdladm	\
312	libdll		\
313	libgss		\
314	libidmap	\
315	libinetcfg	\
316	libipmp		\
317	libnsl		\
318	libpam		\
319	libpicl		\
320	libpool		\
321	libpp		\
322	libscf		\
323	libsasl		\
324	libldap5	\
325	libsecdb	\
326	libshare	\
327	libshell	\
328	libsldap	\
329	libslp		\
330	libsmbfs	\
331	libsmedia	\
332	libsum		\
333	libtsol		\
334	libuutil	\
335	libvscan	\
336	libwanboot	\
337	libwanbootutil	\
338	libzfs		\
339	libzonecfg	\
340	lvm		\
341	madv		\
342	mms		\
343	mpss		\
344	pam_modules	\
345	rpcsec_gss
346$(CLOSED_BUILD)MSGSUBDIRS += \
347	$(CLOSED)/lib/smartcard
348MSGSUBDIRS += \
349	$($(MACH)_MSGSUBDIRS)
350
351sparc_MSGSUBDIRS=	\
352	libprtdiag	\
353	libprtdiag_psr
354
355HDRSUBDIRS=		\
356	auditd_plugins	\
357	libast		\
358	libbrand	\
359	libbsm		\
360	libc		\
361	libcmd		\
362	libcmdutils	\
363	libcontract	\
364	libcpc		\
365	libctf		\
366	libcurses	\
367	libcryptoutil	\
368	libdevice	\
369	libdevid	\
370	libdevinfo	\
371	libdiskmgt	\
372	libdladm	\
373	libdll		\
374	libdlpi		\
375	libdhcpagent	\
376	libdhcpsvc	\
377	libdhcputil	\
378	libdisasm	\
379	libdns_sd	\
380	libdscfg	\
381	libdtrace	\
382	libdtrace_jni	\
383	libelfsign	\
384	libeti		\
385	libfstyp	\
386	libgen		\
387	libwanboot	\
388	libwanbootutil	\
389	libipsecutil	\
390	libinetcfg	\
391	libinetsvc	\
392	libinetutil	\
393	libipmi		\
394	libipmp		\
395	libipp		\
396	libiscsit	\
397	libiscsitgt	\
398	libkstat	\
399	libkvm		\
400	libmail		\
401	libmd		\
402	libmtmalloc	\
403	libndmp		\
404	libnvpair	\
405	libnsctl	\
406	libnsl		\
407	libnwam		\
408	libpam		\
409	libpctx		\
410	libpicl		\
411	libpicltree	\
412	libplot		\
413	libpool		\
414	libpp		\
415	libproc		\
416	libraidcfg	\
417	librcm		\
418	librdc		\
419	libscf		\
420	libsip		\
421	libcommputil	\
422	libsmbios	\
423	librestart	\
424	librpcsvc	\
425	librsm		\
426	libsasl		\
427	libsec		\
428	libshell	\
429	libslp		\
430	libsmedia	\
431	libsqlite	\
432	libstmf		\
433	libsum		\
434	libsysevent	\
435	libtecla	\
436	libtnf		\
437	libtnfctl	\
438	libtnfprobe	\
439	libtsnet	\
440	libtsol		\
441	libvolmgt	\
442	libumem		\
443	libunistat	\
444	libuutil	\
445	libwrap		\
446	libxcurses2	\
447	libzfs		\
448	libzfs_jni	\
449	libzoneinfo	\
450	hal		\
451	policykit	\
452	lvm		\
453	openssl		\
454	pkcs11		\
455	passwdutil	\
456	../cmd/sendmail/libmilter	\
457	fm		\
458	udapl		\
459	libmapid	\
460	libkrb5		\
461	libshare	\
462	libidmap	\
463	libvscan	\
464	smbsrv		\
465	scsi		\
466	hbaapi		\
467	libima		\
468	libsun_ima	\
469	mpapi		\
470	mms		\
471	$($(MACH)_HDRSUBDIRS)
472
473$(CLOSED_BUILD)HDRSUBDIRS += \
474	$(CLOSED)/lib/libc_i18n	\
475	$(CLOSED)/lib/libike	\
476	$(CLOSED)/lib/smartcard
477
478sparc_HDRSUBDIRS=	\
479	libds		\
480	libdscp		\
481	libpri		\
482	storage
483
484all :=		TARGET= all
485check :=	TARGET= check
486clean :=	TARGET= clean
487clobber :=	TARGET= clobber
488install :=	TARGET= install
489install_h :=	TARGET= install_h
490lint :=		TARGET= lint
491_dc :=		TARGET= _dc
492_msg :=		TARGET= _msg
493
494.KEEP_STATE:
495
496#
497# For the all and install targets, we clearly must respect library
498# dependencies so that the libraries link correctly.  However, for
499# the remaining targets (check, clean, clobber, install_h, lint, _dc
500# and _msg), libraries do not have any dependencies on one another
501# and thus respecting dependencies just slows down the build.
502# As such, for these rules, we use pattern replacement to explicitly
503# avoid triggering the dependency information.  Note that for clean,
504# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
505# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
506#
507
508all:			$(SUBDIRS)
509
510install:		$(SUBDIRS) .WAIT install_extra
511
512# extra libraries kept in other source areas
513install_extra:
514	@cd ../cmd/sgs; pwd; $(MAKE) install_lib
515	@pwd
516
517clean clobber lint:	$(NOWAIT_SUBDIRS:%=%-nodepend)
518
519install_h check:	$(HDRSUBDIRS:%=%-nodepend)
520
521_msg:			$(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
522
523_dc:			$(DCSUBDIRS:%=%-nodepend)
524
525# dependencies for pam_modules (see below)
526$(CLOSED_BUILD)SMARTCARD=	$(CLOSED)/lib/smartcard
527
528#
529# Library interdependencies are called out explicitly here
530#
531auditd_plugins: libbsm libnsl libsecdb
532gss_mechs/mech_krb5:	libgss libnsl libsocket libresolv pkcs11
533libadt_jni:	libbsm
534$(CLOSED_BUILD)libc:		$(CLOSED)/lib/libc_i18n
535libast: 	libsocket
536libadutils: 	libldap5 libresolv libsocket libnsl
537nsswitch:	libadutils libidmap
538libbsm:		libtsol
539libcmd: 	libsum libast libsocket libnsl
540libcmdutils:	libavl
541libcontract:	libnvpair
542libdevid:	libdevinfo
543libdevinfo:	libnvpair libsec
544libdhcpagent:	libsocket libdhcputil libuuid libdlpi
545libdhcpsvc:	libinetutil
546libdhcputil:	libnsl libgen libinetutil libdlpi
547libdladm:	libdevinfo libinetutil libsocket libnsl libexacct libscf
548libdll: 	libast
549libdlpi:	libinetutil libdladm
550libdscfg:	libnsctl libunistat libsocket libnsl
551libdtrace:	libproc libgen libctf
552libdtrace_jni:	libuutil libdtrace
553libefi:		libuuid
554libfstyp:	libnvpair
555libelfsign:	libcryptoutil libkmf
556libidmap:	libadutils libldap5 libavl libsldap
557libinetcfg:	libnsl libsocket libdlpi
558libiscsit:	libc libnvpair libstmf libuuid libnsl
559libkmf:		libcryptoutil pkcs11 openssl
560libnsl:		libmd5 libscf
561libmapid:	libresolv
562libnwam:	libdoor
563librdc:		libsocket libnsl libnsctl libunistat libdscfg
564libuuid:	libdlpi
565libinetutil:	libsocket
566libsecdb:	libnsl
567libsasl:	libgss libsocket pkcs11 libmd
568sasl_plugins:	pkcs11 libgss libsocket libsasl
569libsctp:	libsocket
570libshell:	libast libcmd libdll libsocket libsecdb
571libsip:		libmd5
572libsmbfs:	libsocket libnsl libkrb5
573libsocket:	libnsl
574libsum: 	libast
575libldap5:	libsasl libsocket libnsl libmd
576libsldap:	libldap5 libtsol libnsl libc libscf libresolv
577libpool:	libnvpair libexacct
578libpp:		libast
579libzonecfg:	libc libsocket libnsl libuuid libnvpair libsysevent libsec \
580		libbrand libpool libscf
581libproc:	../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
582libproject:	libpool libproc libsecdb
583libtsnet:	libnsl libtsol libsecdb
584libwrap:	libnsl libsocket
585libwanboot:	libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
586		libdhcputil openssl
587libwanbootutil:	libnsl
588pam_modules:	libproject passwdutil $(SMARTCARD) smbsrv
589libscf:		libuutil libmd libgen
590libinetsvc:	libscf
591librestart:	libuutil libscf
592../cmd/sgs/libdl:	../cmd/sgs/libconv
593../cmd/sgs/libelf:	../cmd/sgs/libconv
594pkcs11:		libcryptoutil
595print:		libldap5
596udapl/udapl_tavor:	udapl/libdat
597libzfs:		libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
598libzfs_jni:	libdiskmgt libnvpair libzfs
599libzpool:	libavl libumem libnvpair
600libsec:		libavl
601brand:		libc libsocket
602libshare:	libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
603libexacct/demo:	libexacct libproject libsocket libnsl
604libtsalarm:	libpcp
605smbsrv:		libsocket libnsl libmd libxnet libpthread librt \
606		libshare libidmap pkcs11 libsqlite
607libvscan:	libscf
608scsi:		libnvpair
609mpapi:		libpthread libdevinfo libsysevent libnvpair
610
611#
612# The reason this rule checks for the existence of the
613# Makefile is that some of the directories do not exist
614# in certain situations (e.g., exportable source builds,
615# OpenSolaris).
616#
617$(SUBDIRS): FRC
618	@if [ -f $@/Makefile  ]; then \
619		cd $@; pwd; $(MAKE) $(TARGET); \
620	else \
621		true; \
622	fi
623
624$(SUBDIRS:%=%-nodepend):
625	@if [ -f $(@:%-nodepend=%)/Makefile  ]; then \
626		cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
627	else \
628		true; \
629	fi
630
631FRC:
632