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 #
  23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright (c) 2017, Joyent, Inc.
  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 2016 Toomas Soome <tsoome@me.com>
  29 # Copyright 2016 Nexenta Systems, Inc.
  30 #
  31 
  32 include ../Makefile.master
  33 
  34 #
  35 #       Note that the commands 'lp', and 'perl' are first in
  36 #       the list, violating alphabetical order.  This is because they are very
  37 #       long-running and should be given the most wall-clock time for a
  38 #       parallel build.
  39 #
  40 #       Commands in the FIRST_SUBDIRS list are built before starting the build
  41 #       of other commands.  Currently this includes only 'isaexec' and
  42 #       'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
  43 #       $(ROOT)/usr/lib/platexec must exist when some other commands are built
  44 #       because their 'make install' creates a hard link to one of them.
  45 #
  46 #       Commands are listed one per line so that TeamWare can auto-merge most
  47 #       changes.
  48 #
  49 
  50 FIRST_SUBDIRS=          \
  51         isaexec         \
  52         platexec
  53 
  54 COMMON_SUBDIRS=         \
  55         allocate        \
  56         availdevs       \
  57         lp              \
  58         perl            \
  59         Adm             \
  60         abi             \
  61         adbgen          \
  62         acct            \
  63         acctadm         \
  64         arch            \
  65         asa             \
  66         ast             \
  67         audio           \
  68         auths           \
  69         autopush        \
  70         avs             \
  71         awk             \
  72         awk_xpg4        \
  73         backup          \
  74         banner          \
  75         bart            \
  76         basename        \
  77         bc              \
  78         bdiff           \
  79         beadm           \
  80         bnu             \
  81         boot            \
  82         busstat         \
  83         cal             \
  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         diskinfo        \
 130         diskmgtd        \
 131         dispadmin       \
 132         dladm           \
 133         dlstat          \
 134         dlutil          \
 135         dmesg           \
 136         dodatadm        \
 137         dtrace          \
 138         du              \
 139         dumpadm         \
 140         dumpcs          \
 141         echo            \
 142         ed              \
 143         eeprom          \
 144         eject           \
 145         emul64ioctl     \
 146         enhance         \
 147         env             \
 148         eqn             \
 149         expand          \
 150         expr            \
 151         exstr           \
 152         factor          \
 153         false           \
 154         fcinfo          \
 155         fcoesvc         \
 156         fdetach         \
 157         fdformat        \
 158         fdisk           \
 159         ficl            \
 160         filesync        \
 161         file            \
 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         groups          \
 189         growfs          \
 190         grpck           \
 191         gss             \
 192         hal             \
 193         halt            \
 194         head            \
 195         hostid          \
 196         hostname        \
 197         hotplug         \
 198         hotplugd        \
 199         ibd_upgrade     \
 200         iconv           \
 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         kbd             \
 222         keyserv         \
 223         killall         \
 224         krb5            \
 225         ksh             \
 226         kvmstat         \
 227         last            \
 228         lastcomm        \
 229         latencytop      \
 230         ldap            \
 231         ldapcachemgr    \
 232         lgrpinfo        \
 233         line            \
 234         link            \
 235         dlmgmtd         \
 236         listen          \
 237         loadkeys        \
 238         locale          \
 239         localedef       \
 240         lockstat        \
 241         locator         \
 242         lofiadm         \
 243         logadm          \
 244         logger          \
 245         login           \
 246         logins          \
 247         look            \
 248         ls              \
 249         luxadm          \
 250         mach            \
 251         mail            \
 252         mailwrapper     \
 253         mailx           \
 254         make            \
 255         makekey         \
 256         man             \
 257         mandoc          \
 258         mdb             \
 259         mesg            \
 260         mkdir           \
 261         mkfifo          \
 262         mkfile          \
 263         mkmsgs          \
 264         mknod           \
 265         mkpwdict        \
 266         mktemp          \
 267         modload         \
 268         more            \
 269         mpathadm        \
 270         msgfmt          \
 271         msgid           \
 272         mt              \
 273         mv              \
 274         mvdir           \
 275         ndmpadm         \
 276         ndmpd           \
 277         ndmpstat        \
 278         netadm          \
 279         netfiles        \
 280         newform         \
 281         newgrp          \
 282         news            \
 283         newtask         \
 284         nice            \
 285         nl              \
 286         nlsadmin        \
 287         nohup           \
 288         nsadmin         \
 289         nscd            \
 290         oamuser         \
 291         oawk            \
 292         od              \
 293         pack            \
 294         pagesize        \
 295         passmgmt        \
 296         passwd          \
 297         pathchk         \
 298         pbind           \
 299         pcidr           \
 300         pcitool         \
 301         pfexec          \
 302         pfexecd         \
 303         pginfo          \
 304         pgstat          \
 305         pgrep           \
 306         picl            \
 307         plimit          \
 308         policykit       \
 309         pools           \
 310         power           \
 311         powertop        \
 312         ppgsz           \
 313         pg              \
 314         plockstat       \
 315         pr              \
 316         prctl           \
 317         print           \
 318         printf          \
 319         priocntl        \
 320         profiles        \
 321         projadd         \
 322         projects        \
 323         prstat          \
 324         prtconf         \
 325         prtdiag         \
 326         prtvtoc         \
 327         ps              \
 328         psradm          \
 329         psrinfo         \
 330         psrset          \
 331         ptools          \
 332         pwck            \
 333         pwconv          \
 334         pwd             \
 335         pyzfs           \
 336         raidctl         \
 337         ramdiskadm      \
 338         rcap            \
 339         rcm_daemon      \
 340         rctladm         \
 341         refer           \
 342         regcmp          \
 343         renice          \
 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         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         uuidgen         \
 436         valtools        \
 437         vgrind          \
 438         vi              \
 439         volcheck        \
 440         volrmmount      \
 441         vrrpadm         \
 442         vscan           \
 443         vt              \
 444         vtfontcvt       \
 445         w               \
 446         wall            \
 447         which           \
 448         who             \
 449         whodo           \
 450         wracct          \
 451         write           \
 452         xargs           \
 453         xhci            \
 454         xstr            \
 455         yes             \
 456         ypcmd           \
 457         yppasswd        \
 458         zdb             \
 459         zdump           \
 460         zfs             \
 461         zhack           \
 462         zic             \
 463         zinject         \
 464         zlogin          \
 465         zoneadm         \
 466         zoneadmd        \
 467         zonecfg         \
 468         zonename        \
 469         zpool           \
 470         zlook           \
 471         zonestat        \
 472         zstreamdump     \
 473         ztest
 474 
 475 i386_SUBDIRS=           \
 476         acpi            \
 477         acpihpd         \
 478         addbadsec       \
 479         biosdev         \
 480         diskscan        \
 481         nvmeadm         \
 482         rtc             \
 483         ucodeadm        \
 484         xvm
 485 
 486 sparc_SUBDIRS=          \
 487         cvcd            \
 488         dcs             \
 489         device_remap    \
 490         drd             \
 491         fruadm          \
 492         ldmad           \
 493         oplhpd          \
 494         prtdscp         \
 495         prtfru          \
 496         scadm           \
 497         sckmd           \
 498         sf880drd        \
 499         virtinfo        \
 500         vntsd
 501 
 502 #
 503 # Commands that are messaged.  Note that 'lp' comes first
 504 # (see previous comment about 'lp'.)
 505 #
 506 MSGSUBDIRS=             \
 507         lp              \
 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         file            \
 575         filesync        \
 576         find            \
 577         flowadm         \
 578         flowstat        \
 579         fm              \
 580         fold            \
 581         fs.d            \
 582         fwflash         \
 583         geniconvtbl     \
 584         genmsg          \
 585         getconf         \
 586         getent          \
 587         gettext         \
 588         gettxt          \
 589         grep            \
 590         grpck           \
 591         gss             \
 592         halt            \
 593         head            \
 594         hostname        \
 595         hotplug         \
 596         iconv           \
 597         id              \
 598         idmap           \
 599         isaexec         \
 600         iscsiadm        \
 601         iscsid          \
 602         isns            \
 603         itadm           \
 604         kbd             \
 605         krb5            \
 606         ksh             \
 607         last            \
 608         ldap            \
 609         ldapcachemgr    \
 610         lgrpinfo        \
 611         locale          \
 612         lofiadm         \
 613         logadm          \
 614         logger          \
 615         logins          \
 616         ls              \
 617         luxadm          \
 618         mailx           \
 619         make            \
 620         man             \
 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         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         volrmmount      \
 720         vrrpadm         \
 721         vscan           \
 722         w               \
 723         who             \
 724         whodo           \
 725         wracct          \
 726         write           \
 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 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: