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 # Copyirght 2018 Jason King 34 # 35 36 include ../Makefile.master 37 38 # Note that libcurses installs commands along with its library. 39 # This is a minor bug which probably should be fixed. 40 # Note also that a few extra libraries are kept in cmd source. 41 # 42 # Certain libraries are linked with, hence depend on, other libraries. 43 # Library dependencies are called out explicitly, see "Library 44 # interdependencies" below. 45 .PARALLEL: 46 47 # Build libc and its dependencies 48 SUBDIRS= \ 49 crt \ 50 ../cmd/sgs/libconv \ 51 ../cmd/sgs/libdl \ 52 libc \ 53 .WAIT 54 55 # Build libraries with lots of dependents 56 SUBDIRS += \ 57 libm \ 58 libmd \ 59 libmp \ 60 libnsl \ 61 libnvpair \ 62 libsocket \ 63 .WAIT 64 65 # Build everything else. Aside from explicit dependencies, all libraries 66 # are built in parallel. 67 SUBDIRS += \ 68 ../cmd/sendmail/libmilter \ 69 ../cmd/sgs/libelf \ 70 ../cmd/sgs/librtld_db \ 71 abi \ 72 auditd_plugins \ 73 brand \ 74 c_synonyms \ 75 cfgadm_plugins \ 76 crypt_modules \ 77 extendedFILE \ 78 fm \ 79 getloginx \ 80 gss_mechs/mech_dh \ 81 gss_mechs/mech_dummy \ 82 gss_mechs/mech_krb5 \ 83 gss_mechs/mech_spnego \ 84 hal \ 85 hbaapi \ 86 krb5 \ 87 libadm \ 88 libads \ 89 libadt_jni \ 90 libadutils \ 91 libaio \ 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 libdemangle \ 110 libdevice \ 111 libdevid \ 112 libdevinfo \ 113 libdhcpagent \ 114 libdhcputil \ 115 libdisasm \ 116 libdiskmgt \ 117 libdladm \ 118 libdll \ 119 libdlpi \ 120 libdns_sd \ 121 libdoor \ 122 libdscfg \ 123 libdtrace \ 124 libdtrace_jni \ 125 libefi \ 126 libelfsign \ 127 libeti \ 128 libexacct \ 129 libexacct/demo \ 130 libfakekernel \ 131 libfcoe \ 132 libficl \ 133 libfru \ 134 libfruutils \ 135 libfsmgt \ 136 libfstyp \ 137 libgen \ 138 libgrubmgmt \ 139 libgss \ 140 libhotplug \ 141 libidmap \ 142 libilb \ 143 libima \ 144 libinetsvc \ 145 libinetutil \ 146 libinstzones \ 147 libintl \ 148 libipadm \ 149 libipd \ 150 libipmi \ 151 libipmp \ 152 libipp \ 153 libipsecutil \ 154 libiscsit \ 155 libkmf \ 156 libkrb5 \ 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 smbsrv \ 269 smhba \ 270 sun_fc \ 271 sun_sas \ 272 udapl \ 273 watchmalloc \ 274 $($(MACH)_SUBDIRS) 275 276 i386_SUBDIRS= \ 277 libfdisk \ 278 libsaveargs 279 280 sparc_SUBDIRS= \ 281 efcode \ 282 libds \ 283 libdscp \ 284 libprtdiag \ 285 libprtdiag_psr \ 286 libpri \ 287 librsc \ 288 storage \ 289 libpcp \ 290 libtsalarm \ 291 libv12n 292 293 # 294 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the 295 # clean and clobber targets (for more information, see those targets, below). 296 # 297 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=) 298 299 DCSUBDIRS= 300 301 MSGSUBDIRS= \ 302 abi \ 303 auditd_plugins \ 304 brand \ 305 cfgadm_plugins \ 306 gss_mechs/mech_dh \ 307 gss_mechs/mech_krb5 \ 308 krb5 \ 309 libast \ 310 libbsm \ 311 libc \ 312 libcfgadm \ 313 libcmd \ 314 libcontract \ 315 libcurses \ 316 libdhcputil \ 317 libdiskmgt \ 318 libdladm \ 319 libdll \ 320 libgrubmgmt \ 321 libgss \ 322 libidmap \ 323 libilb \ 324 libinstzones \ 325 libipadm \ 326 libipmp \ 327 libipsecutil \ 328 libldap5 \ 329 libnsl \ 330 libnwam \ 331 libofmt \ 332 libpam \ 333 libpicl \ 334 libpkg \ 335 libpool \ 336 libpp \ 337 libreparse \ 338 libsasl \ 339 libscf \ 340 libsecdb \ 341 libshare \ 342 libshell \ 343 libsldap \ 344 libslp \ 345 libsmbfs \ 346 libsmedia \ 347 libsum \ 348 libtsol \ 349 libuutil \ 350 libvrrpadm \ 351 libvscan \ 352 libzfs \ 353 libzonecfg \ 354 madv \ 355 mpss \ 356 pam_modules \ 357 pyzfs \ 358 rpcsec_gss \ 359 $($(MACH)_MSGSUBDIRS) 360 361 sparc_MSGSUBDIRS= \ 362 libprtdiag \ 363 libprtdiag_psr 364 365 i386_MSGSUBDIRS= libfdisk 366 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 libdemangle \ 387 libdevice \ 388 libdevid \ 389 libdevinfo \ 390 libdhcpagent \ 391 libdhcputil \ 392 libdisasm \ 393 libdiskmgt \ 394 libdladm \ 395 libdll \ 396 libdlpi \ 397 libdns_sd \ 398 libdscfg \ 399 libdtrace \ 400 libdtrace_jni \ 401 libelfsign \ 402 libeti \ 403 libfakekernel \ 404 libfcoe \ 405 libfru \ 406 libfstyp \ 407 libgen \ 408 libgrubmgmt \ 409 libidmap \ 410 libilb \ 411 libima \ 412 libinetsvc \ 413 libinetutil \ 414 libinstzones \ 415 libipadm \ 416 libipd \ 417 libipmi \ 418 libipmp \ 419 libipp \ 420 libipsecutil \ 421 libiscsit \ 422 libkrb5 \ 423 libkstat \ 424 libkvm \ 425 libmail \ 426 libmapid \ 427 libmd \ 428 libmlrpc \ 429 libmtmalloc \ 430 libndmp \ 431 libnsctl \ 432 libnsl \ 433 libnvpair \ 434 libnwam \ 435 libofmt \ 436 libpam \ 437 libpcidb \ 438 libpctx \ 439 libpicl \ 440 libpicltree \ 441 libpool \ 442 libpp \ 443 libproc \ 444 libraidcfg \ 445 librcm \ 446 librdc \ 447 libreparse \ 448 librestart \ 449 librpcsvc \ 450 librsm \ 451 librstp \ 452 libsasl \ 453 libscf \ 454 libsec \ 455 libsff \ 456 libshare \ 457 libshell \ 458 libsip \ 459 libslp \ 460 libsmbfs \ 461 libsmbios \ 462 libsmedia \ 463 libsocket \ 464 libsqlite \ 465 libsrpt \ 466 libstmf \ 467 libstmfproxy \ 468 libsum \ 469 libsun_ima \ 470 libsysevent \ 471 libtecla \ 472 libtermcap \ 473 libtnf \ 474 libtnfctl \ 475 libtnfprobe \ 476 libtsnet \ 477 libtsol \ 478 libumem \ 479 libunistat \ 480 libuutil \ 481 libvolmgt \ 482 libvrrpadm \ 483 libvscan \ 484 libwrap \ 485 libxcurses2 \ 486 libzfs \ 487 libzfs_core \ 488 libzfs_jni \ 489 libzoneinfo \ 490 libzonestat \ 491 mpapi \ 492 passwdutil \ 493 pkcs11 \ 494 policykit \ 495 scsi \ 496 smbsrv \ 497 smhba \ 498 udapl \ 499 $($(MACH)_HDRSUBDIRS) 500 501 i386_HDRSUBDIRS= \ 502 libfdisk \ 503 libsaveargs 504 505 sparc_HDRSUBDIRS= \ 506 libds \ 507 libdscp \ 508 libpri \ 509 libv12n \ 510 storage 511 512 all := TARGET= all 513 check := TARGET= check 514 clean := TARGET= clean 515 clobber := TARGET= clobber 516 install := TARGET= install 517 install_h := TARGET= install_h 518 lint := TARGET= lint 519 _dc := TARGET= _dc 520 _msg := TARGET= _msg 521 522 .KEEP_STATE: 523 524 # 525 # For the all and install targets, we clearly must respect library 526 # dependencies so that the libraries link correctly. However, for 527 # the remaining targets (check, clean, clobber, install_h, lint, _dc 528 # and _msg), libraries do not have any dependencies on one another 529 # and thus respecting dependencies just slows down the build. 530 # As such, for these rules, we use pattern replacement to explicitly 531 # avoid triggering the dependency information. Note that for clean, 532 # clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than 533 # $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'. 534 # 535 536 all: $(SUBDIRS) 537 538 install: $(SUBDIRS) .WAIT install_extra 539 540 # extra libraries kept in other source areas 541 install_extra: 542 @cd ../cmd/sgs; pwd; $(MAKE) install_lib 543 @pwd 544 545 clean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend) 546 547 install_h check: $(HDRSUBDIRS:%=%-nodepend) 548 549 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc 550 551 _dc: $(DCSUBDIRS:%=%-nodepend) 552 553 # Library interdependencies are called out explicitly here. 554 ../cmd/sgs/libconv: crt 555 ../cmd/sgs/libdl: crt 556 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl 557 558 libm: libc 559 libmd: libc 560 libmp: libc 561 libnsl: libc libmd libmp 562 libnvpair: libc libnsl 563 libsocket: libc libnsl 564 565 basedeps: libc libm libmd libmp libnsl libnvpair libsocket 566 basedeps := TARGET=install 567 568 # The following dependencies are currently required by libdbus-1 and should 569 # be used for anything linking against it. 570 dbusdeps: libsecdb libtsol libinetutil libscf libuutil libgen libsmbios 571 572 # The following dependencies don't need to be listed below as they are built 573 # before everything else: 574 # libc libm libmd libmp libnsl libnvpair libsocket 575 abi: libctf libmapmalloc libproc 576 auditd_plugins: libbsm libsecdb libgss libmtmalloc 577 brand: libzonecfg libmapmalloc 578 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf 579 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \ 580 libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \ 581 libpcidb 582 $(SPARC_BLD)fm: libpri 583 gss_mechs/mech_dh: libgss 584 gss_mechs/mech_dummy: libgss 585 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat 586 gss_mechs/mech_spnego: gss_mechs/mech_krb5 587 hal: dbusdeps 588 krb5: gss_mechs/mech_krb5 libtecla libldap5 589 libadt_jni: libbsm 590 libadutils: libldap5 libresolv2 591 libbe: libzfs libinstzones libuuid libgen libdevinfo libefi libficl 592 libbsm: libinetutil libscf libsecdb libtsol 593 libcfgadm: libdevinfo 594 libcmd: libsum libast 595 libcmdutils: libavl 596 libcpc: libpctx 597 libcrypt: libgen 598 libdevid: libdevinfo 599 libdevinfo: libsec libgen 600 libdhcpagent: libdhcputil libuuid libdlpi libcontract 601 libdhcputil: libgen libinetutil libdlpi 602 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent 603 $(INTEL_BLD)libdiskmgt: libfdisk 604 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \ 605 libpool 606 libdll: libast 607 libdlpi: libinetutil libdladm 608 libds: libsysevent 609 libdscfg: libnsctl libunistat libadm 610 libdtrace: libproc libgen libctf libmapmalloc 611 libdtrace_jni: libuutil libdtrace 612 libefi: libuuid libsmbios 613 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf 614 libeti: libcurses 615 libexacct/demo: libexacct libproject 616 libfakekernel: libumem libcryptoutil 617 libfcoe: libdladm 618 libficl: libuuid libumem 619 libfru: libfruutils 620 libfsmgt: libkstat 621 libgrubmgmt: libdevinfo libzfs libfstyp libefi 622 $(INTEL_BLD)libgrubmgmt: libfdisk 623 libidmap: libavl libuutil 624 libinetsvc: libscf 625 libinstzones: libzonecfg libcontract 626 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil 627 libipmp: libinetutil 628 libipsecutil: libtecla libtsol 629 libiscsit: libstmf libuuid 630 libkmf: libcryptoutil pkcs11 631 libkvm: ../cmd/sgs/libelf 632 libldap5: libsasl 633 libmapid: libresolv2 libscf 634 libmlrpc: libsmbfs libuuid 635 libndmp: libscf 636 libnisdb: libldap5 637 libnwam: libscf libbsm libdladm libipadm 638 libpcp: libumem libdevinfo 639 libpctx: libproc 640 libpkg: libscf libadm 641 libpool: libscf libexacct 642 libpp: libast 643 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf 644 $(INTEL_BLD)libproc: libsaveargs 645 libproject: libpool libproc libsecdb 646 libprtdiag: libkstat 647 libprtdiag_psr: libprtdiag 648 libraidcfg: libdevinfo 649 librdc: libnsctl libunistat libdscfg 650 librestart: libuutil libscf libpool libproject libsecdb libsysevent 651 libsasl: libgss pkcs11 652 libsaveargs: libdisasm 653 libscf: libuutil libgen libsmbios 654 libsec: libavl libidmap 655 libsff: libnvpair 656 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs 657 libshell: libast libcmd libdll libsecdb 658 libsip: libmd5 659 libsldap: libldap5 libscf 660 libsmbfs: libkrb5 libsec libidmap pkcs11 661 libsmbios: libdevinfo 662 libsrpt: libstmf 663 libstmf: libscf 664 libstmfproxy: libstmf libpthread 665 libsum: libast 666 libsun_ima: libdevinfo libsysevent 667 libsysevent: libsecdb 668 libtecla: libcurses 669 libtermcap: libcurses 670 libtnfctl: ../cmd/sgs/libelf 671 libtsalarm: libpcp 672 libtsnet: libtsol libsecdb 673 libtsol: libsecdb 674 libuuid: libdlpi 675 libv12n: libds libuuid 676 libvolmgt: libadm 677 libvrrpadm: libdladm libscf 678 libvscan: libscf libsecdb 679 libzfs: libdevid libgen libuutil libadm libavl libefi libidmap \ 680 libumem libtsol libzfs_core 681 libzfs_jni: libdiskmgt libzfs 682 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \ 683 libuutil libbsm libsecdb 684 libzonestat: libcmdutils libumem 685 libzpool: libavl libumem libcmdutils libsysevent libfakekernel 686 madv: libgen 687 mpapi: libpthread libdevinfo libsysevent 688 mpss: libgen 689 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap 690 pam_modules: libproject passwdutil smbsrv libtsnet libpam libbsm libsecdb 691 passwdutil: libsldap 692 pkcs11: libcryptoutil libgen libuuid 693 policykit: dbusdeps 694 print: libldap5 libmd5 libsendfile 695 pylibbe: libbe libzfs 696 pysolaris: libsec libidmap 697 pyzfs: libzfs 698 raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree 699 rpcsec_gss: libgss 700 sasl_plugins: pkcs11 libgss libsasl 701 scsi: libfru libumem libdevid libdevinfo 702 smbsrv: libxnet libpthread librt libshare libidmap pkcs11 libsqlite \ 703 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \ 704 libuuid libfakekernel libads libgss libldap5 krb5 libmlrpc 705 storage: libdevice libdevinfo libdevid 706 sun_fc: libdevinfo libsysevent 707 sun_sas: libdevinfo libsysevent libkstat libdevid 708 udapl: libdevinfo libdladm 709 710 # 711 # The reason this rule checks for the existence of the 712 # Makefile is that some of the directories do not exist 713 # in certain situations (e.g., exportable source builds, 714 # OpenSolaris). 715 # 716 $(SUBDIRS): FRC 717 @if [ -f $@/Makefile ]; then \ 718 cd $@; pwd; $(MAKE) $(TARGET); \ 719 else \ 720 true; \ 721 fi 722 723 $(SUBDIRS:%=%-nodepend): 724 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \ 725 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \ 726 else \ 727 true; \ 728 fi 729 730 FRC: