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             \
  69         awk_xpg4        \
  70         backup          \
  71         banner          \
  72         bart            \
  73         basename        \
  74         bc              \
  75         bdiff           \
  76         beadm           \
  77         bfs             \
  78         bnu             \
  79         boot            \
  80         busstat         \
  81         cal             \
  82         calendar        \
  83         captoinfo       \
  84         cat             \
  85         cdrw            \
  86         cfgadm          \
  87         checkeq         \
  88         checknr         \
  89         chgrp           \
  90         chmod           \
  91         chown           \
  92         chroot          \
  93         clear           \
  94         clinfo          \
  95         cmd-crypto      \
  96         cmd-inet        \
  97         col             \
  98         compress        \
  99         consadm         \
 100         coreadm         \
 101         cpio            \
 102         cpc             \
 103         cron            \
 104         crypt           \
 105         csh             \
 106         csplit          \
 107         ctrun           \
 108         ctstat          \
 109         ctwatch         \
 110         datadm          \
 111         date            \
 112         dc              \
 113         dd              \
 114         deroff          \
 115         devfsadm        \
 116         syseventd       \
 117         devctl          \
 118         devinfo         \
 119         devmgmt         \
 120         devprop         \
 121         dfs.cmds        \
 122         diff            \
 123         diff3           \
 124         diffmk          \
 125         dircmp          \
 126         dirname         \
 127         dis             \
 128         diskmgtd        \
 129         dispadmin       \
 130         dladm           \
 131         dlstat          \
 132         dmesg           \
 133         dodatadm        \
 134         dtrace          \
 135         du              \
 136         dumpadm         \
 137         dumpcs          \
 138         echo            \
 139         ed              \
 140         eeprom          \
 141         egrep           \
 142         eject           \
 143         emul64ioctl     \
 144         enhance         \
 145         env             \
 146         eqn             \
 147         expand          \
 148         expr            \
 149         exstr           \
 150         factor          \
 151         false           \
 152         fcinfo          \
 153         fcoesvc         \
 154         fdetach         \
 155         fdformat        \
 156         fdisk           \
 157         filesync        \
 158         fgrep           \
 159         file            \
 160         filebench       \
 161         find            \
 162         flowadm         \
 163         flowstat        \
 164         fm              \
 165         fmt             \
 166         fmthard         \
 167         fmtmsg          \
 168         fold            \
 169         format          \
 170         fs.d            \
 171         fstyp           \
 172         fuser           \
 173         fwflash         \
 174         gcore           \
 175         gencat          \
 176         geniconvtbl     \
 177         genmsg          \
 178         getconf         \
 179         getdevpolicy    \
 180         getent          \
 181         getfacl         \
 182         getmajor        \
 183         getopt          \
 184         gettext         \
 185         gettxt          \
 186         grep            \
 187         grep_xpg4       \
 188         groups          \
 189         grpck           \
 190         gss             \
 191         hal             \
 192         halt            \
 193         head            \
 194         hostid          \
 195         hostname        \
 196         hotplug         \
 197         hotplugd        \
 198         hwdata          \
 199         ibd_upgrade     \
 200         iconv           \
 201         id              \
 202         idmap           \
 203         infocmp         \
 204         init            \
 205         initpkg         \
 206         install.d       \
 207         intrd           \
 208         intrstat        \
 209         ipcrm           \
 210         ipcs            \
 211         ipf             \
 212         isainfo         \
 213         isalist         \
 214         itutools        \
 215         iscsiadm        \
 216         iscsid          \
 217         iscsitsvc       \
 218         isns            \
 219         itadm           \
 220         java            \
 221         kbd             \
 222         keyserv         \
 223         killall         \
 224         krb5            \
 225         ksh             \
 226         kvmstat         \
 227         last            \
 228         lastcomm        \
 229         latencytop      \
 230         ldap            \
 231         ldapcachemgr    \
 232         lgrpinfo        \
 233         line            \
 234         link            \
 235         dlmgmtd         \
 236         listen          \
 237         loadkeys        \
 238         locale          \
 239         localedef       \
 240         lockstat        \
 241         locator         \
 242         lofiadm         \
 243         logadm          \
 244         logger          \
 245         login           \
 246         logins          \
 247         look            \
 248         ls              \
 249         luxadm          \
 250         lvm             \
 251         mach            \
 252         machid          \
 253         mail            \
 254         mailx           \
 255         makekey         \
 256         mdb             \
 257         mesg            \
 258         mkdir           \
 259         mkfifo          \
 260         mkfile          \
 261         mkmsgs          \
 262         mknod           \
 263         mkpwdict        \
 264         mktemp          \
 265         modload         \
 266         more            \
 267         mpathadm        \
 268         msgfmt          \
 269         msgid           \
 270         mt              \
 271         mv              \
 272         mvdir           \
 273         ndmpadm         \
 274         ndmpd           \
 275         ndmpstat        \
 276         netadm          \
 277         netfiles        \
 278         newform         \
 279         newgrp          \
 280         news            \
 281         newtask         \
 282         nice            \
 283         nl              \
 284         nlsadmin        \
 285         nohup           \
 286         nsadmin         \
 287         nscd            \
 288         oamuser         \
 289         oawk            \
 290         od              \
 291         pack            \
 292         pagesize        \
 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         last            \
 622         ldap            \
 623         ldapcachemgr    \
 624         lgrpinfo        \
 625         locale          \
 626         lofiadm         \
 627         logadm          \
 628         logger          \
 629         logins          \
 630         ls              \
 631         luxadm          \
 632         lvm             \
 633         mailx           \
 634         mesg            \
 635         mkdir           \
 636         mkpwdict        \
 637         mktemp          \
 638         more            \
 639         mpathadm        \
 640         msgfmt          \
 641         mv              \
 642         ndmpadm         \
 643         ndmpstat        \
 644         newgrp          \
 645         newtask         \
 646         nice            \
 647         nohup           \
 648         oawk            \
 649         pack            \
 650         passwd          \
 651         passmgmt        \
 652         pathchk         \
 653         pfexec          \
 654         pg              \
 655         pgrep           \
 656         picl            \
 657         pools           \
 658         power           \
 659         pr              \
 660         praudit         \
 661         print           \
 662         profiles        \
 663         projadd         \
 664         projects        \
 665         prstat          \
 666         prtdiag         \
 667         ps              \
 668         psrinfo         \
 669         ptools          \
 670         pwconv          \
 671         pwd             \
 672         pyzfs           \
 673         raidctl         \
 674         ramdiskadm      \
 675         rcap            \
 676         rcm_daemon      \
 677         refer           \
 678         regcmp          \
 679         renice          \
 680         roles           \
 681         rm              \
 682         rmdir           \
 683         rmformat        \
 684         rmmount         \
 685         rmvolmgr        \
 686         sasinfo         \
 687         sbdadm          \
 688         scadm           \
 689         script          \
 690         scsi            \
 691         sdiff           \
 692         sdpadm          \
 693         sgs             \
 694         sh              \
 695         shcomp          \
 696         smbsrv          \
 697         sort            \
 698         split           \
 699         srptadm         \
 700         ssh             \
 701         stat            \
 702         stmfadm         \
 703         stmsboot        \
 704         strings         \
 705         su              \
 706         svc             \
 707         svr4pkg         \
 708         swap            \
 709         syseventadm     \
 710         syseventd       \
 711         tabs            \
 712         tar             \
 713         tbl             \
 714         time            \
 715         tnf             \
 716         touch           \
 717         tput            \
 718         troff           \
 719         tsol            \
 720         tty             \
 721         ttymon          \
 722         tzreload        \
 723         ul              \
 724         uname           \
 725         units           \
 726         unlink          \
 727         unpack          \
 728         userattr        \
 729         valtools        \
 730         vgrind          \
 731         vi              \
 732         volcheck        \
 733         volrmmount      \
 734         vrrpadm         \
 735         vscan           \
 736         w               \
 737         who             \
 738         whodo           \
 739         wracct          \
 740         write           \
 741         wusbadm         \
 742         xargs           \
 743         yppasswd        \
 744         zdump           \
 745         zfs             \
 746         zic             \
 747         zlogin          \
 748         zoneadm         \
 749         zoneadmd        \
 750         zonecfg         \
 751         zonename        \
 752         zpool           \
 753         zonestat
 754 
 755 $(CLOSED_BUILD)MSGSUBDIRS += \
 756         $(CLOSED)/cmd/iconv     \
 757         $(CLOSED)/cmd/ksh       \
 758         $(CLOSED)/cmd/localedef \
 759         $(CLOSED)/cmd/more_xpg4 \
 760         $(CLOSED)/cmd/od        \
 761         $(CLOSED)/cmd/patch     \
 762         $(CLOSED)/cmd/pax       \
 763         $(CLOSED)/cmd/printf    \
 764         $(CLOSED)/cmd/sed       \
 765         $(CLOSED)/cmd/sed_xpg4
 766 
 767 sparc_MSGSUBDIRS=       \
 768         fruadm          \
 769         prtdscp         \
 770         prtfru          \
 771         virtinfo        \
 772         vntsd
 773 
 774 i386_MSGSUBDIRS=        \
 775         ucodeadm
 776 
 777 #
 778 # commands that use dcgettext for localized time, LC_TIME
 779 #
 780 DCSUBDIRS=              \
 781         cal             \
 782         cfgadm          \
 783         diff            \
 784         ls              \
 785         pr              \
 786         ps              \
 787         tar             \
 788         w               \
 789         who             \
 790         whodo           \
 791         write
 792 
 793 $(CLOSED_BUILD)DCSUBDIRS += \
 794         $(CLOSED)/cmd/pax
 795 
 796 #
 797 # commands that belong only to audit.
 798 #
 799 AUDITSUBDIRS=           \
 800         amt             \
 801         audit           \
 802         audit_warn      \
 803         auditconfig     \
 804         auditd          \
 805         auditrecord     \
 806         auditreduce     \
 807         auditset        \
 808         auditstat       \
 809         praudit         
 810 
 811 #
 812 # commands not owned by the systems group
 813 #
 814 BWOSDIRS=
 815 
 816 
 817 all :=          TARGET = all
 818 install :=      TARGET = install
 819 clean :=        TARGET = clean
 820 clobber :=      TARGET = clobber
 821 lint :=         TARGET = lint
 822 _msg :=         TARGET = _msg
 823 _dc :=          TARGET = _dc
 824 
 825 .KEEP_STATE:
 826 
 827 SUBDIRS = $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
 828 
 829 .PARALLEL:      $(BWOSDIRS) $(SUBDIRS) $(MSGSUBDIRS) $(AUDITSUBDIRS)
 830 
 831 all install clean clobber lint: $(FIRST_SUBDIRS) .WAIT $(SUBDIRS) \
 832         $(AUDITSUBDIRS)
 833 
 834 #
 835 # Manifests cannot be checked in parallel, because we are using
 836 # the global repository that is in $(SRC)/cmd/svc/seed/global.db.
 837 # For this reason, to avoid .PARALLEL and .NO_PARALLEL conflicts,
 838 # we spawn off a sub-make to perform the non-parallel 'make check'
 839 #
 840 check:
 841         $(MAKE) -f Makefile.check check
 842 
 843 #
 844 # The .WAIT directive works around an apparent bug in parallel make.
 845 # Evidently make was getting the target _msg vs. _dc confused under
 846 # some level of parallelization, causing some of the _dc objects
 847 # not to be built.
 848 #
 849 _msg: $(MSGSUBDIRS) $($(MACH)_MSGSUBDIRS) .WAIT _dc
 850 
 851 _dc: $(DCSUBDIRS)
 852 
 853 #
 854 # Dependencies
 855 #
 856 fs.d: fstyp
 857 ksh:    shcomp isaexec
 858 mdb:    terminfo
 859 print:  lp
 860 
 861 $(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(AUDITSUBDIRS): FRC
 862         @if [ -f $@/Makefile  ]; then \
 863                 cd $@; pwd; $(MAKE) $(TARGET); \
 864         else \
 865                 true; \
 866         fi
 867 
 868 FRC: