Print this page
    
6366 Allow ON_CLOSED_BINS to point to a directory with tarballs
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/Makefile
          +++ new/usr/src/Makefile
   1    1  #
   2    2  # CDDL HEADER START
   3    3  #
   4    4  # The contents of this file are subject to the terms of the
   5    5  # Common Development and Distribution License (the "License").
   6    6  # You may not use this file except in compliance with the License.
   7    7  #
   8    8  # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9  # or http://www.opensolaris.org/os/licensing.
  10   10  # See the License for the specific language governing permissions
  11   11  # and limitations under the License.
  12   12  #
  13   13  # When distributing Covered Code, include this CDDL HEADER in each
  14   14  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  
    | 
      ↓ open down ↓ | 
    15 lines elided | 
    
      ↑ open up ↑ | 
  
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24  # Copyright (c) 2012 by Delphix. All rights reserved.
  25   25  # Copyright 2014 Garrett D'Amore <garrett@damore.org>
       26 +# Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
  26   27  #
  27   28  
  28   29  #
  29   30  # Makefile for system source
  30   31  #
  31   32  # include global definitions
  32   33  include Makefile.master
  33   34  #
  34   35  # the Targetdirs file is the AT&T target.dirs file in a makefile format.
  35   36  # it defines TARGETDIRS and ROOTDIRS.
  36   37  include Targetdirs
  37   38  
  38   39  COMMON_SUBDIRS= uts lib cmd ucblib ucbcmd psm man test
  39   40  sparc_SUBDIRS= stand
  40   41  i386_SUBDIRS= grub
  41   42  
  42   43  #
  43   44  # sparc needs to build stand before psm
  44   45  #
  45   46  $(SPARC_BLD)psm: stand
  46   47  
  47   48  SUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
  48   49  
  49   50  HDRSUBDIRS=     uts head lib cmd
  50   51  
  51   52  # UCB headers are bug-for-bug compatible and not checkable against the header
  52   53  # standards.
  53   54  #
  54   55  CHKHDRSUBDIRS=  head uts lib
  55   56  
  56   57  #
  57   58  # Headers that can be built in parallel
  58   59  #
  59   60  PARALLEL_HEADERS = sysheaders userheaders libheaders cmdheaders
  60   61  
  61   62  #
  62   63  # Directories that can be built in parallel
  63   64  #
  64   65  PARALLEL_DIRS = uts lib man
  65   66  
  66   67  # The check target also causes smf(5) service manifests to be validated.
  67   68  CHKMFSTSUBDIRS= cmd
  68   69  
  69   70  # And man page formats
  70   71  CHKMANSUBDIRS = man
  71   72  
  72   73  MSGSUBDIRS=     cmd ucbcmd lib
  73   74  DOMAINS= \
  74   75          SUNW_OST_ADMIN \
  75   76          SUNW_OST_NETRPC \
  76   77          SUNW_OST_OSCMD \
  77   78          SUNW_OST_OSLIB \
  78   79          SUNW_OST_UCBCMD \
  79   80          SUNW_OST_ZONEINFO
  80   81  
  81   82  MSGDDIRS=       $(DOMAINS:%=$(MSGROOT)/%)
  82   83  MSGDIRS=        $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
  83   84  
  84   85  all :=                  TARGET= all
  85   86  install :=              TARGET= install
  86   87  install1 :=             TARGET= install
  87   88  install2 :=             TARGET= install
  88   89  install_h :=            TARGET= install_h
  89   90  clean :=                TARGET= clean
  90   91  clobber :=              TARGET= clobber
  91   92  check :=                TARGET= check
  92   93  
  93   94  .KEEP_STATE:
  94   95  
  95   96  #
  96   97  # Note: install does not cause a build in pkg.  To build packages,
  97   98  #       cd pkg and do a 'make install'
  98   99  #
  99  100  
 100  101  all: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
 101  102  
 102  103  #
 103  104  # The _msg build is a two-step process.  First, the _msg dependency
 104  105  # causes recursive makes in $(MSGSUBDIRS), which stages raw message
 105  106  # files in $(ROOT)/catalog.  Second, the action from the install
 106  107  # target rule causes those messages to be post-processed from where
 107  108  # they were staged in $(ROOT)/catalog, and the results placed into the
 108  109  # proto area.
 109  110  #
 110  111  # The stage-licenses target causes the license files needed for
 111  112  # packaging to be pulled from $(SRC) and $(CLOSED) and staged in
 112  113  # $(ROOT)/licenses.
 113  114  #
 114  115  install: install1 install2 _msg stage-licenses
 115  116          @cd msg; pwd; $(MAKE) _msg
 116  117          @rm -rf "$(ROOT)/catalog"
 117  118  
 118  119  stage-licenses: install2
 119  120          @cd pkg; pwd; $(MAKE) stage-licenses
 120  121  
 121  122  install1: mapfiles closedbins sgs
 122  123  
 123  124  install2: install1 $(SUBDIRS)
 124  125  
 125  126  _msg: _msgdirs rootdirs FRC
 126  127          @for m in $(MSGSUBDIRS); do \
 127  128                  cd $$m; pwd; $(MAKE) _msg; cd ..; \
 128  129          done
 129  130  
  
    | 
      ↓ open down ↓ | 
    94 lines elided | 
    
      ↑ open up ↑ | 
  
 130  131  mapfiles: bldtools
 131  132          @cd common/mapfiles; pwd; $(MAKE) install
 132  133  
 133  134  clean: $(SUBDIRS) head pkg
 134  135  clobber: $(SUBDIRS) head pkg clobber_local
 135  136  clobber_local:
 136  137          @cd tools; pwd; $(MAKE) clobber
 137  138          @cd common/mapfiles; pwd; $(MAKE) clobber
 138  139          @cd msg; pwd; $(MAKE) clobber
 139  140  
      141 +# If the tarballs are included inside ON_CLOSED_BINS, use those to extract and
      142 +# preserve the permissions (in case a distro ships them).
      143 +
 140  144  closedbins: bldtools $(ROOTDIRS) FRC
 141  145          @CLOSED_ROOT="$$ON_CLOSED_BINS/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
      146 +        if [ -f "$$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2" ]; then \
      147 +                $(ECHO) "Extracting tarball $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2"; \
      148 +                (cd $(ROOT); \
      149 +                   $(TAR) xjpf $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2); \
      150 +                CLOSED_ROOT="$(ROOT)/closed/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
      151 +        fi; \
 142  152          if [ ! -d "$$CLOSED_ROOT" ]; then \
 143  153                  $(ECHO) "Error: ON_CLOSED_BINS must point to closed" \
 144  154                      "binaries."; \
 145  155                  $(ECHO) "root_$(MACH)$${RELEASE_BUILD+-nd} is not" \
 146  156                      "present in $$ON_CLOSED_BINS."; \
 147  157                  exit 1; \
 148  158          fi; \
 149  159          $(ECHO) "Copying closed binaries from $$CLOSED_ROOT"; \
 150  160          (cd $$CLOSED_ROOT; \
 151  161              $(TAR) cfX - $(CODEMGR_WS)/exception_lists/closed-bins .) | \
 152  162              (cd $(ROOT); $(TAR) xBpf -); \
 153  163          ( cd $(ROOT); $(CTFSTRIP) $$(cd $$CLOSED_ROOT; $(FIND) \
 154  164              ./kernel ./usr/kernel ./platform/*/kernel -type f -a -perm -u+x | \
 155  165              $(EGREP) -vf $(CODEMGR_WS)/exception_lists/closed-bins) )
 156  166  
 157  167  #
 158  168  # Declare what parts can be built in parallel
 159  169  # DUMMY at the end is used in case macro expansion produces an empty string to
 160  170  # prevent everything going in parallel
 161  171  #
 162  172  .PARALLEL: $(PARALLEL_HEADERS) DUMMY
 163  173  .PARALLEL: $(PARALLEL_DIRS) DUMMY
 164  174  
 165  175  $(SUBDIRS) head pkg: FRC
 166  176          @cd $@; pwd; $(MAKE) $(TARGET)
 167  177  
 168  178  # librpcsvc has a dependency on headers installed by
 169  179  # userheaders, hence the .WAIT before libheaders.
 170  180  sgs: rootdirs .WAIT sysheaders userheaders .WAIT \
 171  181          libheaders cmdheaders
 172  182  
 173  183  #
 174  184  # Top-level setup target to setup the development environment that includes
 175  185  # headers, tools and generated mapfiles.  For open-only builds (i.e.: source
 176  186  # trees w/o usr/closed), this also depends on the closedbins target (above)
 177  187  # in order to properly seed the proto area.  Note, although the tools are
 178  188  # dependent on a number of constant mapfiles, the tools themselves are
 179  189  # required to build the generated mapfiles.
 180  190  #
 181  191  setup: closedbins bldtools sgs mapfiles
 182  192  
 183  193  bldtools:
 184  194          @cd tools; pwd; $(MAKE) install
 185  195  
 186  196  # /var/mail/:saved is a special case because of the colon in the name.
 187  197  #
 188  198  rootdirs: $(ROOTDIRS)
 189  199          $(INS) -d -m 775 $(ROOT)/var/mail/:saved
 190  200  
 191  201  lint: FRC
 192  202          $(MAKE) -f Makefile.lint
 193  203  
 194  204  _msgdirs:       $(MSGDIRS)
 195  205  
 196  206  $(ROOTDIRS) $(MSGDIRS):
 197  207          $(INS.dir)
 198  208  
 199  209  userheaders: FRC
 200  210          @cd head; pwd; $(MAKE) install_h
 201  211  
 202  212  libheaders: bldtools
 203  213          @cd lib; pwd; $(MAKE) install_h
 204  214  
 205  215  sysheaders: FRC
 206  216          @cd uts; pwd; $(MAKE) install_h
 207  217  
 208  218  cmdheaders: FRC
 209  219          @cd cmd/fm; pwd; $(MAKE) install_h
 210  220          @cd cmd/mdb; pwd; $(MAKE) install_h
 211  221  
 212  222  check:  $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS) $(CHKMANSUBDIRS)
 213  223  
 214  224  #
 215  225  # Cross-reference customization: skip all of the subdirectories that
 216  226  # don't contain actual source code.
 217  227  #
 218  228  XRPRUNE = pkg prototypes
 219  229  XRINCDIRS = uts/common head ucbhead
 220  230  
 221  231  cscope.out tags: FRC
 222  232          $(XREF) -f -x $@
 223  233  
 224  234  FRC:
 225  235  
 226  236  #
 227  237  # Targets for reporting compiler versions; nightly uses these.
 228  238  #
 229  239  
 230  240  cc-version:
 231  241          @if $($(MACH)_CC) -_versions >/dev/null 2>/dev/null; then \
 232  242                  $(ECHO) 32-bit compiler;                        \
 233  243                  $(ECHO) $($(MACH)_CC);                          \
 234  244                  $($(MACH)_CC) -_versions 2>&1 |                 \
 235  245                      $(EGREP) '^(cw|cc|gcc|primary|shadow)';     \
 236  246          else                                                    \
 237  247                  __COMPILER=`$($(MACH)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
 238  248                  if [ -z "$$__COMPILER" ]; then                  \
 239  249                          $(ECHO) No 32-bit compiler found;       \
 240  250                          exit 1;                                 \
 241  251                  else                                            \
 242  252                          $(ECHO) 32-bit compiler;                \
 243  253                          $(ECHO) $($(MACH)_CC);                  \
 244  254                          $(ECHO) $$__COMPILER;                   \
 245  255                          $($(MACH)_CC) -V 2>&1 | head -1;        \
 246  256                  fi;                                             \
 247  257          fi
 248  258  
 249  259  cc64-version:
 250  260          @if $($(MACH64)_CC) -_versions >/dev/null 2>/dev/null; then \
 251  261                  $(ECHO) 64-bit compiler;                        \
 252  262                  $(ECHO) $($(MACH64)_CC);                        \
 253  263                  $($(MACH64)_CC) -_versions 2>&1 |               \
 254  264                      $(EGREP) '^(cw|cc|gcc|primary|shadow)';     \
 255  265          else                                                    \
 256  266                  __COMPILER=`$($(MACH64)_CC) -_compiler 2>/dev/null || $(TRUE)`;\
 257  267                  if [ -z "$$__COMPILER" ]; then                  \
 258  268                          $(ECHO) No 64-bit compiler found;       \
 259  269                          exit 1;                                 \
 260  270                  else                                            \
 261  271                          $(ECHO) 64-bit compiler;                \
 262  272                          $(ECHO) $($(MACH64)_CC);                \
 263  273                          $(ECHO) $$__COMPILER;                   \
 264  274                          $($(MACH64)_CC) -V 2>&1 | head -1;      \
 265  275                  fi;                                             \
 266  276          fi
 267  277  
 268  278  java-version:
 269  279          @if [ -x "$(JAVAC)" ]; then                     \
 270  280                  $(ECHO) $(JAVAC);                       \
 271  281                  $(JAVA_ROOT)/bin/java -fullversion 2>&1 | head -1;      \
 272  282          else                                            \
 273  283                  $(ECHO) No Java compiler found;         \
 274  284                  exit 1;                                 \
 275  285          fi
  
    | 
      ↓ open down ↓ | 
    124 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX