Makefile revision b6805bf78d2bbbeeaea8909a05623587b42d58b3
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0519188c8e1ae76978fc4e0f799620cd36eba07aAutomatic Updater# or http://www.opensolaris.org/os/licensing.
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews# See the License for the specific language governing permissions
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# and limitations under the License.
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Use is subject to license terms.
831f79c4310a7d38fc3475ccfff531b2b2535641Automatic Updater# This makefile drives the production of all implementation architecture
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# dependent modules for the sun4u architecture.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# The following are SPARC specific (rather than sun4u) specific modules
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# which are required for the sun4u kernel to completely lint. They are
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# not involved in the build in any other way. In order to minimize
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# build time, it is assumed that they are up to date. But since sun4u
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# is really a separate architecture we cannot use the v7 sparc modules.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntSPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln)
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updatermodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews.PARALLEL: $(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Override for CPU_KMODS... they cannot be built
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewsdef all clean clobber clean.lint: genassym unix .WAIT \
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# list the modules under sun4u.
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updatermodlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater $(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS)
11af78f7dc35741bdab68dbab11b03daab005b28Automatic Updater# list the modules for Install -k sun4u.
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
2a31bd531072824ef252c18303859d6af7451b00Francis Dupontinstall: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater# Privilege constants
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# NOTE: The rules for generating priv_const.c file are shared between all
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# processor architectures and should be kept in sync. If they are changed in
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater# this file make sure that x86 rules are updated as well.
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic UpdaterPRIVS_C = $(UTSBASE)/common/os/priv_const.c
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater $(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater# Prerequisites
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# The uts/Makefile defines build parallelism for sun4 platforms such that sparc,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# sun4u and sun4v are all built in parallel. Also this Makefile specifies that
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# building certain parts before the parallel build can start. The uts/Makefile
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# appends the '.prereq' string to the original target and executes this Makefile
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater# to build any prerequisites needed before the full parallel build can start.
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater# After that make continues with normal targets.
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater# Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater# described here.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# genassym is used to build dtrace and genunix, so it should be built first.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# priv_const.c is required to build genunix.
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater# genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# so as a side effect this dependency builds sparc/ip as part of the
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater# prerequisites.
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# unix is not required by itself but several sun4u platforms require
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater# sun4u/platmod to be present. The easiest way to achieve this is to build
3e5340279d8875d136a4dd815cccad0044aa2644Automatic Updater# sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly.
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater# This causes full sun4u/unix to be built before all sun4u platforms and
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater# before uts/sun4v and uts/sparc, but it acceptable since it is not spending
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# too much time building sun4u/unix.
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updaterall.prereq def.prereq install.prereq: genassym genunix unix
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater# present. This is handled by running make install_h in sun4u/unix directory
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# sun4u/unix and sun4u/genunix should be linted first since sparc does global
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# cross-check with these lint libraries. The sun4u/unix and sun4u/genunix can be
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# linted in parallel.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Nothing to do with any other prerequisites
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater# Platform inter-dependencies
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# The genunix requires priv_const.c file to be generated first.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater @if [ -f $@/Makefile ]; then \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater @if [ -f $(CLOSED)/uts/sun4u/$@/Makefile ]; then \
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updaterinstall_h check: install_platforms $(IMPLEMENTATIONS) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Rules for the /platforms directories. This is hardwired here because
3857cb6fcabeb79d85de4b3e3e4ab99912b701f8Mark Andrews# the first stage of the project (KBI) only implements the userland
572cb2c1c931f6bc6a4a019c103ae88239b0eb96Automatic Updater# changes, but the only reasonable place to record the aliases is
7858b0168b866c0c2878fc4ea31fb5e581c1a6a9Automatic Updater# here in kernel land.
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater# create directories in /usr/platform/ for the implementations that are
8292deab031e7599cd7622aa7675fbe139ca6095Mark Andrews# defined in $(IMPLEMENTED_PLATFORM)
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews# (eg. SUNW,Ultra-1)
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
ca35524ce2b57e6f1b261d23565d1288a355d12fAutomatic Updater# that are linked to it.
b109432c3a939bff66a463be86c371bd88efe3aaAutomatic Updater$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR)
3351ccbd5c1961404044f8273d54dad405f53960Mark Andrews# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater# to it's corresponding $(IMPLEMENTED_PLATFORM).
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater# Make the /platforms directories. This is hardwired here because
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater# the first stage of the project (KBI) only implements the userland
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater# changes, but the only reasonable place to record the aliases is
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater# here in kernel land.
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updaterinstall_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updater $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# rules for making include, sbin, lib dirs/links in
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# /usr/platform/$(PLATFORM)/ for desktop platforms
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# Full kernel lint target.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @-$(ECHO) "\nSUN4U KERNEL: global crosschecks:"
b13d89bd89878137c81b36a36596cca3920f27a4Automatic Updater @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
b13d89bd89878137c81b36a36596cca3920f27a4Automatic Updaterlint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
b13d89bd89878137c81b36a36596cca3920f27a4Automatic Updater $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Cross-reference customization: build a cross-reference over all of the
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# sun4u-related directories.
bc0a4c01beede169df81a3ee5b614ed9e82339dbAutomatic UpdaterSHARED_XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)