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 2018 Nexenta Systems, Inc.
  30 # Copyright 2018 Gary Mills
  31 #
  32 
  33 include ../Makefile.master
  34 
  35 #
  36 #       Note that the commands 'lp', and 'perl' are first in
  37 #       the list, violating alphabetical order.  This is because they are very
  38 #       long-running and should be given the most wall-clock time for a
  39 #       parallel build.
  40 #
  41 #       Commands in the FIRST_SUBDIRS list are built before starting the build
  42 #       of other commands.  Currently this includes only 'isaexec' and
  43 #       'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
  44 #       $(ROOT)/usr/lib/platexec must exist when some other commands are built
  45 #       because their 'make install' creates a hard link to one of them.
  46 #
  47 #       Commands are listed one per line so that TeamWare can auto-merge most
  48 #       changes.
  49 #
  50 
  51 FIRST_SUBDIRS=          \
  52         isaexec         \
  53         platexec
  54 
  55 COMMON_SUBDIRS=         \
  56         allocate        \
  57         availdevs       \
  58         lp              \
  59         perl            \
  60         Adm             \
  61         abi             \
  62         adbgen          \
  63         acct            \
  64         acctadm         \
  65         arch            \
  66         asa             \
  67         ast             \
  68         audio           \
  69         auths           \
  70         autopush        \
  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         cxgbetool       \
 112         datadm          \
 113         date            \
 114         dc              \
 115         dd              \
 116         deroff          \
 117         devfsadm        \
 118         syseventd       \
 119         devctl          \
 120         devinfo         \
 121         devmgmt         \
 122         devprop         \
 123         dfs.cmds        \
 124         diff            \
 125         diff3           \
 126         diffmk          \
 127         dircmp          \
 128         dirname         \
 129         dis             \
 130         diskinfo        \
 131         diskmgtd        \
 132         dispadmin       \
 133         dladm           \
 134         dlstat          \
 135         dlutil          \
 136         dmesg           \
 137         dodatadm        \
 138         dtrace          \
 139         du              \
 140         dumpadm         \
 141         dumpcs          \
 142         echo            \
 143         ed              \
 144         eeprom          \
 145         eject           \
 146         emul64ioctl     \
 147         enhance         \
 148         env             \
 149         eqn             \
 150         expand          \
 151         expr            \
 152         exstr           \
 153         factor          \
 154         false           \
 155         fcinfo          \
 156         fcoesvc         \
 157         fdetach         \
 158         fdformat        \
 159         fdisk           \
 160         ficl            \
 161         filesync        \
 162         file            \
 163         find            \
 164         flowadm         \
 165         flowstat        \
 166         fm              \
 167         fmt             \
 168         fmthard         \
 169         fmtmsg          \
 170         fold            \
 171         format          \
 172         fs.d            \
 173         fstyp           \
 174         fuser           \
 175         fwflash         \
 176         gcore           \
 177         gencat          \
 178         geniconvtbl     \
 179         genmsg          \
 180         getconf         \
 181         getdevpolicy    \
 182         getent          \
 183         getfacl         \
 184         getmajor        \
 185         getopt          \
 186         gettext         \
 187         gettxt          \
 188         grep            \
 189         groups          \
 190         growfs          \
 191         grpck           \
 192         gss             \
 193         hal             \
 194         halt            \
 195         head            \
 196         hostid          \
 197         hostname        \
 198         hotplug         \
 199         hotplugd        \
 200         ibd_upgrade     \
 201         iconv           \
 202         id              \
 203         idmap           \
 204         infocmp         \
 205         init            \
 206         initpkg         \
 207         install.d       \
 208         intrd           \
 209         intrstat        \
 210         ipcrm           \
 211         ipcs            \
 212         ipdadm          \
 213         ipf             \
 214         isainfo         \
 215         isalist         \
 216         itutools        \
 217         iscsiadm        \
 218         iscsid          \
 219         iscsitsvc       \
 220         isns            \
 221         itadm           \
 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         mach            \
 252         mail            \
 253         mailwrapper     \
 254         mailx           \
 255         make            \
 256         makekey         \
 257         man             \
 258         mandoc          \
 259         mdb             \
 260         mesg            \
 261         mkdir           \
 262         mkfifo          \
 263         mkfile          \
 264         mkmsgs          \
 265         mknod           \
 266         mkpwdict        \
 267         mktemp          \
 268         modload         \
 269         more            \
 270         mpathadm        \
 271         msgfmt          \
 272         msgid           \
 273         mt              \
 274         mv              \
 275         mvdir           \
 276         ndmpadm         \
 277         ndmpd           \
 278         ndmpstat        \
 279         netadm          \
 280         netfiles        \
 281         newform         \
 282         newgrp          \
 283         news            \
 284         newtask         \
 285         nice            \
 286         nl              \
 287         nlsadmin        \
 288         nohup           \
 289         nsadmin         \
 290         nscd            \
 291         oamuser         \
 292         oawk            \
 293         od              \
 294         pack            \
 295         pagesize        \
 296         passmgmt        \
 297         passwd          \
 298         pathchk         \
 299         pbind           \
 300         pcidr           \
 301         pcitool         \
 302         pfexec          \
 303         pfexecd         \
 304         pginfo          \
 305         pgstat          \
 306         pgrep           \
 307         picl            \
 308         plimit          \
 309         policykit       \
 310         pools           \
 311         power           \
 312         powertop        \
 313         ppgsz           \
 314         pg              \
 315         plockstat       \
 316         pr              \
 317         prctl           \
 318         print           \
 319         printf          \
 320         priocntl        \
 321         profiles        \
 322         projadd         \
 323         projects        \
 324         prstat          \
 325         prtconf         \
 326         prtdiag         \
 327         prtvtoc         \
 328         ps              \
 329         psradm          \
 330         psrinfo         \
 331         psrset          \
 332         ptools          \
 333         pwck            \
 334         pwconv          \
 335         pwd             \
 336         pyzfs           \
 337         raidctl         \
 338         ramdiskadm      \
 339         rcap            \
 340         rcm_daemon      \
 341         rctladm         \
 342         refer           \
 343         regcmp          \
 344         renice          \
 345         rm              \
 346         rmdir           \
 347         rmformat        \
 348         rmmount         \
 349         rmt             \
 350         rmvolmgr        \
 351         roles           \
 352         rpcbind         \
 353         rpcgen          \
 354         rpcinfo         \
 355         rpcsvc          \
 356         runat           \
 357         sa              \
 358         saf             \
 359         sasinfo         \
 360         savecore        \
 361         sbdadm          \
 362         script          \
 363         scsi            \
 364         sdiff           \
 365         sdpadm          \
 366         sed             \
 367         sendmail        \
 368         setfacl         \
 369         setmnt          \
 370         setpgrp         \
 371         setuname        \
 372         sgs             \
 373         sh              \
 374         shcomp          \
 375         smbios          \
 376         smbsrv          \
 377         smserverd       \
 378         soelim          \
 379         sort            \
 380         spell           \
 381         split           \
 382         sqlite          \
 383         srchtxt         \
 384         srptadm         \
 385         srptsvc         \
 386         ssh             \
 387         stat            \
 388         stmfadm         \
 389         stmfproxy       \
 390         stmfsvc         \
 391         stmsboot        \
 392         streams         \
 393         strings         \
 394         su              \
 395         sulogin         \
 396         sunpc           \
 397         svc             \
 398         svr4pkg         \
 399         swap            \
 400         sync            \
 401         sysdef          \
 402         syseventadm     \
 403         syslogd         \
 404         tabs            \
 405         tail            \
 406         tar             \
 407         tbl             \
 408         tcopy           \
 409         tcpd            \
 410         th_tools        \
 411         tic             \
 412         time            \
 413         tip             \
 414         tnf             \
 415         touch           \
 416         tput            \
 417         tr              \
 418         trapstat        \
 419         troff           \
 420         true            \
 421         truss           \
 422         tsol            \
 423         tty             \
 424         ttymon          \
 425         tzreload        \
 426         uadmin          \
 427         ul              \
 428         uname           \
 429         units           \
 430         unlink          \
 431         unpack          \
 432         userattr        \
 433         users           \
 434         utmp_update     \
 435         utmpd           \
 436         uuidgen         \
 437         valtools        \
 438         vgrind          \
 439         vi              \
 440         volcheck        \
 441         volrmmount      \
 442         vrrpadm         \
 443         vscan           \
 444         vt              \
 445         vtfontcvt       \
 446         w               \
 447         wall            \
 448         which           \
 449         who             \
 450         whodo           \
 451         wracct          \
 452         write           \
 453         xargs           \
 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         xhci            \
 485         xvm
 486 
 487 sparc_SUBDIRS=          \
 488         cvcd            \
 489         dcs             \
 490         device_remap    \
 491         drd             \
 492         fruadm          \
 493         ldmad           \
 494         oplhpd          \
 495         prtdscp         \
 496         prtfru          \
 497         scadm           \
 498         sckmd           \
 499         sf880drd        \
 500         virtinfo        \
 501         vntsd
 502 
 503 #
 504 # Commands that are messaged.  Note that 'lp' comes first
 505 # (see previous comment about 'lp'.)
 506 #
 507 MSGSUBDIRS=             \
 508         lp              \
 509         abi             \
 510         acctadm         \
 511         allocate        \
 512         asa             \
 513         audio           \
 514         audit           \
 515         auditconfig     \
 516         auditd          \
 517         auditrecord     \
 518         auditset        \
 519         auths           \
 520         autopush        \
 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: