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 2010 Nexenta Systems, Inc.  All rights reserved.
  24 # Copyright (c) 2012 Joyent, Inc.  All rights reserved.
  25 # Copyright (c) 2012 by Delphix. All rights reserved.
  26 # Copyright (c) 2013 DEY Storage Systems, Inc. All rights reserved.
  27 
  28 include ../Makefile.master
  29 
  30 #
  31 #       Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
  32 #       the list, violating alphabetical order.  This is because they are very
  33 #       long-running and should be given the most wall-clock time for a
  34 #       parallel build.
  35 #
  36 #       Commands in the FIRST_SUBDIRS list are built before starting the build
  37 #       of other commands.  Currently this includes only 'isaexec' and
  38 #       'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
  39 #       $(ROOT)/usr/lib/platexec must exist when some other commands are built
  40 #       because their 'make install' creates a hard link to one of them.
  41 #
  42 #       Commands are listed one per line so that TeamWare can auto-merge most
  43 #       changes.
  44 #
  45 
  46 FIRST_SUBDIRS=          \
  47         isaexec         \
  48         platexec
  49 
  50 COMMON_SUBDIRS=         \
  51         allocate        \
  52         availdevs       \
  53         lp              \
  54         perl            \
  55         man             \
  56         Adm             \
  57         abi             \
  58         adbgen          \
  59         acct            \
  60         acctadm         \
  61         acpitools       \
  62         arch            \
  63         asa             \
  64         ast             \
  65         audio           \
  66         auths           \
  67         autopush        \
  68         avs             \
  69         awk             \
  70         awk_xpg4        \
  71         backup          \
  72         banner          \
  73         bart            \
  74         basename        \
  75         bc              \
  76         bdiff           \
  77         beadm           \
  78         bfs             \
  79         bnu             \
  80         boot            \
  81         busstat         \
  82         cal             \
  83         calendar        \
  84         captoinfo       \
  85         cat             \
  86         cdrw            \
  87         cfgadm          \
  88         checkeq         \
  89         checknr         \
  90         chgrp           \
  91         chmod           \
  92         chown           \
  93         chroot          \
  94         clear           \
  95         clinfo          \
  96         cmd-crypto      \
  97         cmd-inet        \
  98         col             \
  99         compress        \
 100         consadm         \
 101         coreadm         \
 102         cpio            \
 103         cpc             \
 104         cron            \
 105         crypt           \
 106         csh             \
 107         csplit          \
 108         ctrun           \
 109         ctstat          \
 110         ctwatch         \
 111         datadm          \
 112         date            \
 113         dc              \
 114         dd              \
 115         deroff          \
 116         devfsadm        \
 117         syseventd       \
 118         devctl          \
 119         devinfo         \
 120         devmgmt         \
 121         devprop         \
 122         dfs.cmds        \
 123         diff            \
 124         diff3           \
 125         diffmk          \
 126         dircmp          \
 127         dirname         \
 128         dis             \
 129         diskmgtd        \
 130         dispadmin       \
 131         dladm           \
 132         dlstat          \
 133         dmesg           \
 134         dodatadm        \
 135         dtrace          \
 136         du              \
 137         dumpadm         \
 138         dumpcs          \
 139         echo            \
 140         ed              \
 141         eeprom          \
 142         egrep           \
 143         eject           \
 144         emul64ioctl     \
 145         enhance         \
 146         env             \
 147         eqn             \
 148         expand          \
 149         expr            \
 150         exstr           \
 151         factor          \
 152         false           \
 153         fcinfo          \
 154         fcoesvc         \
 155         fdetach         \
 156         fdformat        \
 157         fdisk           \
 158         filesync        \
 159         fgrep           \
 160         file            \
 161         filebench       \
 162         find            \
 163         flowadm         \
 164         flowstat        \
 165         fm              \
 166         fmt             \
 167         fmthard         \
 168         fmtmsg          \
 169         fold            \
 170         format          \
 171         fs.d            \
 172         fstyp           \
 173         fuser           \
 174         fwflash         \
 175         gcore           \
 176         gencat          \
 177         geniconvtbl     \
 178         genmsg          \
 179         getconf         \
 180         getdevpolicy    \
 181         getent          \
 182         getfacl         \
 183         getmajor        \
 184         getopt          \
 185         gettext         \
 186         gettxt          \
 187         grep            \
 188         grep_xpg4       \
 189         groups          \
 190         grpck           \
 191         gss             \
 192         hal             \
 193         halt            \
 194         head            \
 195         hostid          \
 196         hostname        \
 197         hotplug         \
 198         hotplugd        \
 199         hwdata          \
 200         ibd_upgrade     \
 201         id              \
 202         idmap           \
 203         infocmp         \
 204         init            \
 205         initpkg         \
 206         install.d       \
 207         intrd           \
 208         intrstat        \
 209         ipcrm           \
 210         ipcs            \
 211         ipdadm          \
 212         ipf             \
 213         isainfo         \
 214         isalist         \
 215         itutools        \
 216         iscsiadm        \
 217         iscsid          \
 218         iscsitsvc       \
 219         isns            \
 220         itadm           \
 221         java            \
 222         kbd             \
 223         keyserv         \
 224         killall         \
 225         krb5            \
 226         ksh             \
 227         kvmstat         \
 228         last            \
 229         lastcomm        \
 230         latencytop      \
 231         ldap            \
 232         ldapcachemgr    \
 233         lgrpinfo        \
 234         line            \
 235         link            \
 236         dlmgmtd         \
 237         listen          \
 238         loadkeys        \
 239         locale          \
 240         localedef       \
 241         lockstat        \
 242         locator         \
 243         lofiadm         \
 244         logadm          \
 245         logger          \
 246         login           \
 247         logins          \
 248         look            \
 249         ls              \
 250         luxadm          \
 251         lvm             \
 252         mach            \
 253         machid          \
 254         mail            \
 255         mailx           \
 256         makekey         \
 257         mdb             \
 258         mesg            \
 259         mkdir           \
 260         mkfifo          \
 261         mkfile          \
 262         mkmsgs          \
 263         mknod           \
 264         mkpwdict        \
 265         mktemp          \
 266         modload         \
 267         more            \
 268         mpathadm        \
 269         msgfmt          \
 270         msgid           \
 271         mt              \
 272         mv              \
 273         mvdir           \
 274         ndmpadm         \
 275         ndmpd           \
 276         ndmpstat        \
 277         netadm          \
 278         netfiles        \
 279         newform         \
 280         newgrp          \
 281         news            \
 282         newtask         \
 283         nice            \
 284         nl              \
 285         nlsadmin        \
 286         nohup           \
 287         nsadmin         \
 288         nscd            \
 289         oamuser         \
 290         oawk            \
 291         od              \
 292         pack            \
 293         pagesize        \
 294         passmgmt        \
 295         passwd          \
 296         pathchk         \
 297         pbind           \
 298         pcidr           \
 299         pcitool         \
 300         pfexec          \
 301         pfexecd         \
 302         pginfo          \
 303         pgstat          \
 304         pgrep           \
 305         picl            \
 306         plimit          \
 307         policykit       \
 308         pools           \
 309         power           \
 310         powertop        \
 311         ppgsz           \
 312         pg              \
 313         plockstat       \
 314         pr              \
 315         prctl           \
 316         print           \
 317         printf          \
 318         priocntl        \
 319         profiles        \
 320         projadd         \
 321         projects        \
 322         prstat          \
 323         prtconf         \
 324         prtdiag         \
 325         prtvtoc         \
 326         ps              \
 327         psradm          \
 328         psrinfo         \
 329         psrset          \
 330         ptools          \
 331         pwck            \
 332         pwconv          \
 333         pwd             \
 334         pyzfs           \
 335         raidctl         \
 336         ramdiskadm      \
 337         rcap            \
 338         rcm_daemon      \
 339         rctladm         \
 340         refer           \
 341         regcmp          \
 342         renice          \
 343         rexd            \
 344         rm              \
 345         rmdir           \
 346         rmformat        \
 347         rmmount         \
 348         rmt             \
 349         rmvolmgr        \
 350         roles           \
 351         rpcbind         \
 352         rpcgen          \
 353         rpcinfo         \
 354         rpcsvc          \
 355         runat           \
 356         sa              \
 357         saf             \
 358         sasinfo         \
 359         savecore        \
 360         sbdadm          \
 361         script          \
 362         scsi            \
 363         sdiff           \
 364         sdpadm          \
 365         sed             \
 366         sendmail        \
 367         setfacl         \
 368         setmnt          \
 369         setpgrp         \
 370         setuname        \
 371         sgs             \
 372         sh              \
 373         shcomp          \
 374         smbios          \
 375         smbsrv          \
 376         smserverd       \
 377         soelim          \
 378         sort            \
 379         spell           \
 380         split           \
 381         sqlite          \
 382         srchtxt         \
 383         srptadm         \
 384         srptsvc         \
 385         ssh             \
 386         stat            \
 387         stmfadm         \
 388         stmfproxy       \
 389         stmfsvc         \
 390         stmsboot        \
 391         streams         \
 392         strings         \
 393         su              \
 394         sulogin         \
 395         sunpc           \
 396         svc             \
 397         svr4pkg         \
 398         swap            \
 399         sync            \
 400         sysdef          \
 401         syseventadm     \
 402         syslogd         \
 403         tabs            \
 404         tail            \
 405         tar             \
 406         tbl             \
 407         tcopy           \
 408         tcpd            \
 409         terminfo        \
 410         th_tools        \
 411         tic             \
 412         time            \
 413         tip             \
 414         tnf             \
 415         touch           \
 416         tput            \
 417         tr              \
 418         trapstat        \
 419         troff           \
 420         true            \
 421         truss           \
 422         tsol            \
 423         tty             \
 424         ttymon          \
 425         tzreload        \
 426         uadmin          \
 427         ul              \
 428         uname           \
 429         units           \
 430         unlink          \
 431         unpack          \
 432         userattr        \
 433         users           \
 434         utmp_update     \
 435         utmpd           \
 436         valtools        \
 437         vgrind          \
 438         vi              \
 439         volcheck        \
 440         volrmmount      \
 441         vrrpadm         \
 442         vscan           \
 443         vt              \
 444         w               \
 445         wall            \
 446         which           \
 447         who             \
 448         whodo           \
 449         wracct          \
 450         write           \
 451         wusbadm         \
 452         xargs           \
 453         xstr            \
 454         yes             \
 455         ypcmd           \
 456         yppasswd        \
 457         zdb             \
 458         zdump           \
 459         zfs             \
 460         zhack           \
 461         zic             \
 462         zinject         \
 463         zlogin          \
 464         zoneadm         \
 465         zoneadmd        \
 466         zonecfg         \
 467         zonename        \
 468         zpool           \
 469         zlook           \
 470         zonestat        \
 471         zstreamdump     \
 472         ztest
 473 
 474 i386_SUBDIRS=           \
 475         acpihpd         \
 476         addbadsec       \
 477         biosdev         \
 478         diskscan        \
 479         lms             \
 480         ntfsprogs       \
 481         parted          \
 482         rtc             \
 483         ucodeadm        \
 484         xvm
 485 
 486 sparc_SUBDIRS=          \
 487         cvcd            \
 488         dcs             \
 489         device_remap    \
 490         drd             \
 491         fruadm          \
 492         ldmad           \
 493         oplhpd          \
 494         prtdscp         \
 495         prtfru          \
 496         scadm           \
 497         sckmd           \
 498         sf880drd        \
 499         virtinfo        \
 500         vntsd
 501 
 502 #
 503 # Commands that are messaged.  Note that 'lp' and 'man' come first
 504 # (see previous comment about 'lp' and 'man').
 505 #
 506 MSGSUBDIRS=             \
 507         lp              \
 508         man             \
 509         abi             \
 510         acctadm         \
 511         allocate        \
 512         asa             \
 513         audio           \
 514         audit           \
 515         auditconfig     \
 516         auditd          \
 517         auditrecord     \
 518         auditset        \
 519         auths           \
 520         autopush        \
 521         avs             \
 522         awk             \
 523         awk_xpg4        \
 524         backup          \
 525         banner          \
 526         bart            \
 527         basename        \
 528         beadm           \
 529         bnu             \
 530         busstat         \
 531         cal             \
 532         cat             \
 533         cdrw            \
 534         cfgadm          \
 535         checkeq         \
 536         checknr         \
 537         chgrp           \
 538         chmod           \
 539         chown           \
 540         cmd-crypto      \
 541         cmd-inet        \
 542         col             \
 543         compress        \
 544         consadm         \
 545         coreadm         \
 546         cpio            \
 547         cpc             \
 548         cron            \
 549         csh             \
 550         csplit          \
 551         ctrun           \
 552         ctstat          \
 553         ctwatch         \
 554         datadm          \
 555         date            \
 556         dc              \
 557         dcs             \
 558         dd              \
 559         deroff          \
 560         devfsadm        \
 561         dfs.cmds        \
 562         diff            \
 563         diffmk          \
 564         dladm           \
 565         dlstat          \
 566         du              \
 567         dumpcs          \
 568         ed              \
 569         eject           \
 570         env             \
 571         eqn             \
 572         expand          \
 573         expr            \
 574         fcinfo          \
 575         fgrep           \
 576         file            \
 577         filesync        \
 578         find            \
 579         flowadm         \
 580         flowstat        \
 581         fm              \
 582         fold            \
 583         fs.d            \
 584         fwflash         \
 585         geniconvtbl     \
 586         genmsg          \
 587         getconf         \
 588         getent          \
 589         gettext         \
 590         gettxt          \
 591         grep            \
 592         grep_xpg4       \
 593         grpck           \
 594         gss             \
 595         halt            \
 596         head            \
 597         hostname        \
 598         hotplug         \
 599         id              \
 600         idmap           \
 601         isaexec         \
 602         iscsiadm        \
 603         iscsid          \
 604         isns            \
 605         itadm           \
 606         kbd             \
 607         krb5            \
 608         ksh             \
 609         last            \
 610         ldap            \
 611         ldapcachemgr    \
 612         lgrpinfo        \
 613         locale          \
 614         lofiadm         \
 615         logadm          \
 616         logger          \
 617         logins          \
 618         ls              \
 619         luxadm          \
 620         lvm             \
 621         mailx           \
 622         mesg            \
 623         mkdir           \
 624         mkpwdict        \
 625         mktemp          \
 626         more            \
 627         mpathadm        \
 628         msgfmt          \
 629         mv              \
 630         ndmpadm         \
 631         ndmpstat        \
 632         newgrp          \
 633         newtask         \
 634         nice            \
 635         nohup           \
 636         oawk            \
 637         pack            \
 638         passwd          \
 639         passmgmt        \
 640         pathchk         \
 641         pfexec          \
 642         pg              \
 643         pgrep           \
 644         picl            \
 645         pools           \
 646         power           \
 647         pr              \
 648         praudit         \
 649         print           \
 650         profiles        \
 651         projadd         \
 652         projects        \
 653         prstat          \
 654         prtdiag         \
 655         ps              \
 656         psrinfo         \
 657         ptools          \
 658         pwconv          \
 659         pwd             \
 660         pyzfs           \
 661         raidctl         \
 662         ramdiskadm      \
 663         rcap            \
 664         rcm_daemon      \
 665         refer           \
 666         regcmp          \
 667         renice          \
 668         roles           \
 669         rm              \
 670         rmdir           \
 671         rmformat        \
 672         rmmount         \
 673         rmvolmgr        \
 674         sasinfo         \
 675         sbdadm          \
 676         scadm           \
 677         script          \
 678         scsi            \
 679         sdiff           \
 680         sdpadm          \
 681         sgs             \
 682         sh              \
 683         shcomp          \
 684         smbsrv          \
 685         sort            \
 686         split           \
 687         srptadm         \
 688         ssh             \
 689         stat            \
 690         stmfadm         \
 691         stmsboot        \
 692         strings         \
 693         su              \
 694         svc             \
 695         svr4pkg         \
 696         swap            \
 697         syseventadm     \
 698         syseventd       \
 699         tabs            \
 700         tar             \
 701         tbl             \
 702         time            \
 703         tnf             \
 704         touch           \
 705         tput            \
 706         troff           \
 707         tsol            \
 708         tty             \
 709         ttymon          \
 710         tzreload        \
 711         ul              \
 712         uname           \
 713         units           \
 714         unlink          \
 715         unpack          \
 716         userattr        \
 717         valtools        \
 718         vgrind          \
 719         vi              \
 720         volcheck        \
 721         volrmmount      \
 722         vrrpadm         \
 723         vscan           \
 724         w               \
 725         who             \
 726         whodo           \
 727         wracct          \
 728         write           \
 729         wusbadm         \
 730         xargs           \
 731         yppasswd        \
 732         zdump           \
 733         zfs             \
 734         zic             \
 735         zlogin          \
 736         zoneadm         \
 737         zoneadmd        \
 738         zonecfg         \
 739         zonename        \
 740         zpool           \
 741         zonestat
 742 
 743 sparc_MSGSUBDIRS=       \
 744         fruadm          \
 745         prtdscp         \
 746         prtfru          \
 747         virtinfo        \
 748         vntsd
 749 
 750 i386_MSGSUBDIRS=        \
 751         ucodeadm
 752 
 753 #
 754 # commands that use dcgettext for localized time, LC_TIME
 755 #
 756 DCSUBDIRS=              \
 757         cal             \
 758         cfgadm          \
 759         diff            \
 760         ls              \
 761         pr              \
 762         ps              \
 763         tar             \
 764         w               \
 765         who             \
 766         whodo           \
 767         write
 768 
 769 #
 770 # commands that belong only to audit.
 771 #
 772 AUDITSUBDIRS=           \
 773         amt             \
 774         audit           \
 775         audit_warn      \
 776         auditconfig     \
 777         auditd          \
 778         auditrecord     \
 779         auditreduce     \
 780         auditset        \
 781         auditstat       \
 782         praudit         
 783 
 784 #
 785 # commands not owned by the systems group
 786 #
 787 BWOSDIRS=
 788 
 789 
 790 all :=          TARGET = all
 791 install :=      TARGET = install
 792 clean :=        TARGET = clean
 793 clobber :=      TARGET = clobber
 794 lint :=         TARGET = lint
 795 _msg :=         TARGET = _msg
 796 _dc :=          TARGET = _dc
 797 
 798 .KEEP_STATE:
 799 
 800 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 801 
 802 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 803 
 804 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 805         $(AUDITSUBDIRS)
 806 
 807 #
 808 # Manifests cannot be checked in parallel, because we are using
 809 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 810 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 811 # we spawn off a sub-make to perform the non-parallel 'make check'
 812 #
 813 check:
 814         $(MAKE) -f Makefile.check check
 815 
 816 #
 817 # The .WAIT directive works around an apparent bug in parallel make.
 818 # Evidently make was getting the target _msg vs. _dc confused under
 819 # some level of parallelization, causing some of the _dc objects
 820 # not to be built.
 821 #
 822 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 823 
 824 _dc: $(DCSUBDIRS)
 825 
 826 #
 827 # Dependencies
 828 #
 829 fs.d: fstyp
 830 ksh:    shcomp isaexec
 831 mdb:    terminfo
 832 print:  lp
 833 
 834 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 835         @if [ -f $@/Makefile  ]; then \
 836                 cd $@; pwd; $(MAKE) $(TARGET); \
 837         else \
 838                 true; \
 839         fi
 840 
 841 FRC: