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