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         logname         \
 255         look            \
 256         ls              \
 257         luxadm          \
 258         mach            \
 259         mail            \
 260         mailwrapper     \
 261         mailx           \
 262         make            \
 263         makekey         \
 264         man             \
 265         mandoc          \
 266         mdb             \
 267         mesg            \
 268         mkdir           \
 269         mkfifo          \
 270         mkfile          \
 271         mkmsgs          \
 272         mknod           \
 273         mkpwdict        \
 274         mktemp          \
 275         modload         \
 276         more            \
 277         mpathadm        \
 278         msgfmt          \
 279         msgid           \
 280         mt              \
 281         mv              \
 282         mvdir           \
 283         ndmpadm         \
 284         ndmpd           \
 285         ndmpstat        \
 286         netadm          \
 287         netfiles        \
 288         newform         \
 289         newgrp          \
 290         news            \
 291         newtask         \
 292         nice            \
 293         nl              \
 294         nlsadmin        \
 295         nohup           \
 296         nsadmin         \
 297         nscd            \
 298         oamuser         \
 299         oawk            \
 300         od              \
 301         pack            \
 302         pagesize        \
 303         passmgmt        \
 304         passwd          \
 305         pathchk         \
 306         pbind           \
 307         pcidr           \
 308         pcieb           \
 309         pcitool         \
 310         pfexec          \
 311         pfexecd         \
 312         pginfo          \
 313         pgstat          \
 314         pgrep           \
 315         picl            \
 316         plimit          \
 317         policykit       \
 318         pools           \
 319         power           \
 320         powertop        \
 321         ppgsz           \
 322         pg              \
 323         plockstat       \
 324         pr              \
 325         prctl           \
 326         print           \
 327         printf          \
 328         priocntl        \
 329         profiles        \
 330         projadd         \
 331         projects        \
 332         prstat          \
 333         prtconf         \
 334         prtdiag         \
 335         prtvtoc         \
 336         ps              \
 337         psradm          \
 338         psrinfo         \
 339         psrset          \
 340         ptools          \
 341         pwck            \
 342         pwconv          \
 343         pwd             \
 344         pyzfs           \
 345         raidctl         \
 346         ramdiskadm      \
 347         rcap            \
 348         rcm_daemon      \
 349         rctladm         \
 350         refer           \
 351         regcmp          \
 352         renice          \
 353         rm              \
 354         rmdir           \
 355         rmformat        \
 356         rmmount         \
 357         rmt             \
 358         rmvolmgr        \
 359         roles           \
 360         rpcbind         \
 361         rpcgen          \
 362         rpcinfo         \
 363         rpcsvc          \
 364         runat           \
 365         sa              \
 366         saf             \
 367         sasinfo         \
 368         savecore        \
 369         sbdadm          \
 370         script          \
 371         scsi            \
 372         sdiff           \
 373         sdpadm          \
 374         sed             \
 375         sendmail        \
 376         setfacl         \
 377         setmnt          \
 378         setpgrp         \
 379         setuname        \
 380         sgs             \
 381         sh              \
 382         shcomp          \
 383         sleep           \
 384         smbios          \
 385         smbsrv          \
 386         smserverd       \
 387         soelim          \
 388         sort            \
 389         spell           \
 390         split           \
 391         sqlite          \
 392         srchtxt         \
 393         srptadm         \
 394         srptsvc         \
 395         ssh             \
 396         stat            \
 397         stmfadm         \
 398         stmfproxy       \
 399         stmfsvc         \
 400         stmsboot        \
 401         streams         \
 402         strings         \
 403         su              \
 404         sulogin         \
 405         sunpc           \
 406         svc             \
 407         svr4pkg         \
 408         swap            \
 409         sync            \
 410         sysdef          \
 411         syseventadm     \
 412         syslogd         \
 413         tabs            \
 414         tail            \
 415         tar             \
 416         tbl             \
 417         tcopy           \
 418         tcpd            \
 419         th_tools        \
 420         tic             \
 421         time            \
 422         tip             \
 423         tnf             \
 424         touch           \
 425         tput            \
 426         tr              \
 427         trapstat        \
 428         troff           \
 429         true            \
 430         truss           \
 431         tsol            \
 432         tty             \
 433         ttymon          \
 434         tzreload        \
 435         uadmin          \
 436         ul              \
 437         uname           \
 438         units           \
 439         unlink          \
 440         unpack          \
 441         userattr        \
 442         users           \
 443         utmp_update     \
 444         utmpd           \
 445         uuidgen         \
 446         valtools        \
 447         vgrind          \
 448         vi              \
 449         volcheck        \
 450         volrmmount      \
 451         vrrpadm         \
 452         vscan           \
 453         vt              \
 454         vtfontcvt       \
 455         w               \
 456         wall            \
 457         which           \
 458         who             \
 459         whodo           \
 460         wracct          \
 461         write           \
 462         xargs           \
 463         xstr            \
 464         yes             \
 465         ypcmd           \
 466         yppasswd        \
 467         zdb             \
 468         zdump           \
 469         zfs             \
 470         zhack           \
 471         zic             \
 472         zinject         \
 473         zlogin          \
 474         zoneadm         \
 475         zoneadmd        \
 476         zonecfg         \
 477         zonename        \
 478         zpool           \
 479         zlook           \
 480         zonestat        \
 481         zstreamdump     \
 482         ztest
 483 
 484 i386_SUBDIRS=           \
 485         acpi            \
 486         acpihpd         \
 487         addbadsec       \
 488         ahciem          \
 489         biosdev         \
 490         cxgbetool       \
 491         diskscan        \
 492         nvmeadm         \
 493         rdmsr           \
 494         rtc             \
 495         ucodeadm        \
 496         xhci            \
 497         xvm
 498 
 499 sparc_SUBDIRS=          \
 500         dcs             \
 501         device_remap    \
 502         drd             \
 503         fruadm          \
 504         ldmad           \
 505         oplhpd          \
 506         prtdscp         \
 507         prtfru          \
 508         scadm           \
 509         sckmd           \
 510         sf880drd        \
 511         virtinfo        \
 512         vntsd
 513 
 514 #
 515 # Commands that are messaged.  Note that 'lp' comes first
 516 # (see previous comment about 'lp'.)
 517 #
 518 MSGSUBDIRS=             \
 519         lp              \
 520         abi             \
 521         acctadm         \
 522         allocate        \
 523         asa             \
 524         audio           \
 525         audit           \
 526         auditconfig     \
 527         auditd          \
 528         auditrecord     \
 529         auditset        \
 530         auths           \
 531         autopush        \
 532         awk             \
 533         awk_xpg4        \
 534         backup          \
 535         banner          \
 536         bart            \
 537         basename        \
 538         beadm           \
 539         bnu             \
 540         busstat         \
 541         cal             \
 542         cat             \
 543         cdrw            \
 544         cfgadm          \
 545         checkeq         \
 546         checknr         \
 547         chgrp           \
 548         chmod           \
 549         chown           \
 550         cmd-crypto      \
 551         cmd-inet        \
 552         col             \
 553         compress        \
 554         connstat        \
 555         consadm         \
 556         coreadm         \
 557         cpio            \
 558         cpc             \
 559         cron            \
 560         csh             \
 561         csplit          \
 562         ctrun           \
 563         ctstat          \
 564         ctwatch         \
 565         datadm          \
 566         date            \
 567         dc              \
 568         dcs             \
 569         dd              \
 570         deroff          \
 571         devfsadm        \
 572         dfs.cmds        \
 573         diff            \
 574         diffmk          \
 575         dladm           \
 576         dlstat          \
 577         du              \
 578         dumpcs          \
 579         ed              \
 580         eject           \
 581         env             \
 582         eqn             \
 583         expand          \
 584         expr            \
 585         fcinfo          \
 586         file            \
 587         filesync        \
 588         find            \
 589         flowadm         \
 590         flowstat        \
 591         fm              \
 592         fold            \
 593         fs.d            \
 594         fwflash         \
 595         geniconvtbl     \
 596         genmsg          \
 597         getconf         \
 598         getent          \
 599         gettext         \
 600         gettxt          \
 601         grep            \
 602         grpck           \
 603         gss             \
 604         halt            \
 605         head            \
 606         hostname        \
 607         hotplug         \
 608         iconv           \
 609         id              \
 610         idmap           \
 611         isaexec         \
 612         iscsiadm        \
 613         iscsid          \
 614         isns            \
 615         itadm           \
 616         kbd             \
 617         krb5            \
 618         ksh             \
 619         last            \
 620         ldap            \
 621         ldapcachemgr    \
 622         lgrpinfo        \
 623         locale          \
 624         lofiadm         \
 625         logadm          \
 626         logger          \
 627         logins          \
 628         ls              \
 629         luxadm          \
 630         mailx           \
 631         make            \
 632         man             \
 633         mesg            \
 634         mkdir           \
 635         mkpwdict        \
 636         mktemp          \
 637         more            \
 638         mpathadm        \
 639         msgfmt          \
 640         mv              \
 641         ndmpadm         \
 642         ndmpstat        \
 643         newgrp          \
 644         newtask         \
 645         nice            \
 646         nohup           \
 647         oawk            \
 648         pack            \
 649         passwd          \
 650         passmgmt        \
 651         pathchk         \
 652         pfexec          \
 653         pg              \
 654         pgrep           \
 655         picl            \
 656         pools           \
 657         power           \
 658         pr              \
 659         praudit         \
 660         print           \
 661         profiles        \
 662         projadd         \
 663         projects        \
 664         prstat          \
 665         prtdiag         \
 666         ps              \
 667         psrinfo         \
 668         ptools          \
 669         pwconv          \
 670         pwd             \
 671         pyzfs           \
 672         raidctl         \
 673         ramdiskadm      \
 674         rcap            \
 675         rcm_daemon      \
 676         refer           \
 677         regcmp          \
 678         renice          \
 679         roles           \
 680         rm              \
 681         rmdir           \
 682         rmformat        \
 683         rmmount         \
 684         rmvolmgr        \
 685         sasinfo         \
 686         sbdadm          \
 687         scadm           \
 688         script          \
 689         scsi            \
 690         sdiff           \
 691         sdpadm          \
 692         sgs             \
 693         sh              \
 694         shcomp          \
 695         smbsrv          \
 696         sort            \
 697         split           \
 698         srptadm         \
 699         stat            \
 700         stmfadm         \
 701         stmsboot        \
 702         strings         \
 703         su              \
 704         svc             \
 705         svr4pkg         \
 706         swap            \
 707         syseventadm     \
 708         syseventd       \
 709         tabs            \
 710         tar             \
 711         tbl             \
 712         time            \
 713         tnf             \
 714         touch           \
 715         tput            \
 716         troff           \
 717         tsol            \
 718         tty             \
 719         ttymon          \
 720         tzreload        \
 721         ul              \
 722         uname           \
 723         units           \
 724         unlink          \
 725         unpack          \
 726         userattr        \
 727         valtools        \
 728         vgrind          \
 729         vi              \
 730         volcheck        \
 731         volrmmount      \
 732         vrrpadm         \
 733         vscan           \
 734         w               \
 735         who             \
 736         whodo           \
 737         wracct          \
 738         write           \
 739         xargs           \
 740         yppasswd        \
 741         zdump           \
 742         zfs             \
 743         zic             \
 744         zlogin          \
 745         zoneadm         \
 746         zoneadmd        \
 747         zonecfg         \
 748         zonename        \
 749         zpool           \
 750         zonestat
 751 
 752 sparc_MSGSUBDIRS=       \
 753         fruadm          \
 754         prtdscp         \
 755         prtfru          \
 756         virtinfo        \
 757         vntsd
 758 
 759 i386_MSGSUBDIRS=        \
 760         rdmsr           \
 761         ucodeadm
 762 
 763 #
 764 # commands that use dcgettext for localized time, LC_TIME
 765 #
 766 DCSUBDIRS=              \
 767         cal             \
 768         cfgadm          \
 769         diff            \
 770         ls              \
 771         pr              \
 772         ps              \
 773         tar             \
 774         w               \
 775         who             \
 776         whodo           \
 777         write
 778 
 779 #
 780 # commands that belong only to audit.
 781 #
 782 AUDITSUBDIRS=           \
 783         amt             \
 784         audit           \
 785         audit_warn      \
 786         auditconfig     \
 787         auditd          \
 788         auditrecord     \
 789         auditreduce     \
 790         auditset        \
 791         auditstat       \
 792         praudit
 793 
 794 #
 795 # commands not owned by the systems group
 796 #
 797 BWOSDIRS=
 798 
 799 
 800 all :=          TARGET = all
 801 install :=      TARGET = install
 802 clean :=        TARGET = clean
 803 clobber :=      TARGET = clobber
 804 lint :=         TARGET = lint
 805 _msg :=         TARGET = _msg
 806 _dc :=          TARGET = _dc
 807 
 808 .KEEP_STATE:
 809 
 810 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 811 
 812 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 813 
 814 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 815         $(AUDITSUBDIRS)
 816 
 817 #
 818 # Manifests cannot be checked in parallel, because we are using
 819 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 820 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 821 # we spawn off a sub-make to perform the non-parallel 'make check'
 822 #
 823 check:
 824         $(MAKE) -f Makefile.check check
 825 
 826 #
 827 # The .WAIT directive works around an apparent bug in parallel make.
 828 # Evidently make was getting the target _msg vs. _dc confused under
 829 # some level of parallelization, causing some of the _dc objects
 830 # not to be built.
 831 #
 832 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 833 
 834 _dc: $(DCSUBDIRS)
 835 
 836 #
 837 # Dependencies
 838 #
 839 fs.d:   fstyp
 840 ksh:    shcomp isaexec
 841 print:  lp
 842 fmt:    mailx
 843 
 844 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 845         @if [ -f $@/Makefile  ]; then \
 846                 cd $@; pwd; $(MAKE) $(TARGET); \
 847         else \
 848                 true; \
 849         fi
 850 
 851 FRC: