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 2015 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 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
  28 # Copyright 2014 Andrew Stormont.
  29 
  30 include ../Makefile.master
  31 
  32 #
  33 #       Note that the commands 'lp', and 'perl' are first in
  34 #       the list, violating alphabetical order.  This is because they are very
  35 #       long-running and should be given the most wall-clock time for a
  36 #       parallel build.
  37 #
  38 #       Commands in the FIRST_SUBDIRS list are built before starting the build
  39 #       of other commands.  Currently this includes only 'isaexec' and
  40 #       'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
  41 #       $(ROOT)/usr/lib/platexec must exist when some other commands are built
  42 #       because their 'make install' creates a hard link to one of them.
  43 #
  44 #       Commands are listed one per line so that TeamWare can auto-merge most
  45 #       changes.
  46 #
  47 
  48 FIRST_SUBDIRS=          \
  49         isaexec         \
  50         platexec
  51 
  52 COMMON_SUBDIRS=         \
  53         allocate        \
  54         availdevs       \
  55         lp              \
  56         perl            \
  57         Adm             \
  58         abi             \
  59         adbgen          \
  60         acct            \
  61         acctadm         \
  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         bnu             \
  79         boot            \
  80         busstat         \
  81         cal             \
  82         calendar        \
  83         captoinfo       \
  84         cat             \
  85         cdrw            \
  86         cfgadm          \
  87         checkeq         \
  88         checknr         \
  89         chgrp           \
  90         chmod           \
  91         chown           \
  92         chroot          \
  93         clear           \
  94         clinfo          \
  95         cmd-crypto      \
  96         cmd-inet        \
  97         col             \
  98         compress        \
  99         consadm         \
 100         coreadm         \
 101         cpio            \
 102         cpc             \
 103         cron            \
 104         crypt           \
 105         csh             \
 106         csplit          \
 107         ctrun           \
 108         ctstat          \
 109         ctwatch         \
 110         datadm          \
 111         date            \
 112         dc              \
 113         dd              \
 114         deroff          \
 115         devfsadm        \
 116         syseventd       \
 117         devctl          \
 118         devinfo         \
 119         devmgmt         \
 120         devprop         \
 121         dfs.cmds        \
 122         diff            \
 123         diff3           \
 124         diffmk          \
 125         dircmp          \
 126         dirname         \
 127         dis             \
 128         diskmgtd        \
 129         dispadmin       \
 130         dladm           \
 131         dlstat          \
 132         dmesg           \
 133         dodatadm        \
 134         dtrace          \
 135         du              \
 136         dumpadm         \
 137         dumpcs          \
 138         echo            \
 139         ed              \
 140         eeprom          \
 141         egrep           \
 142         eject           \
 143         emul64ioctl     \
 144         enhance         \
 145         env             \
 146         eqn             \
 147         expand          \
 148         expr            \
 149         exstr           \
 150         factor          \
 151         false           \
 152         fcinfo          \
 153         fcoesvc         \
 154         fdetach         \
 155         fdformat        \
 156         fdisk           \
 157         filesync        \
 158         fgrep           \
 159         file            \
 160         find            \
 161         flowadm         \
 162         flowstat        \
 163         fm              \
 164         fmt             \
 165         fmthard         \
 166         fmtmsg          \
 167         fold            \
 168         format          \
 169         fs.d            \
 170         fstyp           \
 171         fuser           \
 172         fwflash         \
 173         gcore           \
 174         gencat          \
 175         geniconvtbl     \
 176         genmsg          \
 177         getconf         \
 178         getdevpolicy    \
 179         getent          \
 180         getfacl         \
 181         getmajor        \
 182         getopt          \
 183         gettext         \
 184         gettxt          \
 185         grep            \
 186         grep_xpg4       \
 187         groups          \
 188         grpck           \
 189         gss             \
 190         hal             \
 191         halt            \
 192         head            \
 193         hostid          \
 194         hostname        \
 195         hotplug         \
 196         hotplugd        \
 197         hwdata          \
 198         ibd_upgrade     \
 199         id              \
 200         idmap           \
 201         infocmp         \
 202         init            \
 203         initpkg         \
 204         install.d       \
 205         intrd           \
 206         intrstat        \
 207         ipcrm           \
 208         ipcs            \
 209         ipdadm          \
 210         ipf             \
 211         isainfo         \
 212         isalist         \
 213         itutools        \
 214         iscsiadm        \
 215         iscsid          \
 216         iscsitsvc       \
 217         isns            \
 218         itadm           \
 219         kbd             \
 220         keyserv         \
 221         killall         \
 222         krb5            \
 223         ksh             \
 224         kvmstat         \
 225         last            \
 226         lastcomm        \
 227         latencytop      \
 228         ldap            \
 229         ldapcachemgr    \
 230         lgrpinfo        \
 231         line            \
 232         link            \
 233         dlmgmtd         \
 234         listen          \
 235         loadkeys        \
 236         locale          \
 237         localedef       \
 238         lockstat        \
 239         locator         \
 240         lofiadm         \
 241         logadm          \
 242         logger          \
 243         login           \
 244         logins          \
 245         look            \
 246         ls              \
 247         luxadm          \
 248         lvm             \
 249         mach            \
 250         mail            \
 251         mailwrapper     \
 252         mailx           \
 253         make            \
 254         makekey         \
 255         man             \
 256         mandoc          \
 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         uuidgen         \
 437         valtools        \
 438         vgrind          \
 439         vi              \
 440         volcheck        \
 441         vrrpadm         \
 442         vscan           \
 443         vt              \
 444         w               \
 445         wall            \
 446         which           \
 447         who             \
 448         whodo           \
 449         wracct          \
 450         write           \
 451         xargs           \
 452         xstr            \
 453         yes             \
 454         ypcmd           \
 455         yppasswd        \
 456         zdb             \
 457         zdump           \
 458         zfs             \
 459         zhack           \
 460         zic             \
 461         zinject         \
 462         zlogin          \
 463         zoneadm         \
 464         zoneadmd        \
 465         zonecfg         \
 466         zonename        \
 467         zpool           \
 468         zlook           \
 469         zonestat        \
 470         zstreamdump     \
 471         ztest
 472 
 473 i386_SUBDIRS=           \
 474         acpihpd         \
 475         addbadsec       \
 476         biosdev         \
 477         diskscan        \
 478         lms             \
 479         rtc             \
 480         ucodeadm        \
 481         xvm
 482 
 483 sparc_SUBDIRS=          \
 484         cvcd            \
 485         dcs             \
 486         device_remap    \
 487         drd             \
 488         fruadm          \
 489         ldmad           \
 490         oplhpd          \
 491         prtdscp         \
 492         prtfru          \
 493         scadm           \
 494         sckmd           \
 495         sf880drd        \
 496         virtinfo        \
 497         vntsd
 498 
 499 #
 500 # Commands that are messaged.  Note that 'lp' comes first
 501 # (see previous comment about 'lp'.)
 502 #
 503 MSGSUBDIRS=             \
 504         lp              \
 505         abi             \
 506         acctadm         \
 507         allocate        \
 508         asa             \
 509         audio           \
 510         audit           \
 511         auditconfig     \
 512         auditd          \
 513         auditrecord     \
 514         auditset        \
 515         auths           \
 516         autopush        \
 517         avs             \
 518         awk             \
 519         awk_xpg4        \
 520         backup          \
 521         banner          \
 522         bart            \
 523         basename        \
 524         beadm           \
 525         bnu             \
 526         busstat         \
 527         cal             \
 528         cat             \
 529         cdrw            \
 530         cfgadm          \
 531         checkeq         \
 532         checknr         \
 533         chgrp           \
 534         chmod           \
 535         chown           \
 536         cmd-crypto      \
 537         cmd-inet        \
 538         col             \
 539         compress        \
 540         consadm         \
 541         coreadm         \
 542         cpio            \
 543         cpc             \
 544         cron            \
 545         csh             \
 546         csplit          \
 547         ctrun           \
 548         ctstat          \
 549         ctwatch         \
 550         datadm          \
 551         date            \
 552         dc              \
 553         dcs             \
 554         dd              \
 555         deroff          \
 556         devfsadm        \
 557         dfs.cmds        \
 558         diff            \
 559         diffmk          \
 560         dladm           \
 561         dlstat          \
 562         du              \
 563         dumpcs          \
 564         ed              \
 565         eject           \
 566         env             \
 567         eqn             \
 568         expand          \
 569         expr            \
 570         fcinfo          \
 571         fgrep           \
 572         file            \
 573         filesync        \
 574         find            \
 575         flowadm         \
 576         flowstat        \
 577         fm              \
 578         fold            \
 579         fs.d            \
 580         fwflash         \
 581         geniconvtbl     \
 582         genmsg          \
 583         getconf         \
 584         getent          \
 585         gettext         \
 586         gettxt          \
 587         grep            \
 588         grep_xpg4       \
 589         grpck           \
 590         gss             \
 591         halt            \
 592         head            \
 593         hostname        \
 594         hotplug         \
 595         id              \
 596         idmap           \
 597         isaexec         \
 598         iscsiadm        \
 599         iscsid          \
 600         isns            \
 601         itadm           \
 602         kbd             \
 603         krb5            \
 604         ksh             \
 605         last            \
 606         ldap            \
 607         ldapcachemgr    \
 608         lgrpinfo        \
 609         locale          \
 610         lofiadm         \
 611         logadm          \
 612         logger          \
 613         logins          \
 614         ls              \
 615         luxadm          \
 616         lvm             \
 617         mailx           \
 618         make            \
 619         man             \
 620         mesg            \
 621         mkdir           \
 622         mkpwdict        \
 623         mktemp          \
 624         more            \
 625         mpathadm        \
 626         msgfmt          \
 627         mv              \
 628         ndmpadm         \
 629         ndmpstat        \
 630         newgrp          \
 631         newtask         \
 632         nice            \
 633         nohup           \
 634         oawk            \
 635         pack            \
 636         passwd          \
 637         passmgmt        \
 638         pathchk         \
 639         pfexec          \
 640         pg              \
 641         pgrep           \
 642         picl            \
 643         pools           \
 644         power           \
 645         pr              \
 646         praudit         \
 647         print           \
 648         profiles        \
 649         projadd         \
 650         projects        \
 651         prstat          \
 652         prtdiag         \
 653         ps              \
 654         psrinfo         \
 655         ptools          \
 656         pwconv          \
 657         pwd             \
 658         pyzfs           \
 659         raidctl         \
 660         ramdiskadm      \
 661         rcap            \
 662         rcm_daemon      \
 663         refer           \
 664         regcmp          \
 665         renice          \
 666         roles           \
 667         rm              \
 668         rmdir           \
 669         rmformat        \
 670         rmmount         \
 671         rmvolmgr        \
 672         sasinfo         \
 673         sbdadm          \
 674         scadm           \
 675         script          \
 676         scsi            \
 677         sdiff           \
 678         sdpadm          \
 679         sgs             \
 680         sh              \
 681         shcomp          \
 682         smbsrv          \
 683         sort            \
 684         split           \
 685         srptadm         \
 686         ssh             \
 687         stat            \
 688         stmfadm         \
 689         stmsboot        \
 690         strings         \
 691         su              \
 692         svc             \
 693         svr4pkg         \
 694         swap            \
 695         syseventadm     \
 696         syseventd       \
 697         tabs            \
 698         tar             \
 699         tbl             \
 700         time            \
 701         tnf             \
 702         touch           \
 703         tput            \
 704         troff           \
 705         tsol            \
 706         tty             \
 707         ttymon          \
 708         tzreload        \
 709         ul              \
 710         uname           \
 711         units           \
 712         unlink          \
 713         unpack          \
 714         userattr        \
 715         valtools        \
 716         vgrind          \
 717         vi              \
 718         volcheck        \
 719         vrrpadm         \
 720         vscan           \
 721         w               \
 722         who             \
 723         whodo           \
 724         wracct          \
 725         write           \
 726         xargs           \
 727         yppasswd        \
 728         zdump           \
 729         zfs             \
 730         zic             \
 731         zlogin          \
 732         zoneadm         \
 733         zoneadmd        \
 734         zonecfg         \
 735         zonename        \
 736         zpool           \
 737         zonestat
 738 
 739 sparc_MSGSUBDIRS=       \
 740         fruadm          \
 741         prtdscp         \
 742         prtfru          \
 743         virtinfo        \
 744         vntsd
 745 
 746 i386_MSGSUBDIRS=        \
 747         ucodeadm
 748 
 749 #
 750 # commands that use dcgettext for localized time, LC_TIME
 751 #
 752 DCSUBDIRS=              \
 753         cal             \
 754         cfgadm          \
 755         diff            \
 756         ls              \
 757         pr              \
 758         ps              \
 759         tar             \
 760         w               \
 761         who             \
 762         whodo           \
 763         write
 764 
 765 #
 766 # commands that belong only to audit.
 767 #
 768 AUDITSUBDIRS=           \
 769         amt             \
 770         audit           \
 771         audit_warn      \
 772         auditconfig     \
 773         auditd          \
 774         auditrecord     \
 775         auditreduce     \
 776         auditset        \
 777         auditstat       \
 778         praudit         
 779 
 780 #
 781 # commands not owned by the systems group
 782 #
 783 BWOSDIRS=
 784 
 785 
 786 all :=          TARGET = all
 787 install :=      TARGET = install
 788 clean :=        TARGET = clean
 789 clobber :=      TARGET = clobber
 790 lint :=         TARGET = lint
 791 _msg :=         TARGET = _msg
 792 _dc :=          TARGET = _dc
 793 
 794 .KEEP_STATE:
 795 
 796 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 797 
 798 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 799 
 800 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 801         $(AUDITSUBDIRS)
 802 
 803 #
 804 # Manifests cannot be checked in parallel, because we are using
 805 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 806 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 807 # we spawn off a sub-make to perform the non-parallel 'make check'
 808 #
 809 check:
 810         $(MAKE) -f Makefile.check check
 811 
 812 #
 813 # The .WAIT directive works around an apparent bug in parallel make.
 814 # Evidently make was getting the target _msg vs. _dc confused under
 815 # some level of parallelization, causing some of the _dc objects
 816 # not to be built.
 817 #
 818 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 819 
 820 _dc: $(DCSUBDIRS)
 821 
 822 #
 823 # Dependencies
 824 #
 825 fs.d: fstyp
 826 ksh:    shcomp isaexec
 827 mdb:    terminfo
 828 print:  lp
 829 fmt:    mailx
 830 
 831 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 832         @if [ -f $@/Makefile  ]; then \
 833                 cd $@; pwd; $(MAKE) $(TARGET); \
 834         else \
 835                 true; \
 836         fi
 837 
 838 FRC: