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 # Copyright 2014 Andrew Stormont.
  28 
  29 include ../Makefile.master
  30 
  31 #
  32 #       Note that the commands 'agents', 'lp', 'perl', and 'man' 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         man             \
  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         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         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         ntfsprogs       \
 480         parted          \
 481         rtc             \
 482         ucodeadm        \
 483         xvm
 484 
 485 sparc_SUBDIRS=          \
 486         cvcd            \
 487         dcs             \
 488         device_remap    \
 489         drd             \
 490         fruadm          \
 491         ldmad           \
 492         oplhpd          \
 493         prtdscp         \
 494         prtfru          \
 495         scadm           \
 496         sckmd           \
 497         sf880drd        \
 498         virtinfo        \
 499         vntsd
 500 
 501 #
 502 # Commands that are messaged.  Note that 'lp' and 'man' come first
 503 # (see previous comment about 'lp' and 'man').
 504 #
 505 MSGSUBDIRS=             \
 506         lp              \
 507         man             \
 508         abi             \
 509         acctadm         \
 510         allocate        \
 511         asa             \
 512         audio           \
 513         audit           \
 514         auditconfig     \
 515         auditd          \
 516         auditrecord     \
 517         auditset        \
 518         auths           \
 519         autopush        \
 520         avs             \
 521         awk             \
 522         awk_xpg4        \
 523         backup          \
 524         banner          \
 525         bart            \
 526         basename        \
 527         beadm           \
 528         bnu             \
 529         busstat         \
 530         cal             \
 531         cat             \
 532         cdrw            \
 533         cfgadm          \
 534         checkeq         \
 535         checknr         \
 536         chgrp           \
 537         chmod           \
 538         chown           \
 539         cmd-crypto      \
 540         cmd-inet        \
 541         col             \
 542         compress        \
 543         consadm         \
 544         coreadm         \
 545         cpio            \
 546         cpc             \
 547         cron            \
 548         csh             \
 549         csplit          \
 550         ctrun           \
 551         ctstat          \
 552         ctwatch         \
 553         datadm          \
 554         date            \
 555         dc              \
 556         dcs             \
 557         dd              \
 558         deroff          \
 559         devfsadm        \
 560         dfs.cmds        \
 561         diff            \
 562         diffmk          \
 563         dladm           \
 564         dlstat          \
 565         du              \
 566         dumpcs          \
 567         ed              \
 568         eject           \
 569         env             \
 570         eqn             \
 571         expand          \
 572         expr            \
 573         fcinfo          \
 574         fgrep           \
 575         file            \
 576         filesync        \
 577         find            \
 578         flowadm         \
 579         flowstat        \
 580         fm              \
 581         fold            \
 582         fs.d            \
 583         fwflash         \
 584         geniconvtbl     \
 585         genmsg          \
 586         getconf         \
 587         getent          \
 588         gettext         \
 589         gettxt          \
 590         grep            \
 591         grep_xpg4       \
 592         grpck           \
 593         gss             \
 594         halt            \
 595         head            \
 596         hostname        \
 597         hotplug         \
 598         id              \
 599         idmap           \
 600         isaexec         \
 601         iscsiadm        \
 602         iscsid          \
 603         isns            \
 604         itadm           \
 605         kbd             \
 606         krb5            \
 607         ksh             \
 608         last            \
 609         ldap            \
 610         ldapcachemgr    \
 611         lgrpinfo        \
 612         locale          \
 613         lofiadm         \
 614         logadm          \
 615         logger          \
 616         logins          \
 617         ls              \
 618         luxadm          \
 619         lvm             \
 620         mailx           \
 621         mesg            \
 622         mkdir           \
 623         mkpwdict        \
 624         mktemp          \
 625         more            \
 626         mpathadm        \
 627         msgfmt          \
 628         mv              \
 629         ndmpadm         \
 630         ndmpstat        \
 631         newgrp          \
 632         newtask         \
 633         nice            \
 634         nohup           \
 635         oawk            \
 636         pack            \
 637         passwd          \
 638         passmgmt        \
 639         pathchk         \
 640         pfexec          \
 641         pg              \
 642         pgrep           \
 643         picl            \
 644         pools           \
 645         power           \
 646         pr              \
 647         praudit         \
 648         print           \
 649         profiles        \
 650         projadd         \
 651         projects        \
 652         prstat          \
 653         prtdiag         \
 654         ps              \
 655         psrinfo         \
 656         ptools          \
 657         pwconv          \
 658         pwd             \
 659         pyzfs           \
 660         raidctl         \
 661         ramdiskadm      \
 662         rcap            \
 663         rcm_daemon      \
 664         refer           \
 665         regcmp          \
 666         renice          \
 667         roles           \
 668         rm              \
 669         rmdir           \
 670         rmformat        \
 671         rmmount         \
 672         rmvolmgr        \
 673         sasinfo         \
 674         sbdadm          \
 675         scadm           \
 676         script          \
 677         scsi            \
 678         sdiff           \
 679         sdpadm          \
 680         sgs             \
 681         sh              \
 682         shcomp          \
 683         smbsrv          \
 684         sort            \
 685         split           \
 686         srptadm         \
 687         ssh             \
 688         stat            \
 689         stmfadm         \
 690         stmsboot        \
 691         strings         \
 692         su              \
 693         svc             \
 694         svr4pkg         \
 695         swap            \
 696         syseventadm     \
 697         syseventd       \
 698         tabs            \
 699         tar             \
 700         tbl             \
 701         time            \
 702         tnf             \
 703         touch           \
 704         tput            \
 705         troff           \
 706         tsol            \
 707         tty             \
 708         ttymon          \
 709         tzreload        \
 710         ul              \
 711         uname           \
 712         units           \
 713         unlink          \
 714         unpack          \
 715         userattr        \
 716         valtools        \
 717         vgrind          \
 718         vi              \
 719         volcheck        \
 720         vrrpadm         \
 721         vscan           \
 722         w               \
 723         who             \
 724         whodo           \
 725         wracct          \
 726         write           \
 727         wusbadm         \
 728         xargs           \
 729         yppasswd        \
 730         zdump           \
 731         zfs             \
 732         zic             \
 733         zlogin          \
 734         zoneadm         \
 735         zoneadmd        \
 736         zonecfg         \
 737         zonename        \
 738         zpool           \
 739         zonestat
 740 
 741 sparc_MSGSUBDIRS=       \
 742         fruadm          \
 743         prtdscp         \
 744         prtfru          \
 745         virtinfo        \
 746         vntsd
 747 
 748 i386_MSGSUBDIRS=        \
 749         ucodeadm
 750 
 751 #
 752 # commands that use dcgettext for localized time, LC_TIME
 753 #
 754 DCSUBDIRS=              \
 755         cal             \
 756         cfgadm          \
 757         diff            \
 758         ls              \
 759         pr              \
 760         ps              \
 761         tar             \
 762         w               \
 763         who             \
 764         whodo           \
 765         write
 766 
 767 #
 768 # commands that belong only to audit.
 769 #
 770 AUDITSUBDIRS=           \
 771         amt             \
 772         audit           \
 773         audit_warn      \
 774         auditconfig     \
 775         auditd          \
 776         auditrecord     \
 777         auditreduce     \
 778         auditset        \
 779         auditstat       \
 780         praudit         
 781 
 782 #
 783 # commands not owned by the systems group
 784 #
 785 BWOSDIRS=
 786 
 787 
 788 all :=          TARGET = all
 789 install :=      TARGET = install
 790 clean :=        TARGET = clean
 791 clobber :=      TARGET = clobber
 792 lint :=         TARGET = lint
 793 _msg :=         TARGET = _msg
 794 _dc :=          TARGET = _dc
 795 
 796 .KEEP_STATE:
 797 
 798 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 799 
 800 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 801 
 802 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 803         $(AUDITSUBDIRS)
 804 
 805 #
 806 # Manifests cannot be checked in parallel, because we are using
 807 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 808 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 809 # we spawn off a sub-make to perform the non-parallel 'make check'
 810 #
 811 check:
 812         $(MAKE) -f Makefile.check check
 813 
 814 #
 815 # The .WAIT directive works around an apparent bug in parallel make.
 816 # Evidently make was getting the target _msg vs. _dc confused under
 817 # some level of parallelization, causing some of the _dc objects
 818 # not to be built.
 819 #
 820 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 821 
 822 _dc: $(DCSUBDIRS)
 823 
 824 #
 825 # Dependencies
 826 #
 827 fs.d: fstyp
 828 ksh:    shcomp isaexec
 829 mdb:    terminfo
 830 print:  lp
 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: