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) 2019, Joyent, Inc.
  25 # Copyright (c) 2012, 2015 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 # Copyright 2019 Peter Tribble
  32 #
  33 
  34 include ../Makefile.master
  35 
  36 #
  37 #       Note that the commands 'lp', and 'perl' are first in
  38 #       the list, violating alphabetical order.  This is because they are very
  39 #       long-running and should be given the most wall-clock time for a
  40 #       parallel build.
  41 #
  42 #       Commands in the FIRST_SUBDIRS list are built before starting the build
  43 #       of other commands.  Currently this includes only 'isaexec' and
  44 #       'platexec'.  This is necessary because $(ROOT)/usr/lib/isaexec or
  45 #       $(ROOT)/usr/lib/platexec must exist when some other commands are built
  46 #       because their 'make install' creates a hard link to one of them.
  47 #
  48 #       Commands are listed one per line so that TeamWare can auto-merge most
  49 #       changes.
  50 #
  51 
  52 FIRST_SUBDIRS=          \
  53         isaexec         \
  54         platexec
  55 
  56 COMMON_SUBDIRS=         \
  57         allocate        \
  58         availdevs       \
  59         lp              \
  60         perl            \
  61         Adm             \
  62         abi             \
  63         adbgen          \
  64         acct            \
  65         acctadm         \
  66         arch            \
  67         asa             \
  68         ast             \
  69         audio           \
  70         auths           \
  71         autopush        \
  72         awk             \
  73         awk_xpg4        \
  74         backup          \
  75         banner          \
  76         bart            \
  77         basename        \
  78         bc              \
  79         bdiff           \
  80         beadm           \
  81         bnu             \
  82         boot            \
  83         busstat         \
  84         cal             \
  85         captoinfo       \
  86         cat             \
  87         cdrw            \
  88         cfgadm          \
  89         checkeq         \
  90         checknr         \
  91         chgrp           \
  92         chmod           \
  93         chown           \
  94         chroot          \
  95         clear           \
  96         clinfo          \
  97         cmd-crypto      \
  98         cmd-inet        \
  99         col             \
 100         compress        \
 101         connstat        \
 102         consadm         \
 103         coreadm         \
 104         cpio            \
 105         cpc             \
 106         cron            \
 107         crypt           \
 108         csh             \
 109         csplit          \
 110         ctfconvert      \
 111         ctfdiff         \
 112         ctfdump         \
 113         ctfmerge        \
 114         ctrun           \
 115         ctstat          \
 116         ctwatch         \
 117         datadm          \
 118         date            \
 119         dc              \
 120         dd              \
 121         deroff          \
 122         devfsadm        \
 123         syseventd       \
 124         devctl          \
 125         devinfo         \
 126         devmgmt         \
 127         devprop         \
 128         dfs.cmds        \
 129         diff            \
 130         diff3           \
 131         diffmk          \
 132         dircmp          \
 133         dirname         \
 134         dis             \
 135         diskinfo        \
 136         diskmgtd        \
 137         dispadmin       \
 138         dladm           \
 139         dlstat          \
 140         dlutil          \
 141         dmesg           \
 142         dodatadm        \
 143         dtrace          \
 144         du              \
 145         dumpadm         \
 146         dumpcs          \
 147         echo            \
 148         ed              \
 149         eeprom          \
 150         eject           \
 151         emul64ioctl     \
 152         enhance         \
 153         env             \
 154         eqn             \
 155         etdump          \
 156         expand          \
 157         expr            \
 158         exstr           \
 159         factor          \
 160         false           \
 161         fcinfo          \
 162         fcoesvc         \
 163         fdetach         \
 164         fdformat        \
 165         fdisk           \
 166         ficl            \
 167         filesync        \
 168         file            \
 169         find            \
 170         flowadm         \
 171         flowstat        \
 172         fm              \
 173         fmt             \
 174         fmthard         \
 175         fmtmsg          \
 176         fold            \
 177         format          \
 178         fs.d            \
 179         fstyp           \
 180         fuser           \
 181         fwflash         \
 182         gcore           \
 183         gencat          \
 184         geniconvtbl     \
 185         genmsg          \
 186         getconf         \
 187         getdevpolicy    \
 188         getent          \
 189         getfacl         \
 190         getmajor        \
 191         getopt          \
 192         gettext         \
 193         gettxt          \
 194         grep            \
 195         groups          \
 196         growfs          \
 197         grpck           \
 198         gss             \
 199         hal             \
 200         halt            \
 201         head            \
 202         hostid          \
 203         hostname        \
 204         hotplug         \
 205         hotplugd        \
 206         ibd_upgrade     \
 207         iconv           \
 208         id              \
 209         idmap           \
 210         infocmp         \
 211         init            \
 212         initpkg         \
 213         install.d       \
 214         intrd           \
 215         intrstat        \
 216         ipcrm           \
 217         ipcs            \
 218         ipdadm          \
 219         ipf             \
 220         isainfo         \
 221         isalist         \
 222         itutools        \
 223         iscsiadm        \
 224         iscsid          \
 225         iscsitsvc       \
 226         isns            \
 227         itadm           \
 228         kbd             \
 229         keyserv         \
 230         killall         \
 231         krb5            \
 232         ksh             \
 233         kvmstat         \
 234         last            \
 235         lastcomm        \
 236         latencytop      \
 237         ldap            \
 238         ldapcachemgr    \
 239         lgrpinfo        \
 240         line            \
 241         link            \
 242         dlmgmtd         \
 243         listen          \
 244         loadkeys        \
 245         locale          \
 246         localedef       \
 247         lockstat        \
 248         locator         \
 249         lofiadm         \
 250         logadm          \
 251         logger          \
 252         login           \
 253         logins          \
 254         look            \
 255         ls              \
 256         luxadm          \
 257         mach            \
 258         mail            \
 259         mailwrapper     \
 260         mailx           \
 261         make            \
 262         makekey         \
 263         man             \
 264         mandoc          \
 265         mdb             \
 266         mesg            \
 267         mkdir           \
 268         mkfifo          \
 269         mkfile          \
 270         mkmsgs          \
 271         mknod           \
 272         mkpwdict        \
 273         mktemp          \
 274         modload         \
 275         more            \
 276         mpathadm        \
 277         msgfmt          \
 278         msgid           \
 279         mt              \
 280         mv              \
 281         mvdir           \
 282         ndmpadm         \
 283         ndmpd           \
 284         ndmpstat        \
 285         netadm          \
 286         netfiles        \
 287         newform         \
 288         newgrp          \
 289         news            \
 290         newtask         \
 291         nice            \
 292         nl              \
 293         nlsadmin        \
 294         nohup           \
 295         nsadmin         \
 296         nscd            \
 297         oamuser         \
 298         oawk            \
 299         od              \
 300         pack            \
 301         pagesize        \
 302         passmgmt        \
 303         passwd          \
 304         pathchk         \
 305         pbind           \
 306         pcidr           \
 307         pcieb           \
 308         pcitool         \
 309         pfexec          \
 310         pfexecd         \
 311         pginfo          \
 312         pgstat          \
 313         pgrep           \
 314         picl            \
 315         plimit          \
 316         policykit       \
 317         pools           \
 318         power           \
 319         powertop        \
 320         ppgsz           \
 321         pg              \
 322         plockstat       \
 323         pr              \
 324         prctl           \
 325         print           \
 326         printf          \
 327         priocntl        \
 328         profiles        \
 329         projadd         \
 330         projects        \
 331         prstat          \
 332         prtconf         \
 333         prtdiag         \
 334         prtvtoc         \
 335         ps              \
 336         psradm          \
 337         psrinfo         \
 338         psrset          \
 339         ptools          \
 340         pwck            \
 341         pwconv          \
 342         pwd             \
 343         pyzfs           \
 344         raidctl         \
 345         ramdiskadm      \
 346         rcap            \
 347         rcm_daemon      \
 348         rctladm         \
 349         refer           \
 350         regcmp          \
 351         renice          \
 352         rm              \
 353         rmdir           \
 354         rmformat        \
 355         rmmount         \
 356         rmt             \
 357         rmvolmgr        \
 358         roles           \
 359         rpcbind         \
 360         rpcgen          \
 361         rpcinfo         \
 362         rpcsvc          \
 363         runat           \
 364         sa              \
 365         saf             \
 366         sasinfo         \
 367         savecore        \
 368         sbdadm          \
 369         script          \
 370         scsi            \
 371         sdiff           \
 372         sdpadm          \
 373         sed             \
 374         sendmail        \
 375         setfacl         \
 376         setmnt          \
 377         setpgrp         \
 378         setuname        \
 379         sgs             \
 380         sh              \
 381         shcomp          \
 382         smbios          \
 383         smbsrv          \
 384         smserverd       \
 385         soelim          \
 386         sort            \
 387         spell           \
 388         split           \
 389         sqlite          \
 390         srchtxt         \
 391         srptadm         \
 392         srptsvc         \
 393         ssh             \
 394         stat            \
 395         stmfadm         \
 396         stmfproxy       \
 397         stmfsvc         \
 398         stmsboot        \
 399         streams         \
 400         strings         \
 401         su              \
 402         sulogin         \
 403         sunpc           \
 404         svc             \
 405         svr4pkg         \
 406         swap            \
 407         sync            \
 408         sysdef          \
 409         syseventadm     \
 410         syslogd         \
 411         tabs            \
 412         tail            \
 413         tar             \
 414         tbl             \
 415         tcopy           \
 416         tcpd            \
 417         th_tools        \
 418         tic             \
 419         time            \
 420         tip             \
 421         tnf             \
 422         touch           \
 423         tput            \
 424         tr              \
 425         trapstat        \
 426         troff           \
 427         true            \
 428         truss           \
 429         tsol            \
 430         tty             \
 431         ttymon          \
 432         tzreload        \
 433         uadmin          \
 434         ul              \
 435         uname           \
 436         units           \
 437         unlink          \
 438         unpack          \
 439         userattr        \
 440         users           \
 441         utmp_update     \
 442         utmpd           \
 443         uuidgen         \
 444         valtools        \
 445         vgrind          \
 446         vi              \
 447         volcheck        \
 448         volrmmount      \
 449         vrrpadm         \
 450         vscan           \
 451         vt              \
 452         vtfontcvt       \
 453         w               \
 454         wall            \
 455         which           \
 456         who             \
 457         whodo           \
 458         wracct          \
 459         write           \
 460         xargs           \
 461         xstr            \
 462         yes             \
 463         ypcmd           \
 464         yppasswd        \
 465         zdb             \
 466         zdump           \
 467         zfs             \
 468         zhack           \
 469         zic             \
 470         zinject         \
 471         zlogin          \
 472         zoneadm         \
 473         zoneadmd        \
 474         zonecfg         \
 475         zonename        \
 476         zpool           \
 477         zlook           \
 478         zonestat        \
 479         zstreamdump     \
 480         ztest
 481 
 482 i386_SUBDIRS=           \
 483         acpi            \
 484         acpihpd         \
 485         addbadsec       \
 486         ahciem          \
 487         biosdev         \
 488         cxgbetool       \
 489         diskscan        \
 490         nvmeadm         \
 491         rtc             \
 492         ucodeadm        \
 493         xhci            \
 494         xvm
 495 
 496 sparc_SUBDIRS=          \
 497         dcs             \
 498         device_remap    \
 499         drd             \
 500         fruadm          \
 501         ldmad           \
 502         oplhpd          \
 503         prtdscp         \
 504         prtfru          \
 505         scadm           \
 506         sckmd           \
 507         sf880drd        \
 508         virtinfo        \
 509         vntsd
 510 
 511 #
 512 # Commands that are messaged.  Note that 'lp' comes first
 513 # (see previous comment about 'lp'.)
 514 #
 515 MSGSUBDIRS=             \
 516         lp              \
 517         abi             \
 518         acctadm         \
 519         allocate        \
 520         asa             \
 521         audio           \
 522         audit           \
 523         auditconfig     \
 524         auditd          \
 525         auditrecord     \
 526         auditset        \
 527         auths           \
 528         autopush        \
 529         awk             \
 530         awk_xpg4        \
 531         backup          \
 532         banner          \
 533         bart            \
 534         basename        \
 535         beadm           \
 536         bnu             \
 537         busstat         \
 538         cal             \
 539         cat             \
 540         cdrw            \
 541         cfgadm          \
 542         checkeq         \
 543         checknr         \
 544         chgrp           \
 545         chmod           \
 546         chown           \
 547         cmd-crypto      \
 548         cmd-inet        \
 549         col             \
 550         compress        \
 551         connstat        \
 552         consadm         \
 553         coreadm         \
 554         cpio            \
 555         cpc             \
 556         cron            \
 557         csh             \
 558         csplit          \
 559         ctrun           \
 560         ctstat          \
 561         ctwatch         \
 562         datadm          \
 563         date            \
 564         dc              \
 565         dcs             \
 566         dd              \
 567         deroff          \
 568         devfsadm        \
 569         dfs.cmds        \
 570         diff            \
 571         diffmk          \
 572         dladm           \
 573         dlstat          \
 574         du              \
 575         dumpcs          \
 576         ed              \
 577         eject           \
 578         env             \
 579         eqn             \
 580         expand          \
 581         expr            \
 582         fcinfo          \
 583         file            \
 584         filesync        \
 585         find            \
 586         flowadm         \
 587         flowstat        \
 588         fm              \
 589         fold            \
 590         fs.d            \
 591         fwflash         \
 592         geniconvtbl     \
 593         genmsg          \
 594         getconf         \
 595         getent          \
 596         gettext         \
 597         gettxt          \
 598         grep            \
 599         grpck           \
 600         gss             \
 601         halt            \
 602         head            \
 603         hostname        \
 604         hotplug         \
 605         iconv           \
 606         id              \
 607         idmap           \
 608         isaexec         \
 609         iscsiadm        \
 610         iscsid          \
 611         isns            \
 612         itadm           \
 613         kbd             \
 614         krb5            \
 615         ksh             \
 616         last            \
 617         ldap            \
 618         ldapcachemgr    \
 619         lgrpinfo        \
 620         locale          \
 621         lofiadm         \
 622         logadm          \
 623         logger          \
 624         logins          \
 625         ls              \
 626         luxadm          \
 627         mailx           \
 628         make            \
 629         man             \
 630         mesg            \
 631         mkdir           \
 632         mkpwdict        \
 633         mktemp          \
 634         more            \
 635         mpathadm        \
 636         msgfmt          \
 637         mv              \
 638         ndmpadm         \
 639         ndmpstat        \
 640         newgrp          \
 641         newtask         \
 642         nice            \
 643         nohup           \
 644         oawk            \
 645         pack            \
 646         passwd          \
 647         passmgmt        \
 648         pathchk         \
 649         pfexec          \
 650         pg              \
 651         pgrep           \
 652         picl            \
 653         pools           \
 654         power           \
 655         pr              \
 656         praudit         \
 657         print           \
 658         profiles        \
 659         projadd         \
 660         projects        \
 661         prstat          \
 662         prtdiag         \
 663         ps              \
 664         psrinfo         \
 665         ptools          \
 666         pwconv          \
 667         pwd             \
 668         pyzfs           \
 669         raidctl         \
 670         ramdiskadm      \
 671         rcap            \
 672         rcm_daemon      \
 673         refer           \
 674         regcmp          \
 675         renice          \
 676         roles           \
 677         rm              \
 678         rmdir           \
 679         rmformat        \
 680         rmmount         \
 681         rmvolmgr        \
 682         sasinfo         \
 683         sbdadm          \
 684         scadm           \
 685         script          \
 686         scsi            \
 687         sdiff           \
 688         sdpadm          \
 689         sgs             \
 690         sh              \
 691         shcomp          \
 692         smbsrv          \
 693         sort            \
 694         split           \
 695         srptadm         \
 696         stat            \
 697         stmfadm         \
 698         stmsboot        \
 699         strings         \
 700         su              \
 701         svc             \
 702         svr4pkg         \
 703         swap            \
 704         syseventadm     \
 705         syseventd       \
 706         tabs            \
 707         tar             \
 708         tbl             \
 709         time            \
 710         tnf             \
 711         touch           \
 712         tput            \
 713         troff           \
 714         tsol            \
 715         tty             \
 716         ttymon          \
 717         tzreload        \
 718         ul              \
 719         uname           \
 720         units           \
 721         unlink          \
 722         unpack          \
 723         userattr        \
 724         valtools        \
 725         vgrind          \
 726         vi              \
 727         volcheck        \
 728         volrmmount      \
 729         vrrpadm         \
 730         vscan           \
 731         w               \
 732         who             \
 733         whodo           \
 734         wracct          \
 735         write           \
 736         xargs           \
 737         yppasswd        \
 738         zdump           \
 739         zfs             \
 740         zic             \
 741         zlogin          \
 742         zoneadm         \
 743         zoneadmd        \
 744         zonecfg         \
 745         zonename        \
 746         zpool           \
 747         zonestat
 748 
 749 sparc_MSGSUBDIRS=       \
 750         fruadm          \
 751         prtdscp         \
 752         prtfru          \
 753         virtinfo        \
 754         vntsd
 755 
 756 i386_MSGSUBDIRS=        \
 757         ucodeadm
 758 
 759 #
 760 # commands that use dcgettext for localized time, LC_TIME
 761 #
 762 DCSUBDIRS=              \
 763         cal             \
 764         cfgadm          \
 765         diff            \
 766         ls              \
 767         pr              \
 768         ps              \
 769         tar             \
 770         w               \
 771         who             \
 772         whodo           \
 773         write
 774 
 775 #
 776 # commands that belong only to audit.
 777 #
 778 AUDITSUBDIRS=           \
 779         amt             \
 780         audit           \
 781         audit_warn      \
 782         auditconfig     \
 783         auditd          \
 784         auditrecord     \
 785         auditreduce     \
 786         auditset        \
 787         auditstat       \
 788         praudit
 789 
 790 #
 791 # commands not owned by the systems group
 792 #
 793 BWOSDIRS=
 794 
 795 
 796 all :=          TARGET = all
 797 install :=      TARGET = install
 798 clean :=        TARGET = clean
 799 clobber :=      TARGET = clobber
 800 lint :=         TARGET = lint
 801 _msg :=         TARGET = _msg
 802 _dc :=          TARGET = _dc
 803 
 804 .KEEP_STATE:
 805 
 806 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 807 
 808 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 809 
 810 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 811         $(AUDITSUBDIRS)
 812 
 813 #
 814 # Manifests cannot be checked in parallel, because we are using
 815 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 816 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 817 # we spawn off a sub-make to perform the non-parallel 'make check'
 818 #
 819 check:
 820         $(MAKE) -f Makefile.check check
 821 
 822 #
 823 # The .WAIT directive works around an apparent bug in parallel make.
 824 # Evidently make was getting the target _msg vs. _dc confused under
 825 # some level of parallelization, causing some of the _dc objects
 826 # not to be built.
 827 #
 828 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 829 
 830 _dc: $(DCSUBDIRS)
 831 
 832 #
 833 # Dependencies
 834 #
 835 fs.d:   fstyp
 836 ksh:    shcomp isaexec
 837 print:  lp
 838 fmt:    mailx
 839 
 840 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 841         @if [ -f $@/Makefile  ]; then \
 842                 cd $@; pwd; $(MAKE) $(TARGET); \
 843         else \
 844                 true; \
 845         fi
 846 
 847 FRC: