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