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 libzfs_core \ 247 libzfs_jni \ 248 libzonecfg \ 249 libzoneinfo \ 250 libzonestat \ 251 libzpool \ 252 libzutil \ 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 pylibbe \ 265 pysolaris \ 266 pyzfs \ 267 raidcfg_plugins \ 268 rpcsec_gss \ 269 sasl_plugins \ 270 scsi \ 271 smbclnt \ 272 smbsrv \ 273 smhba \ 274 sun_fc \ 275 sun_sas \ 276 udapl \ 277 watchmalloc \ 278 $($(MACH)_SUBDIRS) 279 280i386_SUBDIRS= \ 281 libfdisk \ 282 libppt \ 283 libsaveargs \ 284 libvmm \ 285 libvmmapi 286 287sparc_SUBDIRS= \ 288 efcode \ 289 libds \ 290 libdscp \ 291 libprtdiag \ 292 libprtdiag_psr \ 293 libpri \ 294 librsc \ 295 storage \ 296 libpcp \ 297 libtsalarm \ 298 libv12n 299 300# 301# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the 302# clean and clobber targets (for more information, see those targets, below). 303# 304NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=) 305 306DCSUBDIRS= 307 308MSGSUBDIRS= \ 309 abi \ 310 auditd_plugins \ 311 brand \ 312 cfgadm_plugins \ 313 gss_mechs/mech_dh \ 314 gss_mechs/mech_krb5 \ 315 krb5 \ 316 libast \ 317 libbsm \ 318 libc \ 319 libcfgadm \ 320 libcmd \ 321 libcontract \ 322 libcurses \ 323 libdhcputil \ 324 libdiskmgt \ 325 libdladm \ 326 libdll \ 327 libgrubmgmt \ 328 libgss \ 329 libidmap \ 330 libilb \ 331 libinstzones \ 332 libipadm \ 333 libipmp \ 334 libipsecutil \ 335 libldap5 \ 336 libnsl \ 337 libnwam \ 338 libofmt \ 339 libpam \ 340 libpicl \ 341 libpkg \ 342 libpool \ 343 libpp \ 344 libreparse \ 345 libsasl \ 346 libscf \ 347 libsecdb \ 348 libshare \ 349 libshell \ 350 libsldap \ 351 libslp \ 352 libsmbfs \ 353 libsmedia \ 354 libsum \ 355 libtsol \ 356 libuutil \ 357 libvrrpadm \ 358 libvscan \ 359 libzfs \ 360 libzonecfg \ 361 madv \ 362 mpss \ 363 pam_modules \ 364 pyzfs \ 365 rpcsec_gss \ 366 $($(MACH)_MSGSUBDIRS) 367 368sparc_MSGSUBDIRS= \ 369 libprtdiag \ 370 libprtdiag_psr 371 372i386_MSGSUBDIRS= libfdisk 373 374HDRSUBDIRS= \ 375 ../cmd/sendmail/libmilter \ 376 auditd_plugins \ 377 fm \ 378 hal \ 379 hbaapi \ 380 libads \ 381 libast \ 382 libbrand \ 383 libbsm \ 384 libc \ 385 libcmd \ 386 libcmdutils \ 387 libcommputil \ 388 libcontract \ 389 libcpc \ 390 libcryptoutil \ 391 libctf \ 392 libcurses \ 393 libcustr \ 394 libdemangle \ 395 libdevice \ 396 libdevid \ 397 libdevinfo \ 398 libdhcpagent \ 399 libdhcputil \ 400 libdisasm \ 401 libdiskmgt \ 402 libdladm \ 403 libdll \ 404 libdlpi \ 405 libdns_sd \ 406 libdtrace \ 407 libdtrace_jni \ 408 libelfsign \ 409 libeti \ 410 libfakekernel \ 411 libfcoe \ 412 libfru \ 413 libfstyp \ 414 libgen \ 415 libgrubmgmt \ 416 libidmap \ 417 libilb \ 418 libima \ 419 libinetsvc \ 420 libinetutil \ 421 libinstzones \ 422 libipadm \ 423 libipd \ 424 libipmi \ 425 libipmp \ 426 libipp \ 427 libipsecutil \ 428 libiscsit \ 429 libkrb5 \ 430 libkstat \ 431 libkvm \ 432 libmail \ 433 libmapid \ 434 libmd \ 435 libmlrpc \ 436 libmtmalloc \ 437 libndmp \ 438 libnsl \ 439 libnvpair \ 440 libnwam \ 441 libofmt \ 442 libpam \ 443 libpcidb \ 444 libpcsc \ 445 libpctx \ 446 libpicl \ 447 libpicltree \ 448 libpool \ 449 libpp \ 450 libproc \ 451 libraidcfg \ 452 librcm \ 453 libreparse \ 454 librestart \ 455 librpcsvc \ 456 librsm \ 457 librstp \ 458 libsasl \ 459 libscf \ 460 libsec \ 461 libsff \ 462 libshare \ 463 libshell \ 464 libsip \ 465 libslp \ 466 libsmbfs \ 467 libsmbios \ 468 libsmedia \ 469 libsocket \ 470 libsqlite \ 471 libsrpt \ 472 libstmf \ 473 libstmfproxy \ 474 libsum \ 475 libsun_ima \ 476 libsysevent \ 477 libtecla \ 478 libtermcap \ 479 libtnf \ 480 libtnfctl \ 481 libtnfprobe \ 482 libtsnet \ 483 libtsol \ 484 libumem \ 485 libutempter \ 486 libuutil \ 487 libvolmgt \ 488 libvrrpadm \ 489 libvscan \ 490 libwrap \ 491 libxcurses2 \ 492 libzfs \ 493 libzfs_core \ 494 libzfs_jni \ 495 libzoneinfo \ 496 libzonestat \ 497 mpapi \ 498 passwdutil \ 499 pkcs11 \ 500 policykit \ 501 scsi \ 502 smbsrv \ 503 smhba \ 504 udapl \ 505 $($(MACH)_HDRSUBDIRS) 506 507i386_HDRSUBDIRS= \ 508 libfdisk \ 509 libppt \ 510 libsaveargs \ 511 libvmm \ 512 libvmmapi 513 514sparc_HDRSUBDIRS= \ 515 libds \ 516 libdscp \ 517 libpri \ 518 libv12n \ 519 storage 520 521all := TARGET= all 522check := TARGET= check 523clean := TARGET= clean 524clobber := TARGET= clobber 525install := TARGET= install 526install_h := TARGET= install_h 527_dc := TARGET= _dc 528_msg := TARGET= _msg 529 530.KEEP_STATE: 531 532# 533# For the all and install targets, we clearly must respect library 534# dependencies so that the libraries link correctly. However, for 535# the remaining targets (check, clean, clobber, install_h, _dc 536# and _msg), libraries do not have any dependencies on one another 537# and thus respecting dependencies just slows down the build. 538# As such, for these rules, we use pattern replacement to explicitly 539# avoid triggering the dependency information. Note that for clean and 540# clobber, we must use $(NOWAIT_SUBDIRS) rather than 541# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'. 542# 543 544all: $(SUBDIRS) 545 546install: $(SUBDIRS) .WAIT install_extra 547 548# extra libraries kept in other source areas 549install_extra: 550 @cd ../cmd/sgs; pwd; $(MAKE) install_lib 551 @pwd 552 553clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend) 554 555 556install_h check: $(HDRSUBDIRS:%=%-nodepend) 557 558_msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc 559 560_dc: $(DCSUBDIRS:%=%-nodepend) 561 562lint: 563 564# Library interdependencies are called out explicitly here. 565../cmd/sgs/libconv: crt 566../cmd/sgs/libdl: crt 567libc: ../cmd/sgs/libconv ../cmd/sgs/libdl 568 569libm: libc 570libmd: libc 571libmp: libc 572libnsl: libc libmd libmp 573libnvpair: libc libnsl 574libsocket: libc libnsl 575 576basedeps: libc libm libmd libmp libnsl libnvpair libsocket 577basedeps := TARGET=install 578 579# The following dependencies are currently required by libdbus-1 and should 580# be used for anything linking against it. 581dbusdeps: libsecdb libtsol libinetutil libscf libuutil libgen libsmbios \ 582 libbsm 583 584# The following dependencies don't need to be listed below as they are built 585# before everything else: 586# libc libm libmd libmp libnsl libnvpair libsocket 587../cmd/sendmail/libmilter: libsocket libnsl 588abi: libctf libmapmalloc libproc 589auditd_plugins: libbsm libsecdb libgss libmtmalloc 590brand: libzonecfg libmapmalloc 591cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf 592fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \ 593 libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \ 594 libpcidb libdiskmgt 595$(SPARC_BLD)fm: libpri 596gss_mechs/mech_dh: libgss 597gss_mechs/mech_dummy: libgss 598gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat 599gss_mechs/mech_spnego: gss_mechs/mech_krb5 600hal: dbusdeps 601krb5: gss_mechs/mech_krb5 libtecla libldap5 602libads: libnsl 603libadt_jni: libbsm 604libadutils: libldap5 libresolv2 605libbe: libzfs libinstzones libuuid libgen libdevinfo libefi libficl 606libbsm: libinetutil libscf libsecdb libtsol 607libcfgadm: libdevinfo 608libcontract: libnvpair 609libcmd: libsum libast 610libcmdutils: libavl libnvpair 611libcpc: libpctx 612libcrypt: libgen 613libctf: libdwarf 614libdemangle: libcustr 615libdevice: libnvpair 616libdevid: libdevinfo 617libdevinfo: libsec libgen 618libdhcpagent: libdhcputil libuuid libdlpi libcontract 619libdhcputil: libgen libinetutil libdlpi 620libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent 621$(INTEL_BLD)libdiskmgt: libfdisk 622libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \ 623 libpool 624libdll: libast 625libdlpi: libinetutil libdladm 626libds: libsysevent 627libdtrace: libproc libgen libctf libmapmalloc 628libdtrace_jni: libuutil libdtrace 629libdwarf: ../cmd/sgs/libelf 630libefi: libuuid libsmbios 631libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf 632libeti: libcurses 633libexacct/demo: libexacct libproject 634libfakekernel: libumem libcryptoutil 635libfcoe: libdladm 636libficl: libuuid libumem 637libfru: libfruutils 638libfsmgt: libkstat 639libgrubmgmt: libdevinfo libzfs libfstyp libefi 640$(INTEL_BLD)libgrubmgmt: libfdisk 641libidmap: libavl libuutil 642libinetsvc: libscf 643libinetutil: libsocket 644libinstzones: libzonecfg libcontract 645libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil 646libipmi: libm libnvpair libsocket libnsl 647libipmp: libinetutil 648libipsecutil: libtecla libtsol libkmf 649libiscsit: libstmf libuuid 650libhotplug: libnvpair 651libkmf: libcryptoutil pkcs11 libcustr 652libkvm: ../cmd/sgs/libelf 653libldap5: libsasl 654libmapid: libresolv2 libscf 655libmlrpc: libsmbfs libuuid 656libndmp: libscf 657libnisdb: libldap5 658libnwam: libscf libbsm libdladm libipadm 659libpcp: libumem libdevinfo 660libpctx: libproc 661libpkg: libscf libadm 662libpool: libscf libexacct 663libpp: libast 664libppt: libpcidb libdevinfo libcmdutils 665libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf 666$(INTEL_BLD)libproc: libsaveargs 667libproject: libpool libproc libsecdb 668libprtdiag: libkstat libdevinfo 669libprtdiag_psr: libprtdiag 670libraidcfg: libdevinfo 671librcm: libnvpair 672librestart: libuutil libscf libpool libproject libsecdb libsysevent 673libsasl: libgss pkcs11 674libsaveargs: libdisasm 675libscf: libuutil libgen libnsl libnvpair libsmbios 676libsec: libavl libidmap 677libsecdb: libnsl 678libsff: libnvpair 679libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs 680libshell: libast libcmd libdll libsecdb 681libsip: libmd5 682libsldap: libldap5 libscf 683libsmbfs: libkrb5 libsec libidmap pkcs11 684libsmbios: libdevinfo 685libsrpt: libstmf 686libstmf: libscf 687libstmfproxy: libstmf libpthread 688libsum: libast 689libsun_ima: libdevinfo libsysevent 690libsysevent: libsecdb 691libtecla: libcurses 692libtermcap: libcurses 693libtnfctl: ../cmd/sgs/libelf 694libtsalarm: libpcp 695libtsnet: libtsol libsecdb 696libtsol: libsecdb 697libuuid: libdlpi 698libv12n: libds libuuid 699libvmm: libvmmapi 700libvolmgt: libadm 701libvrrpadm: libdladm libscf 702libvscan: libscf libsecdb 703libzfs: libdevid libgen libuutil libavl libefi libidmap \ 704 libumem libtsol libzfs_core libcryptoutil pkcs11 libmd libzutil 705libzfs_core: libnvpair 706libzfs_jni: libdiskmgt libzfs libzutil 707libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \ 708 libuutil libbsm libsecdb 709libzonestat: libcmdutils libumem 710libzpool: libavl libumem libcmdutils libsysevent libfakekernel libzutil 711libzutil: libadm libavl libdevid libefi 712madv: libgen 713mpapi: libpthread libdevinfo libsysevent 714mpss: libgen 715nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap 716pam_modules: libproject passwdutil smbsrv libtsnet libpam libbsm libsecdb 717passwdutil: libsldap 718pkcs11: libcryptoutil libgen libuuid 719policykit: dbusdeps 720print: libldap5 libmd5 libsendfile 721pylibbe: libbe libzfs 722pysolaris: libsec libidmap 723pyzfs: libzfs 724raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree 725rpcsec_gss: libgss 726sasl_plugins: pkcs11 libgss libsasl 727scsi: libfru libumem libdevid libdevinfo 728smbclnt: libfakekernel pkcs11 729smbsrv: libxnet libpthread librt libshare libidmap pkcs11 libsqlite \ 730 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \ 731 libuuid libfakekernel libads libgss libldap5 krb5 libmlrpc 732storage: libdevice libdevinfo libdevid 733sun_fc: libdevinfo libsysevent 734sun_sas: libdevinfo libsysevent libkstat libdevid 735udapl: libdevinfo libdladm 736 737# 738# The reason this rule checks for the existence of the 739# Makefile is that some of the directories do not exist 740# in certain situations (e.g., exportable source builds, 741# OpenSolaris). 742# 743$(SUBDIRS): FRC 744 @if [ -f $@/Makefile ]; then \ 745 cd $@; pwd; $(MAKE) $(TARGET); \ 746 else \ 747 true; \ 748 fi 749 750$(SUBDIRS:%=%-nodepend): 751 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \ 752 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \ 753 else \ 754 true; \ 755 fi 756 757FRC: 758