286N/A#
286N/A# CDDL HEADER START
286N/A#
286N/A# The contents of this file are subject to the terms of the
286N/A# Common Development and Distribution License (the "License").
286N/A# You may not use this file except in compliance with the License.
286N/A#
286N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
286N/A# or http://www.opensolaris.org/os/licensing.
286N/A# See the License for the specific language governing permissions
286N/A# and limitations under the License.
286N/A#
286N/A# When distributing Covered Code, include this CDDL HEADER in each
286N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
286N/A# If applicable, add the following below this CDDL HEADER, with the
286N/A# fields enclosed by brackets "[]" replaced with your own identifying
286N/A# information: Portions Copyright [yyyy] [name of copyright owner]
286N/A#
286N/A# CDDL HEADER END
286N/A#
286N/A#
286N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
286N/A# Use is subject to license terms.
286N/A# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
286N/A#
286N/A# This makefile drives the production of all implementation architecture
286N/A# dependent modules for the sun4u architecture.
286N/A#
286N/A
286N/AUTSBASE = ..
286N/A
286N/Ainclude Makefile.sun4u
286N/A
286N/A#
286N/A# The following are SPARC specific (rather than sun4u) specific modules
286N/A# which are required for the sun4u kernel to completely lint. They are
286N/A# not involved in the build in any other way. In order to minimize
286N/A# build time, it is assumed that they are up to date. But since sun4u
286N/A# is really a separate architecture we cannot use the v7 sparc modules.
286N/A#
286N/ASPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
286N/A
286N/ASPARC_LINTS =
286N/A
286N/A#
286N/A#
286N/A#
286N/ALINT_LIBS = $(LINT_LIB) \
286N/A $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
286N/A $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln)
286N/A
286N/A
286N/Adef := TARGET= def
286N/Adef.prereq := TARGET= def
286N/Aall := TARGET= all
286N/Aall.prereq := TARGET= all
286N/Ainstall := TARGET= install
286N/Ainstall.prereq := TARGET= install
286N/Ainstall_h := TARGET= install_h
286N/Ainstall_h.prere := TARGET= install_h
286N/Aclean := TARGET= clean
286N/Aclobber := TARGET= clobber
286N/Alint := TARGET= lint
286N/Alint.prereq := TARGET= lint
286N/Alintlib := TARGET= lintlib
286N/Amodlintlib := TARGET= modlintlib
286N/Amodlist := TARGET= modlist
286N/Amodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$
286N/Aclean.lint := TARGET= clean.lint
286N/Acheck := TARGET= check
286N/A
286N/A.KEEP_STATE:
286N/A
286N/A.PARALLEL: $(PARALLEL_KMODS) $(XMODS) \
286N/A $(IMPLEMENTATIONS) \
286N/A modlist modlist.sparc
286N/A
286N/A# Override for CPU_KMODS... they cannot be built
286N/A# in parallel
286N/A.NO_PARALLEL: $(CPU_KMODS)
286N/A
286N/Adef all clean clobber clean.lint: genassym unix .WAIT \
286N/A $(KMODS) $(XMODS) $(IMPLEMENTATIONS)
286N/A
286N/Aclobber: clobber.targ
286N/A
286N/A# list the modules under sun4u.
286N/Amodlist: unix $(KMODS) $(XMODS) $(IMPLEMENTATIONS:.WAIT=)
286N/A
286N/A# list the modules for Install -k sun4u.
286N/Amodlist.karch: modlist modlist.sparc
286N/A
286N/Amodlist.sparc:
286N/A @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
286N/A
286N/Ainstall: install_platforms genassym unix .WAIT $(KMODS) \
286N/A $(XMODS) $(IMPLEMENTATIONS)
286N/A
286N/Alintlib: unix
286N/A
286N/Amodlintlib: $(LINT_KMODS)
286N/A
286N/Agenassym unix $(KMODS): FRC
286N/A @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
286N/A
286N/A#
286N/A# Privilege constants
286N/A#
286N/A# NOTE: The rules for generating priv_const.c file are shared between all
286N/A# processor architectures and should be kept in sync. If they are changed in
286N/A# this file make sure that x86 rules are updated as well.
286N/A#
286N/APRIVS_C = $(UTSBASE)/common/os/priv_const.c
286N/A
286N/A$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
286N/A $(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
286N/A
286N/ACLOBBERFILES += $(PRIVS_C)
286N/A
286N/A#
286N/A# Prerequisites
286N/A#
286N/A# The uts/Makefile defines build parallelism for sun4 platforms such that sparc,
286N/A# sun4u and sun4v are all built in parallel. Also this Makefile specifies that
286N/A# all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires
286N/A# building certain parts before the parallel build can start. The uts/Makefile
286N/A# appends the '.prereq' string to the original target and executes this Makefile
286N/A# to build any prerequisites needed before the full parallel build can start.
286N/A# After that make continues with normal targets.
286N/A#
286N/A# Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be
286N/A# described here.
286N/A#
286N/A# genassym is used to build dtrace and genunix, so it should be built first.
286N/A#
286N/A# priv_const.c is required to build genunix.
286N/A#
286N/A# genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip
286N/A# so as a side effect this dependency builds sparc/ip as part of the
286N/A# prerequisites.
286N/A#
286N/A# unix is not required by itself but several sun4u platforms require
286N/A# sun4u/platmod to be present. The easiest way to achieve this is to build
286N/A# sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly.
286N/A# This causes full sun4u/unix to be built before all sun4u platforms and
286N/A# before uts/sun4v and uts/sparc, but it acceptable since it is not spending
286N/A# too much time building sun4u/unix.
286N/A#
286N/Aall.prereq def.prereq install.prereq: genassym genunix unix
286N/A
286N/A#
286N/A# Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be
286N/A# present. This is handled by running make install_h in sun4u/unix directory
286N/A# first.
286N/A#
286N/Ainstall_h.prereq: FRC
286N/A @cd sys; pwd; $(MAKE) $(TARGET)
286N/A
286N/A#
286N/A# sun4u/unix and sun4u/genunix should be linted first since sparc does global
286N/A# cross-check with these lint libraries. The sun4u/unix and sun4u/genunix can be
286N/A# linted in parallel.
286N/A#
286N/ALINT_PREREQ = unix.lint genunix.lint
286N/Alint.prereq: $(LINT_PREREQ)
286N/A
286N/A.PARALLEL: $(LINT_PREREQ)
286N/A
286N/A$(LINT_PREREQ):
286N/A @cd $(@:%.lint=%); pwd; $(MAKE) $(TARGET)
286N/A
286N/A#
286N/A# Nothing to do with any other prerequisites
#
%.prereq:
#
# Platform inter-dependencies
#
lw8: serengeti
quasar: darwin
#
# The genunix requires priv_const.c file to be generated first.
#
genunix: $(PRIVS_C)
#
# Rules
#
$(IMPLEMENTATIONS): FRC
@cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
$(XMODS): FRC
@if [ -f $@/Makefile ]; then \
cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
else \
true; \
fi
install_h check: install_platforms $(IMPLEMENTATIONS)
@cd sys; pwd; $(MAKE) $(TARGET)
@cd vm; pwd; $(MAKE) $(TARGET)
#
# Rules for the /platforms directories. This is hardwired here because
# the first stage of the project (KBI) only implements the userland
# changes, but the only reasonable place to record the aliases is
# here in kernel land.
#
$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR)
-$(INS.dir)
#
# create directories in /usr/platform/ for the implementations that are
# defined in $(IMPLEMENTED_PLATFORM)
# (eg. SUNW,Ultra-1)
#
# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
# that are linked to it.
#
$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR)
-$(INS.dir)
#
# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
# to it's corresponding $(IMPLEMENTED_PLATFORM).
#
PLATFORMS = $(LINKED_PLATFORMS)
$(USR_PLAT_DIRS): $(USR_PLAT_DIR)
$(INS.slink3)
PLATFORMS += $(IMPLEMENTED_PLATFORM)
#
# Make the /platforms directories. This is hardwired here because
# the first stage of the project (KBI) only implements the userland
# changes, but the only reasonable place to record the aliases is
# here in kernel land.
#
install_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \
$(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
#
# rules for making include, sbin, lib dirs/links in
# /usr/platform/$(PLATFORM)/ for desktop platforms
#
$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR)
$(INS.slink4)
$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR)
$(INS.slink5)
$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR)
-$(INS.dir)
#
# Full kernel lint target.
#
LINT_TARGET = globallint
globallint:
@pwd
@-$(ECHO) "\nSUN4U KERNEL: global crosschecks:"
@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
lint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
$(IMPLEMENTATIONS) $(CPU_KMODS)
include ../Makefile.targ
#
# Cross-reference customization: build a cross-reference over all of the
# sun4u-related directories.
#
XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common
XRPRUNE = i86pc
cscope.out tags: FRC
$(XREF) -x $@