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, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28# This makefile drives the production of all implementation architecture 29# dependent modules for the sun4v architecture. 30# 31 32UTSBASE = .. 33 34include Makefile.sun4v 35 36# 37# The following are SPARC specific (rather than sun4v) specific modules 38# which are required for the sun4v kernel to completely lint. They are 39# not involved in the build in any other way. In order to minimize 40# build time, it is assumed that they are up to date. But since sun4v 41# is really a separate architecture we cannot use the v7 sparc modules. 42# 43SPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 44 45SPARC_LINTS = 46 47# 48# 49# 50LINT_LIBS = $(LINT_LIB) \ 51 $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 52 $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln) 53 54def := TARGET= def 55all := TARGET= all 56install := TARGET= install 57install_h := TARGET= install_h 58clean := TARGET= clean 59clobber := TARGET= clobber 60lint := TARGET= lint 61lintlib := TARGET= lintlib 62modlintlib := TARGET= modlintlib 63clean.lint := TARGET= clean.lint 64check := TARGET= check 65 66.KEEP_STATE: 67 68.PARALLEL: $(KMODS) $(XMODS) 69 70# Override for CPU_KMODS... they cannot be built 71# in parallel 72.NO_PARALLEL: $(CPU_KMODS) 73 74def all clean clobber clean.lint: genassym unix .WAIT $(KMODS) $(XMODS) \ 75 $(IMPLEMENTATIONS) 76 77install: install_platforms genassym unix .WAIT $(KMODS) $(XMODS) \ 78 $(IMPLEMENTATIONS) 79 80lintlib: unix 81 82modlintlib: $(LINT_KMODS) 83 84genassym unix $(KMODS) $(IMPLEMENTATIONS): FRC 85 @cd $@; pwd; $(MAKE) $(TARGET) 86 87$(XMODS): FRC 88 @if [ -f $@/Makefile ]; then \ 89 cd $@; pwd; $(MAKE) $(TARGET); \ 90 else \ 91 true; \ 92 fi 93 94install_h check: install_platforms $(IMPLEMENTATIONS) FRC 95 @cd sys; pwd; $(MAKE) $(TARGET) 96 @cd vm; pwd; $(MAKE) $(TARGET) 97 98# 99# Rules for the /platforms directories. This is hardwired here because 100# the first stage of the project (KBI) only implements the userland 101# changes, but the only reasonable place to record the aliases is 102# here in kernel land. 103# 104$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 105 -$(INS.dir.root.sys) 106 107# 108# create directories in /usr/platform/ for the implementations that are 109# defined in $(IMPLEMENTED_PLATFORM) 110# 111 112# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 113# that are linked to it. 114# 115$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 116 -$(INS.dir.root.sys) 117 118# 119# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 120# to it's corresponding $(IMPLEMENTED_PLATFORM). 121# 122PLATFORMS = $(LINKED_PLATFORMS) 123 124$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 125 $(INS.slink3) 126 127PLATFORMS += $(IMPLEMENTED_PLATFORM) 128 129# 130# Make the /platforms directories. This is hardwired here because 131# the first stage of the project (KBI) only implements the userland 132# changes, but the only reasonable place to record the aliases is 133# here in kernel land. 134# 135install_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 136 $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 137 $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 138 $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) 139 140# 141# rules for making include, sbin, lib dirs/links in 142# /usr/platform/$(PLATFORM)/ for desktop platforms 143# 144$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 145 $(INS.slink4) 146 147$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 148 $(INS.slink5) 149 150$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 151 -$(INS.dir.root.bin) 152 153# 154# Full kernel lint target. 155# 156LINT_TARGET = globallint 157 158globallint: 159 @-$(ECHO) "\nSUN4V KERNEL: global crosschecks:" 160 @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) 161 162lint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \ 163 $(IMPLEMENTATIONS) 164 165# EXPORT DELETE START 166 167EXPORT_SRC: 168 $(RM) Makefile+ 169 sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ 170 < Makefile > Makefile+ 171 $(MV) Makefile+ Makefile 172 $(CHMOD) 444 Makefile 173 174# EXPORT DELETE END 175 176include ../Makefile.targ 177 178# 179# Cross-reference customization: build a cross-reference over all of the 180# sun4v-related directories. 181# 182XRDIRS = ../sun4v ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common 183XRPRUNE = i86pc 184 185cscope.out tags: FRC 186 $(XREF) -x $@ 187