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 # uts/intel/Makefile
  22 #
  23 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #
  25 #       This makefile drives the production of all implementation architecture
  26 #       independent modules for Intel processors.
  27 
  28 UTSBASE = ..
  29 
  30 include Makefile.intel
  31 
  32 LINT_KMODS_X1   = $(LINT_KMODS:nsmb=)
  33 LINT_KMODS_X2   = $(LINT_KMODS_X1:smbfs=)
  34 LINT_KMODLIBS   = $(LINT_KMODS_X2:e1000g=)
  35 LINT_LIBS       = $(LINT_LIB) $(GEN_LINT_LIB) \
  36                   $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
  37 
  38 #
  39 # dprov is delivered in the SUNWcryptoint package.
  40 #
  41 DRV_KMODS       += dprov
  42 
  43 #
  44 #
  45 def             :=      TARGET= def
  46 def.prereq      :=      TARGET= def
  47 all             :=      TARGET= all
  48 all.prereq      :=      TARGET= all
  49 install         :=      TARGET= install
  50 install.prereq  :=      TARGET= all
  51 clean           :=      TARGET= clean
  52 clobber         :=      TARGET= clobber
  53 lint            :=      TARGET= lint
  54 lint.prereq     :=      TARGET= lint
  55 modlintlib      :=      TARGET= modlintlib
  56 modlist         :=      TARGET= modlist
  57 modlist         :=      NO_STATE= -K $$MODSTATE$$$$
  58 clean.lint      :=      TARGET= clean.lint
  59 check           :=      TARGET= check
  60 install_h       :=      TARGET= install_h
  61 install_h.prereq        :=      TARGET= install_h
  62 
  63 .KEEP_STATE:
  64 
  65 .PARALLEL:      $(PARALLEL_KMODS) $(XMODS) config $(LINT_DEPS)
  66 
  67 def all install clean clobber modlist: $(KMODS) $(XMODS) config
  68 
  69 
  70 #
  71 # Privilege constants
  72 #
  73 # NOTE: The rules for generating priv_const.c file are shared between all
  74 # processor architectures and and should be kept in sync. If they are changed in
  75 # this file make sure that sparc rules are updated as well.
  76 #
  77 PRIVS_C = $(SRC)/uts/common/os/priv_const.c
  78 
  79 $(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
  80         $(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
  81 
  82 #
  83 # Prerequisites
  84 #
  85 # The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
  86 # i86xpv and intel are all built in parallel. This requires building certain
  87 # parts before the parallel build can start. The uts/Makefile appends the
  88 # '.prereq' string to the original target and executes this Makefile to build
  89 # any prerequisites needed before the full parallel build can start. After that
  90 # make continues with normal targets.
  91 #
  92 # Any build prerequisites for x86 builds should be described here.
  93 #
  94 # genassym is used to build intel/dtrace and genunix, so it should be built
  95 # first.
  96 #
  97 # priv_const.c is required to build genunix.
  98 #
  99 # genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
 100 #   intel/ip so as a side effect this dependency builds intel/ip as part of the
 101 #   prerequisites.
 102 #
 103 # intel/dtrace depends on i86pc/genassym, so we need to build both
 104 # i86pc/genassym and intel/genassym.
 105 #
 106 all.prereq install.prereq def.prereq: genunix FRC
 107         @cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
 108 
 109 #
 110 # i86pc lint libraries should be built first
 111 #
 112 lint.prereq: FRC
 113         @cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
 114 
 115 #
 116 # Nothing to do for any other prerequisite targets.
 117 #
 118 %.prereq:
 119 
 120 genunix: $(PRIVS_C)
 121 
 122 modlintlib clean.lint: $(LINT_KMODS) $(XMODS)
 123 
 124 $(KMODS) $(SUBDIRS) config:     FRC
 125         @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
 126 
 127 $(XMODS):       FRC
 128         @if [ -f $@/Makefile  ]; then \
 129                 cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
 130         else \
 131                 true; \
 132         fi
 133 
 134 install_h check:        FRC
 135         @cd sys; pwd; $(MAKE) $(TARGET)
 136         @cd asm; pwd; $(MAKE) $(TARGET)
 137         @cd ia32/sys; pwd; $(MAKE) $(TARGET)
 138         @cd amd64/sys; pwd; $(MAKE) $(TARGET)
 139 
 140 #
 141 # Work-around to disable acpica global crosscheck lint warnings
 142 #
 143 LGREP.intel =   grep -v 'intel/io/acpica'
 144 
 145 #
 146 #       Full kernel lint target.
 147 #
 148 LINT_TARGET     = globallint
 149 
 150 # workaround for multiply defined errors
 151 globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
 152 
 153 globallint:
 154         @pwd
 155         @-$(ECHO) "\nFULL KERNEL: global crosschecks:"
 156         @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
 157 
 158 lint:   modlintlib .WAIT $(LINT_DEPS)
 159 
 160 include ../Makefile.targ