Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/i86pc/unix/Makefile
          +++ new/usr/src/uts/i86pc/unix/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.
  
    | 
      ↓ open down ↓ | 
    14 lines elided | 
    
      ↑ open up ↑ | 
  
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  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 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25      -# Copyright 2016 Joyent, Inc.
  26   25  #
  27   26  #       This makefile drives the production of unix (and unix.o).
  28   27  #
  29   28  #       i86pc implementation architecture dependent
  30   29  #
  31   30  
  32   31  #
  33   32  #       Path to the base of the uts directory tree (usually /usr/src/uts).
  34   33  #
  35   34  UTSBASE = ../..
  36   35  
  37   36  #
  38   37  #       Define the module and object file sets.
  39   38  #
  40   39  UNIX            = unix
  41   40  DBOOT           = dboot
  42   41  MULTIBOOT       = multiboot
  43   42  
  44   43  OBJECTS         = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
  45   44                    $(CORE_OBJS:%=$(OBJS_DIR)/%) \
  46   45                    $(KRTLD_OBJS:%=$(OBJS_DIR)/%) \
  47   46                    $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
  48   47  
  49   48  LINTS           = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
  50   49                    $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
  51   50                    $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \
  52   51                    $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
  53   52                    $(LINTS_DIR)/vers.ln \
  54   53                    $(LINTS_DIR)/modstubs.ln
  55   54  
  56   55  ROOTMODULE      = $(ROOT_PSM_KERN_DIR)/$(UNIX)
  57   56  ROOT_MULTIBOOT  = $(ROOT_PSM_DIR)/$(MULTIBOOT)
  58   57  
  59   58  UNIX_BIN        = $(OBJS_DIR)/$(UNIX)
  60   59  
  61   60  LIBS            = $(GENLIB)
  62   61  
  63   62  GENUNIX         = genunix
  64   63  GENUNIX_DIR     = ../../intel/$(GENUNIX)
  65   64  
  66   65  LIBOPTS         = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
  67   66  
  68   67  CTFEXTRAOBJS    = $(OBJS_DIR)/vers.o $(OBJS_DIR)/comm_page_ctf.o
  69   68  
  70   69  DBOOT_OBJS_DIR  = dboot/$(OBJS_DIR)
  71   70  DBOOT_OBJECTS   = $(DBOOT_OBJS:%=$(DBOOT_OBJS_DIR)/%)
  72   71  DBOOT_BIN       = $(DBOOT_OBJS_DIR)/$(DBOOT)
  73   72  DBOOT_O         = $(OBJS_DIR)/$(DBOOT).o
  74   73  DBOOT_S         = $(DBOOT_O:%.o=%.s)
  75   74  DBOOT_LINTS     = $(DBOOT_OBJS:%.o=$(DBOOT_OBJS_DIR)/%.ln)
  76   75  DBOOT_LINT      = $(i386_LINT)
  77   76  DBOOT_LINTTAGS  = -erroff=E_STATIC_UNUSED
  78   77  
  79   78  #
  80   79  #       Include common rules.
  81   80  #
  82   81  include $(UTSBASE)/i86pc/Makefile.i86pc
  83   82  
  84   83  #
  85   84  #       Define targets
  86   85  #
  87   86  ALL_TARGET      = $(UNIX_BIN) $(MULTIBOOT)
  88   87  LINT_TARGET     = $(LINT_LIB) $(DBOOT_LINT_LIB)
  89   88  INSTALL_TARGET  = $(UNIX_BIN) $(MULTIBOOT) $(ROOTMODULE) $(ROOT_MULTIBOOT)
  90   89  
  91   90  #
  92   91  #       This is UNIX_DIR. Use a short path.
  93   92  #
  94   93  UNIX_DIR        = .
  95   94  
  96   95  #
  97   96  #       Overrides
  98   97  #
  99   98  CLEANFILES      +=              \
 100   99          $(UNIX_O) $(MODSTUBS_O) \
 101  100          $(OBJS_DIR)/vers.c \
 102  101          $(OBJS_DIR)/dtracestubs.s \
 103  102          $(DTRACESTUBS_O) $(DTRACESTUBS) \
 104  103          $(CTFEXTRAOBJS)
 105  104  
 106  105  CLEANFILES      +=              \
 107  106          $(DBOOT_O) $(DBOOT_S)   \
 108  107          $(DBOOT_OBJECTS)        \
 109  108          $(OBJS_DIR)/bios_call_src.o \
 110  109          $(OBJS_DIR)/bios_call_src \
 111  110          $(OBJS_DIR)/bios_call.s \
 112  111          $(DBOOT_BIN)
 113  112  
 114  113  CLEANFILES      +=              \
 115  114          $(OBJS_DIR)/fb_swtch_src.o \
 116  115          $(OBJS_DIR)/fb_swtch_src \
 117  116          $(OBJS_DIR)/fb_swtch.s
 118  117  
 119  118  CLEANFILES      += \
 120  119          $(ZLIB_OBJS:%.o=$(OBJS_DIR)/%.o) \
 121  120          $(ZLIB_OBJS:%.o=$(OBJS_DIR)/%.ln)
 122  121  
 123  122  CLOBBERFILES    = $(CLEANFILES) $(UNIX_BIN) $(MULTIBOOT)
 124  123  CLEANLINTFILES  += $(LINT_LIB) $(DBOOT_LINT_LIB) $(DBOOT_LINTS)
 125  124  
 126  125  # instr_size needs a special header
 127  126  $(OBJS_DIR)/instr_size.o :=     EXTRA_OPTIONS   = -I$(SRC)/common/dis/i386
 128  127  $(OBJS_DIR)/instr_size.ln :=    EXTRA_OPTIONS   = -I$(SRC)/common/dis/i386
 129  128  
 130  129  CFLAGS += -DDIS_MEM
 131  130  
 132  131  #
 133  132  # For now, disable these lint checks; maintainers should endeavor
 134  133  # to investigate and remove these for maximum lint coverage.
 135  134  # Please do not carry these forward to new Makefiles.
 136  135  #
 137  136  LINTTAGS        += -erroff=E_BAD_PTR_CAST_ALIGN
 138  137  LINTTAGS        += -erroff=E_SUSPICIOUS_COMPARISON
 139  138  LINTTAGS        += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 140  139  LINTTAGS        += -erroff=E_STATIC_UNUSED
 141  140  LINTTAGS        += -erroff=E_PTRDIFF_OVERFLOW
 142  141  LINTTAGS        += -erroff=E_ASSIGN_NARROW_CONV
 143  142  
 144  143  CERRWARN        += -_gcc=-Wno-parentheses
 145  144  CERRWARN        += -_gcc=-Wno-uninitialized
 146  145  CERRWARN        += -_gcc=-Wno-char-subscripts
 147  146  CERRWARN        += -_gcc=-Wno-unused-variable
 148  147  CERRWARN        += -_gcc=-Wno-unused-function
 149  148  CERRWARN        += -_gcc=-Wno-unused-label
 150  149  CERRWARN        += -_gcc=-Wno-type-limits
 151  150  CERRWARN        += -_gcc=-Wno-clobbered
 152  151  CERRWARN        += -_gcc=-Wno-empty-body
 153  152  CERRWARN        += -_gcc=-Wno-unused-value
 154  153  
 155  154  # Ensure that lint sees 'struct cpu' containing a fully declared
 156  155  # embedded 'struct machcpu'
 157  156  #
 158  157  LINTFLAGS       += -D_MACHDEP -I../../i86pc
 159  158  
 160  159  #
 161  160  #       Default build targets.
 162  161  #
 163  162  .KEEP_STATE:
 164  163  
 165  164  def: $(DEF_DEPS)
 166  165  
 167  166  all: $(ALL_DEPS)
 168  167  
 169  168  clean: $(CLEAN_DEPS)
 170  169  
 171  170  clobber: $(CLOBBER_DEPS)
 172  171  
 173  172  lint: $(LINT_DEPS)
 174  173  
 175  174  clean.lint: $(CLEAN_LINT_DEPS)
 176  175  
 177  176  install: $(INSTALL_DEPS)
 178  177  
 179  178  MAPFILE_32 = $(MAPFILE)
 180  179  MAPFILE_64 = $(MAPFILE).amd64
 181  180  
 182  181  MAPFILE_NAME = $(MAPFILE_$(CLASS))
 183  182  
 184  183  $(UNIX_BIN):    $(UNIX_O) $(MODSTUBS_O) $(MAPFILE_NAME) \
 185  184                  $(GENLIB) $(DTRACESTUBS) $(DBOOT_O)
 186  185          $(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
 187  186              $(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
 188  187              $(DTRACESTUBS)
 189  188          $(MBH_PATCH) $(UNIX_BIN)
 190  189          $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
 191  190          $(POST_PROCESS)
 192  191  
 193  192  $(UNIX_O):      $(OBJECTS) $(CTFEXTRAOBJS)
 194  193          $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
 195  194  
 196  195  $(DBOOT_BIN):   $(DBOOT_OBJS_DIR) $(DBOOT_OBJECTS) dboot/Mapfile.dboot
 197  196          $(LD) -dn -e _start -M dboot/Mapfile.dboot \
 198  197                  -o $(DBOOT_BIN) $(DBOOT_OBJECTS)
 199  198  
 200  199  $(DBOOT_O):     $(DBOOT_BIN)
 201  200          @echo " .data"                                  > $(DBOOT_S)
 202  201          @echo " .globl  dboot_image"                    >> $(DBOOT_S)
 203  202          @echo "dboot_image:"                            >> $(DBOOT_S)
 204  203          $(ELFEXTRACT) $(DBOOT_BIN)                      >> $(DBOOT_S)
 205  204          $(COMPILE.s) -o $(DBOOT_O) $(DBOOT_S)
 206  205  
 207  206  $(DBOOT_OBJS_DIR):
 208  207          -@mkdir -p $@ 2> /dev/null
 209  208  
 210  209  $(OBJS_DIR)/comm_page_ctf.o:    $(UTSBASE)/i86pc/ml/comm_page.s
 211  210          $(COMPILE.c) -_gcc=-xc -D_GENCTF -o $@ $(UTSBASE)/i86pc/ml/comm_page.s
 212  211          $(CTFCONVERT_O)
 213  212  
 214  213  #
 215  214  # dboot is built as an intermediate target in dboot.o, so just make
 216  215  # dboot.o the dependency here.
 217  216  #
 218  217  $(MULTIBOOT):   $(DBOOT_O)
 219  218          $(CP)   $(DBOOT_BIN) $(MULTIBOOT)
 220  219          $(POST_PROCESS)
 221  220  
 222  221  #
 223  222  #       Special rules for generating assym.h for inclusion in assembly files.
 224  223  #
 225  224  $(DSF_DIR)/$(OBJS_DIR)/assym.h $(DSF_DIR)/$(OBJS_DIR)/kdi_assym.h:      FRC
 226  225          @cd $(DSF_DIR); $(MAKE) all.targ
 227  226  
 228  227  #
 229  228  #       The global lint target builds the kernel lint library (llib-lunix.ln)
 230  229  #       which is equivalent to a lint of /unix.o. Then all kernel modules for
 231  230  #       this architecture are linted against the kernel lint library.
 232  231  #
 233  232  #       Note:   lint errors in the kernel lint library will be repeated for
 234  233  #               each module. It is important that the kernel lint library
 235  234  #               be clean to keep the textual output to a reasonable level.
 236  235  #
 237  236  
 238  237  $(LINT_LIB):    $(LINT_LIB_DIR) $(LINTS)
 239  238          @pwd
 240  239          @-$(ECHO) "\n$(UNIX): (library construction):"
 241  240          @$(LINT) -o$(UNIX) $(LINTFLAGS) $(LINTS)
 242  241          @$(MV) $(@F) $@
 243  242  
 244  243  $(DBOOT_LINT_LIB):      $(LINT_LIB_DIR) $(DBOOT_LINTS)
 245  244          @pwd
 246  245          @-$(ECHO) "\n$(DBOOT): (library construction):"
 247  246          @$(LINT) -o$(DBOOT) $(DBOOT_LINTFLAGS) $(DBOOT_LINTS)
 248  247          @$(MV) $(@F) $@
 249  248  
 250  249  lintlib:        $(LINT_DEPS)
 251  250  
 252  251  #
 253  252  #       Include common targets.
 254  253  #
 255  254  include $(UTSBASE)/i86pc/Makefile.targ
  
    | 
      ↓ open down ↓ | 
    220 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX