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