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