17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5ae115bc7Smrj# Common Development and Distribution License (the "License"). 6ae115bc7Smrj# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# 2267b33ca4SValerie Bubb Fenwick# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# This makefile drives the production of all implementation architecture 267c478bd9Sstevel@tonic-gate# dependent modules for the sun4u architecture. 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gateUTSBASE = .. 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gateinclude Makefile.sun4u 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate# 347c478bd9Sstevel@tonic-gate# The following are SPARC specific (rather than sun4u) specific modules 357c478bd9Sstevel@tonic-gate# which are required for the sun4u kernel to completely lint. They are 367c478bd9Sstevel@tonic-gate# not involved in the build in any other way. In order to minimize 377c478bd9Sstevel@tonic-gate# build time, it is assumed that they are up to date. But since sun4u 387c478bd9Sstevel@tonic-gate# is really a separate architecture we cannot use the v7 sparc modules. 397c478bd9Sstevel@tonic-gate# 407c478bd9Sstevel@tonic-gateSPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gateSPARC_LINTS = 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate# 457c478bd9Sstevel@tonic-gate# 467c478bd9Sstevel@tonic-gate# 477c478bd9Sstevel@tonic-gateLINT_LIBS = $(LINT_LIB) \ 487c478bd9Sstevel@tonic-gate $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 49fb9f9b97Skupfer $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 507c478bd9Sstevel@tonic-gate $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln) 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gatedef := TARGET= def 5498157a70Sakolbdef.prereq := TARGET= def 557c478bd9Sstevel@tonic-gateall := TARGET= all 5698157a70Sakolball.prereq := TARGET= all 577c478bd9Sstevel@tonic-gateinstall := TARGET= install 5898157a70Sakolbinstall.prereq := TARGET= all 597c478bd9Sstevel@tonic-gateinstall_h := TARGET= install_h 6098157a70Sakolbinstall_h.prere := TARGET= install_h 617c478bd9Sstevel@tonic-gateclean := TARGET= clean 627c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 637c478bd9Sstevel@tonic-gatelint := TARGET= lint 6498157a70Sakolblint.prereq := TARGET= lint 657c478bd9Sstevel@tonic-gatelintlib := TARGET= lintlib 667c478bd9Sstevel@tonic-gatemodlintlib := TARGET= modlintlib 67fb9f9b97Skupfermodlist := TARGET= modlist 68fb9f9b97Skupfermodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$ 697c478bd9Sstevel@tonic-gateclean.lint := TARGET= clean.lint 707c478bd9Sstevel@tonic-gatecheck := TARGET= check 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate.KEEP_STATE: 737c478bd9Sstevel@tonic-gate 74ae115bc7Smrj.PARALLEL: $(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 75fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \ 76fb9f9b97Skupfer modlist modlist.sparc 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate# Override for CPU_KMODS... they cannot be built 797c478bd9Sstevel@tonic-gate# in parallel 807c478bd9Sstevel@tonic-gate.NO_PARALLEL: $(CPU_KMODS) 817c478bd9Sstevel@tonic-gate 82fb9f9b97Skupferdef all clean clobber clean.lint: genassym unix .WAIT \ 83fb9f9b97Skupfer $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 84fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 857c478bd9Sstevel@tonic-gate 86*b6805bf7SGordon Rossclobber: clobber.targ 87*b6805bf7SGordon Ross 88fb9f9b97Skupfer# list the modules under sun4u. 89fb9f9b97Skupfermodlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 90fb9f9b97Skupfer $(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS) 91fb9f9b97Skupfer 92fb9f9b97Skupfer# list the modules for Install -k sun4u. 93fb9f9b97Skupfermodlist.karch: modlist modlist.sparc 94fb9f9b97Skupfer 95fb9f9b97Skupfermodlist.sparc: 96fb9f9b97Skupfer @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist 97fb9f9b97Skupfer 98fb9f9b97Skupferinstall: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \ 99fb9f9b97Skupfer $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gatelintlib: unix 1027c478bd9Sstevel@tonic-gate 103fb9f9b97Skupfermodlintlib: $(LINT_KMODS) $(CLOSED_LINT_KMODS) 1047c478bd9Sstevel@tonic-gate 105fb9f9b97Skupfergenassym unix $(KMODS): FRC 106fb9f9b97Skupfer @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 107fb9f9b97Skupfer 10898157a70Sakolb# 10998157a70Sakolb# Privilege constants 11098157a70Sakolb# 11198157a70Sakolb# NOTE: The rules for generating priv_const.c file are shared between all 11298157a70Sakolb# processor architectures and should be kept in sync. If they are changed in 11398157a70Sakolb# this file make sure that x86 rules are updated as well. 11498157a70Sakolb# 11598157a70SakolbPRIVS_C = $(UTSBASE)/common/os/priv_const.c 11698157a70Sakolb 11798157a70Sakolb$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF) 11898157a70Sakolb $(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@ 11998157a70Sakolb 120*b6805bf7SGordon RossCLOBBERFILES += $(PRIVS_C) 12198157a70Sakolb 12298157a70Sakolb# 12398157a70Sakolb# Prerequisites 12498157a70Sakolb# 12598157a70Sakolb# The uts/Makefile defines build parallelism for sun4 platforms such that sparc, 12698157a70Sakolb# sun4u and sun4v are all built in parallel. Also this Makefile specifies that 12798157a70Sakolb# all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires 12898157a70Sakolb# building certain parts before the parallel build can start. The uts/Makefile 12998157a70Sakolb# appends the '.prereq' string to the original target and executes this Makefile 13098157a70Sakolb# to build any prerequisites needed before the full parallel build can start. 13198157a70Sakolb# After that make continues with normal targets. 13298157a70Sakolb# 13398157a70Sakolb# Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be 13498157a70Sakolb# described here. 13598157a70Sakolb# 13698157a70Sakolb# genassym is used to build dtrace and genunix, so it should be built first. 13798157a70Sakolb# 13898157a70Sakolb# priv_const.c is required to build genunix. 13998157a70Sakolb# 14098157a70Sakolb# genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip 14198157a70Sakolb# so as a side effect this dependency builds sparc/ip as part of the 14298157a70Sakolb# prerequisites. 14398157a70Sakolb# 14498157a70Sakolb# unix is not required by itself but several sun4u platforms require 14598157a70Sakolb# sun4u/platmod to be present. The easiest way to achieve this is to build 14698157a70Sakolb# sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly. 14798157a70Sakolb# This causes full sun4u/unix to be built before all sun4u platforms and 14898157a70Sakolb# before uts/sun4v and uts/sparc, but it acceptable since it is not spending 14998157a70Sakolb# too much time building sun4u/unix. 15098157a70Sakolb# 15198157a70Sakolball.prereq def.prereq install.prereq: genassym genunix unix 15298157a70Sakolb 15398157a70Sakolb# 15498157a70Sakolb# Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be 15598157a70Sakolb# present. This is handled by running make install_h in sun4u/unix directory 15698157a70Sakolb# first. 15798157a70Sakolb# 15898157a70Sakolbinstall_h.prereq: FRC 15998157a70Sakolb @cd sys; pwd; $(MAKE) $(TARGET) 16098157a70Sakolb 16198157a70Sakolb# 16298157a70Sakolb# sun4u/unix and sun4u/genunix should be linted first since sparc does global 16398157a70Sakolb# cross-check with these lint libraries. The sun4u/unix and sun4u/genunix can be 16498157a70Sakolb# linted in parallel. 16598157a70Sakolb# 16698157a70SakolbLINT_PREREQ = unix.lint genunix.lint 16798157a70Sakolblint.prereq: $(LINT_PREREQ) 16898157a70Sakolb 16998157a70Sakolb.PARALLEL: $(LINT_PREREQ) 17098157a70Sakolb 17198157a70Sakolb$(LINT_PREREQ): 17298157a70Sakolb @cd $(@:%.lint=%); pwd; $(MAKE) $(TARGET) 17398157a70Sakolb 17498157a70Sakolb# 17598157a70Sakolb# Nothing to do with any other prerequisites 17698157a70Sakolb# 17798157a70Sakolb%.prereq: 17898157a70Sakolb 17998157a70Sakolb# 18098157a70Sakolb# Platform inter-dependencies 18198157a70Sakolb# 18298157a70Sakolblw8: serengeti 18398157a70Sakolb 18498157a70Sakolbquasar: darwin 18598157a70Sakolb 18698157a70Sakolb# 18798157a70Sakolb# The genunix requires priv_const.c file to be generated first. 18898157a70Sakolb# 18998157a70Sakolbgenunix: $(PRIVS_C) 19098157a70Sakolb 19198157a70Sakolb# 19298157a70Sakolb# Rules 19398157a70Sakolb# 19498157a70Sakolb 195fb9f9b97Skupfer$(IMPLEMENTATIONS): FRC 196fb9f9b97Skupfer @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET) 197fb9f9b97Skupfer 198fb9f9b97Skupfer$(CLOSED_IMPLEMENTATIONS): FRC 199fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; \ 200fb9f9b97Skupfer THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET); \ 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate$(XMODS): FRC 2037c478bd9Sstevel@tonic-gate @if [ -f $@/Makefile ]; then \ 204fb9f9b97Skupfer cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 2057c478bd9Sstevel@tonic-gate else \ 2067c478bd9Sstevel@tonic-gate true; \ 2077c478bd9Sstevel@tonic-gate fi 2087c478bd9Sstevel@tonic-gate 209fb9f9b97Skupfer$(CLOSED_XMODS): FRC 210fb9f9b97Skupfer @if [ -f $(CLOSED)/uts/sun4u/$@/Makefile ]; then \ 211fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 212fb9f9b97Skupfer else \ 213fb9f9b97Skupfer true; \ 214fb9f9b97Skupfer fi 215fb9f9b97Skupfer 216fb9f9b97Skupfer$(CLOSED_KMODS): FRC 217fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 218fb9f9b97Skupfer 219fb9f9b97Skupferinstall_h check: install_platforms $(IMPLEMENTATIONS) \ 220fb9f9b97Skupfer $(CLOSED_IMPLEMENTATIONS) FRC 2217c478bd9Sstevel@tonic-gate @cd sys; pwd; $(MAKE) $(TARGET) 2227c478bd9Sstevel@tonic-gate @cd vm; pwd; $(MAKE) $(TARGET) 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate# 2257c478bd9Sstevel@tonic-gate# Rules for the /platforms directories. This is hardwired here because 2267c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 2277c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 2287c478bd9Sstevel@tonic-gate# here in kernel land. 2297c478bd9Sstevel@tonic-gate# 2307c478bd9Sstevel@tonic-gate$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 23148bc00d6Sjmcp -$(INS.dir) 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate# 2347c478bd9Sstevel@tonic-gate# create directories in /usr/platform/ for the implementations that are 2357c478bd9Sstevel@tonic-gate# defined in $(IMPLEMENTED_PLATFORM) 2367c478bd9Sstevel@tonic-gate# (eg. SUNW,Ultra-1) 2377c478bd9Sstevel@tonic-gate# 2387c478bd9Sstevel@tonic-gate# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 2397c478bd9Sstevel@tonic-gate# that are linked to it. 2407c478bd9Sstevel@tonic-gate# 2417c478bd9Sstevel@tonic-gate$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 24248bc00d6Sjmcp -$(INS.dir) 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate# 2457c478bd9Sstevel@tonic-gate# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 2467c478bd9Sstevel@tonic-gate# to it's corresponding $(IMPLEMENTED_PLATFORM). 2477c478bd9Sstevel@tonic-gate# 2487c478bd9Sstevel@tonic-gatePLATFORMS = $(LINKED_PLATFORMS) 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 2517c478bd9Sstevel@tonic-gate $(INS.slink3) 2527c478bd9Sstevel@tonic-gate 2537c478bd9Sstevel@tonic-gatePLATFORMS += $(IMPLEMENTED_PLATFORM) 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate# 2567c478bd9Sstevel@tonic-gate# Make the /platforms directories. This is hardwired here because 2577c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 2587c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 2597c478bd9Sstevel@tonic-gate# here in kernel land. 2607c478bd9Sstevel@tonic-gate# 2617c478bd9Sstevel@tonic-gateinstall_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 2627c478bd9Sstevel@tonic-gate $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 2637c478bd9Sstevel@tonic-gate $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 2647c478bd9Sstevel@tonic-gate $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) 2657c478bd9Sstevel@tonic-gate 2667c478bd9Sstevel@tonic-gate# 2677c478bd9Sstevel@tonic-gate# rules for making include, sbin, lib dirs/links in 2687c478bd9Sstevel@tonic-gate# /usr/platform/$(PLATFORM)/ for desktop platforms 2697c478bd9Sstevel@tonic-gate# 2707c478bd9Sstevel@tonic-gate$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 2717c478bd9Sstevel@tonic-gate $(INS.slink4) 2727c478bd9Sstevel@tonic-gate 2737c478bd9Sstevel@tonic-gate$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 2747c478bd9Sstevel@tonic-gate $(INS.slink5) 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 27748bc00d6Sjmcp -$(INS.dir) 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate# 2807c478bd9Sstevel@tonic-gate# Full kernel lint target. 2817c478bd9Sstevel@tonic-gate# 2827c478bd9Sstevel@tonic-gateLINT_TARGET = globallint 2837c478bd9Sstevel@tonic-gate 2847c478bd9Sstevel@tonic-gategloballint: 28598157a70Sakolb @pwd 2867c478bd9Sstevel@tonic-gate @-$(ECHO) "\nSUN4U KERNEL: global crosschecks:" 2877c478bd9Sstevel@tonic-gate @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gatelint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \ 290fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS) 2917c478bd9Sstevel@tonic-gate 2927c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 2937c478bd9Sstevel@tonic-gate 2947c478bd9Sstevel@tonic-gate# 2957c478bd9Sstevel@tonic-gate# Cross-reference customization: build a cross-reference over all of the 2967c478bd9Sstevel@tonic-gate# sun4u-related directories. 2977c478bd9Sstevel@tonic-gate# 298fb9f9b97SkupferSHARED_XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common 299fb9f9b97SkupferCLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%) 300fb9f9b97SkupferXRDIRS = $(SHARED_XRDIRS) 301fb9f9b97Skupfer$(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=) 302fb9f9b97Skupfer 3037c478bd9Sstevel@tonic-gateXRPRUNE = i86pc 3047c478bd9Sstevel@tonic-gate 3057c478bd9Sstevel@tonic-gatecscope.out tags: FRC 3067c478bd9Sstevel@tonic-gate $(XREF) -x $@ 307