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         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         bfs             \
  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         java            \
 220         kbd             \
 221         keyserv         \
 222         killall         \
 223         krb5            \
 224         ksh             \
 225         kvmstat         \
 226         last            \
 227         lastcomm        \
 228         latencytop      \
 229         ldap            \
 230         ldapcachemgr    \
 231         lgrpinfo        \
 232         line            \
 233         link            \
 234         dlmgmtd         \
 235         listen          \
 236         loadkeys        \
 237         locale          \
 238         localedef       \
 239         lockstat        \
 240         locator         \
 241         lofiadm         \
 242         logadm          \
 243         logger          \
 244         login           \
 245         logins          \
 246         look            \
 247         ls              \
 248         luxadm          \
 249         lvm             \
 250         mach            \
 251         machid          \
 252         mail            \
 253         mailx           \
 254         makekey         \
 255         mdb             \
 256         mesg            \
 257         mkdir           \
 258         mkfifo          \
 259         mkfile          \
 260         mkmsgs          \
 261         mknod           \
 262         mkpwdict        \
 263         mktemp          \
 264         modload         \
 265         more            \
 266         mpathadm        \
 267         msgfmt          \
 268         msgid           \
 269         mt              \
 270         mv              \
 271         mvdir           \
 272         ndmpadm         \
 273         ndmpd           \
 274         ndmpstat        \
 275         netadm          \
 276         netfiles        \
 277         newform         \
 278         newgrp          \
 279         news            \
 280         newtask         \
 281         nice            \
 282         nl              \
 283         nlsadmin        \
 284         nohup           \
 285         nsadmin         \
 286         nscd            \
 287         oamuser         \
 288         oawk            \
 289         od              \
 290         pack            \
 291         pagesize        \
 292         passmgmt        \
 293         passwd          \
 294         pathchk         \
 295         pbind           \
 296         pcidr           \
 297         pcitool         \
 298         pfexec          \
 299         pfexecd         \
 300         pginfo          \
 301         pgstat          \
 302         pgrep           \
 303         picl            \
 304         plimit          \
 305         policykit       \
 306         pools           \
 307         power           \
 308         powertop        \
 309         ppgsz           \
 310         pg              \
 311         plockstat       \
 312         pr              \
 313         prctl           \
 314         print           \
 315         printf          \
 316         priocntl        \
 317         profiles        \
 318         projadd         \
 319         projects        \
 320         prstat          \
 321         prtconf         \
 322         prtdiag         \
 323         prtvtoc         \
 324         ps              \
 325         psradm          \
 326         psrinfo         \
 327         psrset          \
 328         ptools          \
 329         pwck            \
 330         pwconv          \
 331         pwd             \
 332         pyzfs           \
 333         raidctl         \
 334         ramdiskadm      \
 335         rcap            \
 336         rcm_daemon      \
 337         rctladm         \
 338         refer           \
 339         regcmp          \
 340         renice          \
 341         rexd            \
 342         rm              \
 343         rmdir           \
 344         rmformat        \
 345         rmmount         \
 346         rmt             \
 347         rmvolmgr        \
 348         roles           \
 349         rpcbind         \
 350         rpcgen          \
 351         rpcinfo         \
 352         rpcsvc          \
 353         runat           \
 354         sa              \
 355         saf             \
 356         sasinfo         \
 357         savecore        \
 358         sbdadm          \
 359         script          \
 360         scsi            \
 361         sdiff           \
 362         sdpadm          \
 363         sed             \
 364         sendmail        \
 365         setfacl         \
 366         setmnt          \
 367         setpgrp         \
 368         setuname        \
 369         sgs             \
 370         sh              \
 371         shcomp          \
 372         smbios          \
 373         smbsrv          \
 374         smserverd       \
 375         soelim          \
 376         sort            \
 377         spell           \
 378         split           \
 379         sqlite          \
 380         srchtxt         \
 381         srptadm         \
 382         srptsvc         \
 383         ssh             \
 384         stat            \
 385         stmfadm         \
 386         stmfproxy       \
 387         stmfsvc         \
 388         stmsboot        \
 389         streams         \
 390         strings         \
 391         su              \
 392         sulogin         \
 393         sunpc           \
 394         svc             \
 395         svr4pkg         \
 396         swap            \
 397         sync            \
 398         sysdef          \
 399         syseventadm     \
 400         syslogd         \
 401         tabs            \
 402         tail            \
 403         tar             \
 404         tbl             \
 405         tcopy           \
 406         tcpd            \
 407         terminfo        \
 408         th_tools        \
 409         tic             \
 410         time            \
 411         tip             \
 412         tnf             \
 413         touch           \
 414         tput            \
 415         tr              \
 416         trapstat        \
 417         troff           \
 418         true            \
 419         truss           \
 420         tsol            \
 421         tty             \
 422         ttymon          \
 423         tzreload        \
 424         uadmin          \
 425         ul              \
 426         uname           \
 427         units           \
 428         unlink          \
 429         unpack          \
 430         userattr        \
 431         users           \
 432         utmp_update     \
 433         utmpd           \
 434         valtools        \
 435         vgrind          \
 436         vi              \
 437         volcheck        \
 438         volrmmount      \
 439         vrrpadm         \
 440         vscan           \
 441         vt              \
 442         w               \
 443         wall            \
 444         which           \
 445         who             \
 446         whodo           \
 447         wracct          \
 448         write           \
 449         wusbadm         \
 450         xargs           \
 451         xstr            \
 452         yes             \
 453         ypcmd           \
 454         yppasswd        \
 455         zdb             \
 456         zdump           \
 457         zfs             \
 458         zhack           \
 459         zic             \
 460         zinject         \
 461         zlogin          \
 462         zoneadm         \
 463         zoneadmd        \
 464         zonecfg         \
 465         zonename        \
 466         zpool           \
 467         zlook           \
 468         zonestat        \
 469         zstreamdump     \
 470         ztest
 471 
 472 i386_SUBDIRS=           \
 473         acpihpd         \
 474         addbadsec       \
 475         biosdev         \
 476         diskscan        \
 477         lms             \
 478         rtc             \
 479         ucodeadm        \
 480         xvm
 481 
 482 sparc_SUBDIRS=          \
 483         cvcd            \
 484         dcs             \
 485         device_remap    \
 486         drd             \
 487         fruadm          \
 488         ldmad           \
 489         oplhpd          \
 490         prtdscp         \
 491         prtfru          \
 492         scadm           \
 493         sckmd           \
 494         sf880drd        \
 495         virtinfo        \
 496         vntsd
 497 
 498 #
 499 # Commands that are messaged.  Note that 'lp' and 'man' come first
 500 # (see previous comment about 'lp' and 'man').
 501 #
 502 MSGSUBDIRS=             \
 503         lp              \
 504         man             \
 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         mesg            \
 619         mkdir           \
 620         mkpwdict        \
 621         mktemp          \
 622         more            \
 623         mpathadm        \
 624         msgfmt          \
 625         mv              \
 626         ndmpadm         \
 627         ndmpstat        \
 628         newgrp          \
 629         newtask         \
 630         nice            \
 631         nohup           \
 632         oawk            \
 633         pack            \
 634         passwd          \
 635         passmgmt        \
 636         pathchk         \
 637         pfexec          \
 638         pg              \
 639         pgrep           \
 640         picl            \
 641         pools           \
 642         power           \
 643         pr              \
 644         praudit         \
 645         print           \
 646         profiles        \
 647         projadd         \
 648         projects        \
 649         prstat          \
 650         prtdiag         \
 651         ps              \
 652         psrinfo         \
 653         ptools          \
 654         pwconv          \
 655         pwd             \
 656         pyzfs           \
 657         raidctl         \
 658         ramdiskadm      \
 659         rcap            \
 660         rcm_daemon      \
 661         refer           \
 662         regcmp          \
 663         renice          \
 664         roles           \
 665         rm              \
 666         rmdir           \
 667         rmformat        \
 668         rmmount         \
 669         rmvolmgr        \
 670         sasinfo         \
 671         sbdadm          \
 672         scadm           \
 673         script          \
 674         scsi            \
 675         sdiff           \
 676         sdpadm          \
 677         sgs             \
 678         sh              \
 679         shcomp          \
 680         smbsrv          \
 681         sort            \
 682         split           \
 683         srptadm         \
 684         ssh             \
 685         stat            \
 686         stmfadm         \
 687         stmsboot        \
 688         strings         \
 689         su              \
 690         svc             \
 691         svr4pkg         \
 692         swap            \
 693         syseventadm     \
 694         syseventd       \
 695         tabs            \
 696         tar             \
 697         tbl             \
 698         time            \
 699         tnf             \
 700         touch           \
 701         tput            \
 702         troff           \
 703         tsol            \
 704         tty             \
 705         ttymon          \
 706         tzreload        \
 707         ul              \
 708         uname           \
 709         units           \
 710         unlink          \
 711         unpack          \
 712         userattr        \
 713         valtools        \
 714         vgrind          \
 715         vi              \
 716         volcheck        \
 717         volrmmount      \
 718         vrrpadm         \
 719         vscan           \
 720         w               \
 721         who             \
 722         whodo           \
 723         wracct          \
 724         write           \
 725         wusbadm         \
 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 
 830 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 831         @if [ -f $@/Makefile  ]; then \
 832                 cd $@; pwd; $(MAKE) $(TARGET); \
 833         else \
 834                 true; \
 835         fi
 836 
 837 FRC: