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