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