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