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