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