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