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 2007 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27# This makefile drives the production of all implementation architecture 28# dependent modules for the sun4v architecture. 29# 30 31UTSBASE = .. 32 33include Makefile.sun4v 34include Makefile.stpaul 35include Makefile.huron 36USR_GLENDALE_DIR = $(USR_PLAT_DIR)/SUNW,Sun-Blade-T6320 37USR_GLENDALE_SBIN_DIR = $(USR_GLENDALE_DIR)/sbin 38USR_GLENDALE_LIB_DIR = $(USR_GLENDALE_DIR)/lib 39 40 41# 42# The following are SPARC specific (rather than sun4v) specific modules 43# which are required for the sun4v kernel to completely lint. They are 44# not involved in the build in any other way. In order to minimize 45# build time, it is assumed that they are up to date. But since sun4v 46# is really a separate architecture we cannot use the v7 sparc modules. 47# 48SPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 49 50SPARC_LINTS = 51 52# 53# 54# 55LINT_LIBS = $(LINT_LIB) \ 56 $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 57 $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 58 $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln) 59 60# EXPORT DELETE START 61# 62# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*) 63# They need to be listed separately since they duplicate global symbols 64# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS 65# should not be listed in the lint target. 66# 67# Don't build this for OpenSolaris, since it will be replaced by 68# a binary that is signed by Sun RE. 69# 70$(CLOSED_BUILD)CRYPTO_EK_KMODS += arcfour2048 71# EXPORT DELETE END 72 73def := TARGET= def 74all := TARGET= all 75install := TARGET= install 76install_h := TARGET= install_h 77clean := TARGET= clean 78clobber := TARGET= clobber 79lint := TARGET= lint 80lintlib := TARGET= lintlib 81modlintlib := TARGET= modlintlib 82modlist := TARGET= modlist 83modlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$ 84clean.lint := TARGET= clean.lint 85check := TARGET= check 86 87.KEEP_STATE: 88 89.PARALLEL: $(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 90 modlist modlist.sparc 91 92# Override for CPU_KMODS... they cannot be built 93# in parallel 94.NO_PARALLEL: $(CPU_KMODS) 95 96def all clean clobber clean.lint: genassym unix .WAIT \ 97 $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) 98 99# list the modules under sun4v. 100modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 101 $(IMPLEMENTATIONS) 102 103# list the modules for Install -k sun4v. 104modlist.karch: modlist modlist.sparc 105 106modlist.sparc: 107 @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist 108 109install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \ 110 $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) 111 112lintlib: unix 113 114modlintlib: $(LINT_KMODS) $(CLOSED_LINT_KMODS) 115 116genassym unix $(KMODS): FRC 117 @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 118 119$(IMPLEMENTATIONS): FRC 120 @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET) 121 122$(XMODS): FRC 123 @if [ -f $@/Makefile ]; then \ 124 cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 125 else \ 126 true; \ 127 fi 128 129$(CLOSED_XMODS): FRC 130 @if [ -f $(CLOSED)/uts/sun4v/$@/Makefile ]; then \ 131 cd $(CLOSED)/uts/sun4v/$@; pwd; \ 132 $(MAKE) $(NO_STATE) $(TARGET); \ 133 else \ 134 true; \ 135 fi 136 137$(CLOSED_KMODS): FRC 138 cd $(CLOSED)/uts/sun4v/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 139 140install_h check: install_platforms $(IMPLEMENTATIONS) FRC 141 @cd sys; pwd; $(MAKE) $(TARGET) 142 @cd vm; pwd; $(MAKE) $(TARGET) 143 144# 145# Rules for the /platforms directories. This is hardwired here because 146# the first stage of the project (KBI) only implements the userland 147# changes, but the only reasonable place to record the aliases is 148# here in kernel land. 149# 150$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 151 -$(INS.dir.root.sys) 152 153$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%): $(ROOT_PLAT_DIR) 154 $(INS.slink1) 155 156# 157# create directories in /usr/platform/ for the implementations that are 158# defined in $(IMPLEMENTED_PLATFORM) 159# 160 161# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 162# that are linked to it. 163# 164$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 165 -$(INS.dir.root.sys) 166 167# 168# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 169# to it's corresponding $(IMPLEMENTED_PLATFORM). 170# 171PLATFORMS = $(LINKED_PLATFORMS) 172 173$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 174 $(INS.slink3) 175 176PLATFORMS += $(IMPLEMENTED_PLATFORM) 177 178# 179# Make the /platforms directories. This is hardwired here because 180# the first stage of the project (KBI) only implements the userland 181# changes, but the only reasonable place to record the aliases is 182# here in kernel land. 183# 184install_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 185 $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 186 $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%) \ 187 $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 188 $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) \ 189 $(USR_STPAUL_DIR) $(USR_STPAUL_SBIN_DIR) \ 190 $(USR_STPAUL_LIB_DIR) \ 191 $(USR_GLENDALE_DIR) $(USR_GLENDALE_SBIN_DIR) \ 192 $(USR_GLENDALE_LIB_DIR) \ 193 $(USR_HURON_DIR) \ 194 $(USR_HURON_SBIN_DIR) $(USR_HURON_LIB_DIR) 195 196# 197# rules for making include, sbin, lib dirs/links in 198# /usr/platform/$(PLATFORM)/ for desktop platforms 199# 200$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 201 $(INS.slink4) 202 203$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 204 $(INS.slink5) 205 206$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 207 -$(INS.dir.root.bin) 208 209$(USR_STPAUL_DIR): $(USR_SUN4V_PLAT_DIR) 210 -$(INS.dir.root.sys) 211 212$(USR_STPAUL_SBIN_DIR): $(USR_STPAUL_DIR) 213 $(INS.slink5) 214 215$(USR_STPAUL_LIB_DIR): $(USR_STPAUL_DIR) 216 -$(INS.dir.root.bin) 217 218$(USR_HURON_DIR): $(USR_SUN4V_PLAT_DIR) 219 -$(INS.dir.root.sys) 220 221$(USR_HURON_SBIN_DIR): $(USR_HURON_DIR) 222 $(INS.slink5) 223 224$(USR_HURON_LIB_DIR): $(USR_HURON_DIR) 225 -$(INS.dir.root.bin) 226 227$(USR_GLENDALE_DIR): $(USR_SUN4V_PLAT_DIR) 228 -$(INS.dir.root.sys) 229 230$(USR_GLENDALE_SBIN_DIR): $(USR_GLENDALE_DIR) 231 $(INS.slink5) 232 233$(USR_GLENDALE_LIB_DIR): $(USR_GLENDALE_DIR) 234 -$(INS.dir.root.bin) 235# 236# Full kernel lint target. 237# 238LINT_TARGET = globallint 239 240globallint: 241 @-$(ECHO) "\nSUN4V KERNEL: global crosschecks:" 242 @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) 243 244lint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \ 245 $(IMPLEMENTATIONS) 246 247# EXPORT DELETE START 248 249EXPORT_SRC: 250 $(RM) Makefile+ 251 sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ 252 < Makefile > Makefile+ 253 $(MV) Makefile+ Makefile 254 $(CHMOD) 444 Makefile 255 256# EXPORT DELETE END 257 258include ../Makefile.targ 259 260# 261# Cross-reference customization: build a cross-reference over all of the 262# sun4v-related directories. 263# 264SHARED_XRDIRS = ../sun4v ../sun4 ../sfmmu ../sparc ../sun ../common 265CLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%) 266XRDIRS = $(SHARED_XRDIRS) 267$(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=) 268 269XRPRUNE = i86pc 270 271cscope.out tags: FRC 272 $(XREF) -x $@ 273