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