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