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