libbe: updates based on 6699 review
[unleashed.git] / usr / src / lib / Makefile
blobcbdf23dc89876ede031364ce10c682626a36c6bd
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
26 # Copyright (c) 2013 Gary Mills
27 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 # Copyright (c) 2015 Gary Mills
29 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
30 # Copyright 2016 Toomas Soome <tsoome@me.com>
33 include ../Makefile.master
35 # Note that libcurses installs commands along with its library.
36 # This is a minor bug which probably should be fixed.
37 # Note also that a few extra libraries are kept in cmd source.
39 # Certain libraries are linked with, hence depend on, other libraries.
40 # Library dependencies are called out explicitly, see "Library
41 # interdependencies" below.
42 .PARALLEL:
44 # Build libc and its dependencies
45 SUBDIRS= \
46 common \
47 ../cmd/sgs/libconv \
48 ../cmd/sgs/libdl \
49 libc \
50 .WAIT
52 # Build libraries with lots of dependents
53 SUBDIRS += \
54 libm \
55 libmd \
56 libmp \
57 libnsl \
58 libnvpair \
59 libsocket \
60 .WAIT
62 # Build everything else. Aside from explicit dependencies, all libraries
63 # are built in parallel.
64 SUBDIRS += \
65 ../cmd/sendmail/libmilter \
66 ../cmd/sgs/libelf \
67 ../cmd/sgs/librtld_db \
68 abi \
69 auditd_plugins \
70 brand \
71 c_synonyms \
72 cfgadm_plugins \
73 crypt_modules \
74 extendedFILE \
75 fm \
76 getloginx \
77 gss_mechs/mech_dh \
78 gss_mechs/mech_dummy \
79 gss_mechs/mech_krb5 \
80 gss_mechs/mech_spnego \
81 hal \
82 hbaapi \
83 krb5 \
84 libadm \
85 libads \
86 libadt_jni \
87 libadutils \
88 libaio \
89 libast \
90 libavl \
91 libbe \
92 libbrand \
93 libbsdmalloc \
94 libbsm \
95 libc_db \
96 libcfgadm \
97 libcmd \
98 libcmdutils \
99 libcommputil \
100 libcontract \
101 libcpc \
102 libcrypt \
103 libcryptoutil \
104 libctf \
105 libcurses \
106 libdevice \
107 libdevid \
108 libdevinfo \
109 libdhcpagent \
110 libdhcputil \
111 libdisasm \
112 libdiskmgt \
113 libdladm \
114 libdll \
115 libdlpi \
116 libdns_sd \
117 libdoor \
118 libdscfg \
119 libdtrace \
120 libdtrace_jni \
121 libefi \
122 libelfsign \
123 libeti \
124 libexacct \
125 libexacct/demo \
126 libfakekernel \
127 libfcoe \
128 libficl \
129 libfru \
130 libfruutils \
131 libfsmgt \
132 libfstyp \
133 libgen \
134 libgrubmgmt \
135 libgss \
136 libhotplug \
137 libidmap \
138 libilb \
139 libima \
140 libinetsvc \
141 libinetutil \
142 libinstzones \
143 libintl \
144 libipadm \
145 libipd \
146 libipmi \
147 libipmp \
148 libipp \
149 libipsecutil \
150 libiscsit \
151 libkmf \
152 libkrb5 \
153 libkstat \
154 libkvm \
155 libldap5 \
156 liblgrp \
157 liblm \
158 libm1 \
159 libmail \
160 libmalloc \
161 libmapid \
162 libmapmalloc \
163 libmd5 \
164 libmtmalloc \
165 libmvec \
166 libndmp \
167 libnisdb \
168 libnls \
169 libnsctl \
170 libnwam \
171 libpam \
172 libpcidb \
173 libpctx \
174 libpicl \
175 libpicltree \
176 libpkg \
177 libpool \
178 libpp \
179 libproc \
180 libproject \
181 libpthread \
182 libraidcfg \
183 librcm \
184 librdc \
185 libreparse \
186 libresolv \
187 libresolv2 \
188 librestart \
189 librpcsvc \
190 librsm \
191 librstp \
192 librt \
193 libsasl \
194 libscf \
195 libsched \
196 libsctp \
197 libsec \
198 libsecdb \
199 libsendfile \
200 libshare \
201 libshell \
202 libsip \
203 libsldap \
204 libslp \
205 libsmbfs \
206 libsmbios \
207 libsmedia \
208 libsqlite \
209 libsrpt \
210 libstmf \
211 libstmfproxy \
212 libsum \
213 libsun_ima \
214 libsys \
215 libsysevent \
216 libtecla \
217 libtermcap \
218 libthread \
219 libtnf \
220 libtnfctl \
221 libtnfprobe \
222 libtsnet \
223 libtsol \
224 libumem \
225 libunistat \
226 libuuid \
227 libuutil \
228 libvolmgt \
229 libvrrpadm \
230 libvscan \
231 libw \
232 libwanboot \
233 libwanbootutil \
234 libwrap \
235 libxcurses \
236 libxcurses2 \
237 libxnet \
238 libzfs \
239 libzfs_core \
240 libzfs_jni \
241 libzonecfg \
242 libzoneinfo \
243 libzonestat \
244 libzpool \
245 lvm \
246 madv \
247 mpapi \
248 mpss \
249 nametoaddr \
250 ncad_addr \
251 nsswitch \
252 pam_modules \
253 passwdutil \
254 pkcs11 \
255 policykit \
256 print \
257 pylibbe \
258 pysolaris \
259 pyzfs \
260 raidcfg_plugins \
261 rpcsec_gss \
262 sasl_plugins \
263 scsi \
264 smbsrv \
265 smhba \
266 sun_fc \
267 sun_sas \
268 udapl \
269 watchmalloc \
270 $($(MACH)_SUBDIRS)
272 i386_SUBDIRS= \
273 libfdisk \
274 libsaveargs
276 sparc_SUBDIRS= \
277 efcode \
278 libds \
279 libdscp \
280 libprtdiag \
281 libprtdiag_psr \
282 libpri \
283 librsc \
284 storage \
285 libpcp \
286 libtsalarm \
287 libv12n
290 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
291 # clean and clobber targets (for more information, see those targets, below).
293 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
295 DCSUBDIRS = \
298 MSGSUBDIRS= \
299 abi \
300 auditd_plugins \
301 brand \
302 cfgadm_plugins \
303 gss_mechs/mech_dh \
304 gss_mechs/mech_krb5 \
305 krb5 \
306 libast \
307 libbsm \
308 libc \
309 libcfgadm \
310 libcmd \
311 libcontract \
312 libcurses \
313 libdhcputil \
314 libdiskmgt \
315 libdladm \
316 libdll \
317 libgrubmgmt \
318 libgss \
319 libidmap \
320 libilb \
321 libinetutil \
322 libinstzones \
323 libipadm \
324 libipmp \
325 libipsecutil \
326 libldap5 \
327 libnsl \
328 libnwam \
329 libpam \
330 libpicl \
331 libpkg \
332 libpool \
333 libpp \
334 libreparse \
335 libsasl \
336 libscf \
337 libsecdb \
338 libshare \
339 libshell \
340 libsldap \
341 libslp \
342 libsmbfs \
343 libsmedia \
344 libsum \
345 libtsol \
346 libuutil \
347 libvrrpadm \
348 libvscan \
349 libwanboot \
350 libwanbootutil \
351 libzfs \
352 libzonecfg \
353 lvm \
354 madv \
355 mpss \
356 pam_modules \
357 pyzfs \
358 rpcsec_gss \
359 $($(MACH)_MSGSUBDIRS)
361 sparc_MSGSUBDIRS= \
362 libprtdiag \
363 libprtdiag_psr
365 i386_MSGSUBDIRS= libfdisk
367 HDRSUBDIRS= \
368 ../cmd/sendmail/libmilter \
369 auditd_plugins \
370 fm \
371 hal \
372 hbaapi \
373 libads \
374 libast \
375 libbrand \
376 libbsm \
377 libc \
378 libcmd \
379 libcmdutils \
380 libcommputil \
381 libcontract \
382 libcpc \
383 libcryptoutil \
384 libctf \
385 libcurses \
386 libdevice \
387 libdevid \
388 libdevinfo \
389 libdhcpagent \
390 libdhcputil \
391 libdisasm \
392 libdiskmgt \
393 libdladm \
394 libdll \
395 libdlpi \
396 libdns_sd \
397 libdscfg \
398 libdtrace \
399 libdtrace_jni \
400 libelfsign \
401 libeti \
402 libfakekernel \
403 libfcoe \
404 libfru \
405 libfstyp \
406 libgen \
407 libgrubmgmt \
408 libidmap \
409 libilb \
410 libima \
411 libinetsvc \
412 libinetutil \
413 libinstzones \
414 libipadm \
415 libipd \
416 libipmi \
417 libipmp \
418 libipp \
419 libipsecutil \
420 libiscsit \
421 libkrb5 \
422 libkstat \
423 libkvm \
424 libmail \
425 libmapid \
426 libmd \
427 libmtmalloc \
428 libndmp \
429 libnsctl \
430 libnsl \
431 libnvpair \
432 libnwam \
433 libpam \
434 libpcidb \
435 libpctx \
436 libpicl \
437 libpicltree \
438 libpool \
439 libpp \
440 libproc \
441 libraidcfg \
442 librcm \
443 librdc \
444 libreparse \
445 librestart \
446 librpcsvc \
447 librsm \
448 librstp \
449 libsasl \
450 libscf \
451 libsec \
452 libshare \
453 libshell \
454 libsip \
455 libslp \
456 libsmbfs \
457 libsmbios \
458 libsmedia \
459 libsocket \
460 libsqlite \
461 libsrpt \
462 libstmf \
463 libstmfproxy \
464 libsum \
465 libsun_ima \
466 libsysevent \
467 libtecla \
468 libtermcap \
469 libtnf \
470 libtnfctl \
471 libtnfprobe \
472 libtsnet \
473 libtsol \
474 libumem \
475 libunistat \
476 libuutil \
477 libvolmgt \
478 libvrrpadm \
479 libvscan \
480 libwanboot \
481 libwanbootutil \
482 libwrap \
483 libxcurses2 \
484 libzfs \
485 libzfs_core \
486 libzfs_jni \
487 libzoneinfo \
488 libzonestat \
489 lvm \
490 mpapi \
491 passwdutil \
492 pkcs11 \
493 policykit \
494 scsi \
495 smbsrv \
496 smhba \
497 udapl \
498 $($(MACH)_HDRSUBDIRS)
500 i386_HDRSUBDIRS= \
501 libfdisk \
502 libsaveargs
504 sparc_HDRSUBDIRS= \
505 libds \
506 libdscp \
507 libpri \
508 libv12n \
509 storage
511 all := TARGET= all
512 check := TARGET= check
513 clean := TARGET= clean
514 clobber := TARGET= clobber
515 install := TARGET= install
516 install_h := TARGET= install_h
517 _dc := TARGET= _dc
518 _msg := TARGET= _msg
520 .KEEP_STATE:
523 # For the all and install targets, we clearly must respect library
524 # dependencies so that the libraries link correctly. However, for
525 # the remaining targets (check, clean, clobber, install_h, _dc, and
526 # _msg), libraries do not have any dependencies on one another and
527 # thus respecting dependencies just slows down the build. As such,
528 # for these rules, we use pattern replacement to explicitly avoid
529 # triggering the dependency information. Note that for clean and
530 # clobber, we must use $(NOWAIT_SUBDIRS) rather than $(SUBDIRS),
531 # to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
534 all: $(SUBDIRS)
536 install: $(SUBDIRS) .WAIT install_extra
538 # extra libraries kept in other source areas
539 install_extra:
540 @cd ../cmd/sgs; pwd; $(MAKE) install_lib
541 @pwd
543 clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend)
545 install_h check: $(HDRSUBDIRS:%=%-nodepend)
547 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
549 _dc: $(DCSUBDIRS:%=%-nodepend)
551 # Library interdependencies are called out explicitly here.
552 ../cmd/sgs/libconv: common
553 ../cmd/sgs/libdl: common
554 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
556 libm: libc
557 libmd: libc
558 libmp: libc
559 libnsl: libc libmd libmp
560 libnvpair: libc libnsl
561 libsocket: libc libnsl
563 basedeps: libc libm libmd libmp libnsl libnvpair libsocket
564 basedeps := TARGET=install
566 # The following dependencies don't need to be listed below as they are built
567 # before everything else:
568 # libc libm libmd libmp libnsl libnvpair libsocket
569 abi: libctf libmapmalloc libproc
570 auditd_plugins: libbsm libsecdb libgss libmtmalloc
571 brand: libzonecfg libmapmalloc
572 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
573 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
574 libcontract libsysevent ../cmd/sgs/libelf
575 $(SPARC_BLD)fm: libpri
576 gss_mechs/mech_dh: libgss
577 gss_mechs/mech_dummy: libgss
578 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat
579 gss_mechs/mech_spnego: gss_mechs/mech_krb5
580 krb5: gss_mechs/mech_krb5 libtecla libldap5
581 libadt_jni: libbsm
582 libadutils: libldap5 libresolv2
583 libbe: libzfs libinstzones libuuid libgen libdevinfo libefi libficl
584 libbsm: libinetutil libscf libsecdb libtsol
585 libcfgadm: libdevinfo
586 libcmd: libsum libast
587 libcmdutils: libavl
588 libcpc: libpctx
589 libcrypt: libgen
590 libdevid: libdevinfo
591 libdevinfo: libsec libgen
592 libdhcpagent: libdhcputil libuuid libdlpi libcontract
593 libdhcputil: libgen libinetutil libdlpi
594 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent
595 $(INTEL_BLD)libdiskmgt: libfdisk
596 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \
597 libpool
598 libdll: libast
599 libdlpi: libinetutil libdladm
600 libds: libsysevent
601 libdscfg: libnsctl libunistat libadm
602 libdtrace: libproc libgen libctf libmapmalloc
603 libdtrace_jni: libuutil libdtrace
604 libefi: libuuid
605 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf
606 libeti: libcurses
607 libexacct/demo: libexacct libproject
608 libfakekernel: libumem libcryptoutil
609 libfcoe: libdladm
610 libficl: libumem
611 libfru: libfruutils
612 libfsmgt: libkstat
613 libgrubmgmt: libdevinfo libzfs libfstyp libefi
614 $(INTEL_BLD)libgrubmgmt: libfdisk
615 libidmap: libavl libuutil
616 libinetsvc: libscf
617 libinstzones: libzonecfg libcontract
618 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb
619 libipmp: libinetutil
620 libipsecutil: libtecla libtsol
621 libiscsit: libstmf libuuid
622 libkmf: libcryptoutil pkcs11
623 libkvm: ../cmd/sgs/libelf
624 libldap5: libsasl
625 libmapid: libresolv2 libscf
626 libndmp: libscf
627 libnisdb: libldap5
628 libnwam: libscf libbsm libdladm
629 libpcp: libumem libdevinfo
630 libpctx: libproc
631 libpkg: libwanboot libscf libadm
632 libpool: libscf libexacct
633 libpp: libast
634 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
635 $(INTEL_BLD)libproc: libsaveargs
636 libproject: libpool libproc libsecdb
637 libprtdiag: libkstat
638 libprtdiag_psr: libprtdiag
639 libraidcfg: libdevinfo
640 librdc: libnsctl libunistat libdscfg
641 librestart: libuutil libscf libpool libproject libsecdb libsysevent
642 libsasl: libgss pkcs11
643 libsaveargs: libdisasm
644 libscf: libuutil libgen libsmbios
645 libsec: libavl libidmap
646 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
647 libshell: libast libcmd libdll libsecdb
648 libsip: libmd5
649 libsldap: libldap5 libscf
650 libsmbfs: libkrb5 libsec libidmap pkcs11
651 libsrpt: libstmf
652 libstmf: libscf
653 libstmfproxy: libstmf libpthread
654 libsum: libast
655 libsun_ima: libdevinfo libsysevent
656 libsysevent: libsecdb
657 libtecla: libcurses
658 libtermcap: libcurses
659 libtnfctl: ../cmd/sgs/libelf
660 libtsalarm: libpcp
661 libtsnet: libtsol libsecdb
662 libtsol: libsecdb
663 libuuid: libdlpi
664 libv12n: libds libuuid
665 libvolmgt: libadm
666 libvrrpadm: libdladm libscf
667 libvscan: libscf libsecdb
668 libwanboot: libresolv2 libdevinfo libinetutil libdhcputil
669 libzfs: libdevid libgen libuutil libadm libavl libefi libidmap \
670 libumem libtsol libzfs_core
671 libzfs_jni: libdiskmgt libzfs
672 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \
673 libuutil libbsm libsecdb
674 libzonestat: libcmdutils libumem
675 libzpool: libavl libumem libcmdutils libsysevent
676 lvm: libadm libdevid libdevinfo libefi libgen libscf
677 madv: libgen
678 mpapi: libpthread libdevinfo libsysevent
679 mpss: libgen
680 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap
681 pam_modules: libproject passwdutil smbsrv libtsnet libpam libbsm libsecdb
682 passwdutil: libsldap
683 pkcs11: libcryptoutil libgen libuuid
684 policykit: libsecdb
685 print: libldap5 libmd5 libsendfile
686 pylibbe: libbe libzfs
687 pysolaris: libsec libidmap
688 pyzfs: libzfs
689 raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree
690 rpcsec_gss: libgss
691 sasl_plugins: pkcs11 libgss libsasl
692 scsi: libfru libumem libdevid libdevinfo
693 smbsrv: libxnet libpthread librt libshare libidmap pkcs11 libsqlite \
694 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \
695 libuuid libfakekernel libads libgss libldap5 krb5
696 storage: libdevice libdevinfo libdevid
697 sun_fc: libdevinfo libsysevent
698 sun_sas: libdevinfo libsysevent libkstat libdevid
699 udapl: libdevinfo libdladm
702 # The reason this rule checks for the existence of the
703 # Makefile is that some of the directories do not exist
704 # in certain situations (e.g., exportable source builds,
705 # OpenSolaris).
707 $(SUBDIRS): FRC
708 @if [ -f $@/Makefile ]; then \
709 cd $@; pwd; $(MAKE) $(TARGET); \
710 else \
711 true; \
714 $(SUBDIRS:%=%-nodepend):
715 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
716 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
717 else \
718 true; \
721 FRC: