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