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