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