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