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# 22*98157a70Sakolb# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 267c478bd9Sstevel@tonic-gate# 277c478bd9Sstevel@tonic-gate# This makefile drives the production of all implementation architecture 287c478bd9Sstevel@tonic-gate# dependent modules for the sun4u architecture. 297c478bd9Sstevel@tonic-gate# 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gateUTSBASE = .. 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gateinclude Makefile.sun4u 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate# 367c478bd9Sstevel@tonic-gate# The following are SPARC specific (rather than sun4u) specific modules 377c478bd9Sstevel@tonic-gate# which are required for the sun4u kernel to completely lint. They are 387c478bd9Sstevel@tonic-gate# not involved in the build in any other way. In order to minimize 397c478bd9Sstevel@tonic-gate# build time, it is assumed that they are up to date. But since sun4u 407c478bd9Sstevel@tonic-gate# is really a separate architecture we cannot use the v7 sparc modules. 417c478bd9Sstevel@tonic-gate# 427c478bd9Sstevel@tonic-gateSPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gateSPARC_LINTS = 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate# 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gate# 497c478bd9Sstevel@tonic-gateLINT_LIBS = $(LINT_LIB) \ 507c478bd9Sstevel@tonic-gate $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 51fb9f9b97Skupfer $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 527c478bd9Sstevel@tonic-gate $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate# EXPORT DELETE START 557c478bd9Sstevel@tonic-gate# 567c478bd9Sstevel@tonic-gate# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*) 577c478bd9Sstevel@tonic-gate# They need to be listed separately since they duplicate global symbols 587c478bd9Sstevel@tonic-gate# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS 597c478bd9Sstevel@tonic-gate# should not be listed in the lint target. 607c478bd9Sstevel@tonic-gate# 61fb9f9b97Skupfer# Don't build these for OpenSolaris, since they will be replaced by 62fb9f9b97Skupfer# binaries that are signed by Sun RE. 63fb9f9b97Skupfer# 64fb9f9b97Skupfer$(CLOSED_BUILD)CRYPTO_EK_KMODS += aes256 65fb9f9b97Skupfer$(CLOSED_BUILD)CRYPTO_EK_KMODS += arcfour2048 667c478bd9Sstevel@tonic-gate# EXPORT DELETE END 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gatedef := TARGET= def 70*98157a70Sakolbdef.prereq := TARGET= def 717c478bd9Sstevel@tonic-gateall := TARGET= all 72*98157a70Sakolball.prereq := TARGET= all 737c478bd9Sstevel@tonic-gateinstall := TARGET= install 74*98157a70Sakolbinstall.prereq := TARGET= all 757c478bd9Sstevel@tonic-gateinstall_h := TARGET= install_h 76*98157a70Sakolbinstall_h.prere := TARGET= install_h 777c478bd9Sstevel@tonic-gateclean := TARGET= clean 787c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 797c478bd9Sstevel@tonic-gatelint := TARGET= lint 80*98157a70Sakolblint.prereq := TARGET= lint 817c478bd9Sstevel@tonic-gatelintlib := TARGET= lintlib 827c478bd9Sstevel@tonic-gatemodlintlib := TARGET= modlintlib 83fb9f9b97Skupfermodlist := TARGET= modlist 84fb9f9b97Skupfermodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$ 857c478bd9Sstevel@tonic-gateclean.lint := TARGET= clean.lint 867c478bd9Sstevel@tonic-gatecheck := TARGET= check 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate.KEEP_STATE: 897c478bd9Sstevel@tonic-gate 90ae115bc7Smrj.PARALLEL: $(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 91fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \ 92fb9f9b97Skupfer modlist modlist.sparc 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate# Override for CPU_KMODS... they cannot be built 957c478bd9Sstevel@tonic-gate# in parallel 967c478bd9Sstevel@tonic-gate.NO_PARALLEL: $(CPU_KMODS) 977c478bd9Sstevel@tonic-gate 98fb9f9b97Skupferdef all clean clobber clean.lint: genassym unix .WAIT \ 99fb9f9b97Skupfer $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 100fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 1017c478bd9Sstevel@tonic-gate 102fb9f9b97Skupfer# list the modules under sun4u. 103fb9f9b97Skupfermodlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 104fb9f9b97Skupfer $(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS) 105fb9f9b97Skupfer 106fb9f9b97Skupfer# list the modules for Install -k sun4u. 107fb9f9b97Skupfermodlist.karch: modlist modlist.sparc 108fb9f9b97Skupfer 109fb9f9b97Skupfermodlist.sparc: 110fb9f9b97Skupfer @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist 111fb9f9b97Skupfer 112fb9f9b97Skupferinstall: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \ 113fb9f9b97Skupfer $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gatelintlib: unix 1167c478bd9Sstevel@tonic-gate 117fb9f9b97Skupfermodlintlib: $(LINT_KMODS) $(CLOSED_LINT_KMODS) 1187c478bd9Sstevel@tonic-gate 119fb9f9b97Skupfergenassym unix $(KMODS): FRC 120fb9f9b97Skupfer @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 121fb9f9b97Skupfer 122*98157a70Sakolb# 123*98157a70Sakolb# Privilege constants 124*98157a70Sakolb# 125*98157a70Sakolb# NOTE: The rules for generating priv_const.c file are shared between all 126*98157a70Sakolb# processor architectures and should be kept in sync. If they are changed in 127*98157a70Sakolb# this file make sure that x86 rules are updated as well. 128*98157a70Sakolb# 129*98157a70SakolbPRIVS_C = $(UTSBASE)/common/os/priv_const.c 130*98157a70Sakolb 131*98157a70Sakolb$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF) 132*98157a70Sakolb $(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@ 133*98157a70Sakolb 134*98157a70Sakolb 135*98157a70Sakolb# 136*98157a70Sakolb# Prerequisites 137*98157a70Sakolb# 138*98157a70Sakolb# The uts/Makefile defines build parallelism for sun4 platforms such that sparc, 139*98157a70Sakolb# sun4u and sun4v are all built in parallel. Also this Makefile specifies that 140*98157a70Sakolb# all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires 141*98157a70Sakolb# building certain parts before the parallel build can start. The uts/Makefile 142*98157a70Sakolb# appends the '.prereq' string to the original target and executes this Makefile 143*98157a70Sakolb# to build any prerequisites needed before the full parallel build can start. 144*98157a70Sakolb# After that make continues with normal targets. 145*98157a70Sakolb# 146*98157a70Sakolb# Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be 147*98157a70Sakolb# described here. 148*98157a70Sakolb# 149*98157a70Sakolb# genassym is used to build dtrace and genunix, so it should be built first. 150*98157a70Sakolb# 151*98157a70Sakolb# priv_const.c is required to build genunix. 152*98157a70Sakolb# 153*98157a70Sakolb# genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip 154*98157a70Sakolb# so as a side effect this dependency builds sparc/ip as part of the 155*98157a70Sakolb# prerequisites. 156*98157a70Sakolb# 157*98157a70Sakolb# unix is not required by itself but several sun4u platforms require 158*98157a70Sakolb# sun4u/platmod to be present. The easiest way to achieve this is to build 159*98157a70Sakolb# sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly. 160*98157a70Sakolb# This causes full sun4u/unix to be built before all sun4u platforms and 161*98157a70Sakolb# before uts/sun4v and uts/sparc, but it acceptable since it is not spending 162*98157a70Sakolb# too much time building sun4u/unix. 163*98157a70Sakolb# 164*98157a70Sakolball.prereq def.prereq install.prereq: genassym genunix unix 165*98157a70Sakolb 166*98157a70Sakolb# 167*98157a70Sakolb# Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be 168*98157a70Sakolb# present. This is handled by running make install_h in sun4u/unix directory 169*98157a70Sakolb# first. 170*98157a70Sakolb# 171*98157a70Sakolbinstall_h.prereq: FRC 172*98157a70Sakolb @cd sys; pwd; $(MAKE) $(TARGET) 173*98157a70Sakolb 174*98157a70Sakolb# 175*98157a70Sakolb# sun4u/unix and sun4u/genunix should be linted first since sparc does global 176*98157a70Sakolb# cross-check with these lint libraries. The sun4u/unix and sun4u/genunix can be 177*98157a70Sakolb# linted in parallel. 178*98157a70Sakolb# 179*98157a70SakolbLINT_PREREQ = unix.lint genunix.lint 180*98157a70Sakolblint.prereq: $(LINT_PREREQ) 181*98157a70Sakolb 182*98157a70Sakolb.PARALLEL: $(LINT_PREREQ) 183*98157a70Sakolb 184*98157a70Sakolb$(LINT_PREREQ): 185*98157a70Sakolb @cd $(@:%.lint=%); pwd; $(MAKE) $(TARGET) 186*98157a70Sakolb 187*98157a70Sakolb# 188*98157a70Sakolb# Nothing to do with any other prerequisites 189*98157a70Sakolb# 190*98157a70Sakolb%.prereq: 191*98157a70Sakolb 192*98157a70Sakolb# 193*98157a70Sakolb# Platform inter-dependencies 194*98157a70Sakolb# 195*98157a70Sakolblw8: serengeti 196*98157a70Sakolb 197*98157a70Sakolbquasar: darwin 198*98157a70Sakolb 199*98157a70Sakolb# 200*98157a70Sakolb# The genunix requires priv_const.c file to be generated first. 201*98157a70Sakolb# 202*98157a70Sakolbgenunix: $(PRIVS_C) 203*98157a70Sakolb 204*98157a70Sakolb# 205*98157a70Sakolb# Rules 206*98157a70Sakolb# 207*98157a70Sakolb 208fb9f9b97Skupfer$(IMPLEMENTATIONS): FRC 209fb9f9b97Skupfer @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET) 210fb9f9b97Skupfer 211fb9f9b97Skupfer$(CLOSED_IMPLEMENTATIONS): FRC 212fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; \ 213fb9f9b97Skupfer THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET); \ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate$(XMODS): FRC 2167c478bd9Sstevel@tonic-gate @if [ -f $@/Makefile ]; then \ 217fb9f9b97Skupfer cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 2187c478bd9Sstevel@tonic-gate else \ 2197c478bd9Sstevel@tonic-gate true; \ 2207c478bd9Sstevel@tonic-gate fi 2217c478bd9Sstevel@tonic-gate 222fb9f9b97Skupfer$(CLOSED_XMODS): FRC 223fb9f9b97Skupfer @if [ -f $(CLOSED)/uts/sun4u/$@/Makefile ]; then \ 224fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 225fb9f9b97Skupfer else \ 226fb9f9b97Skupfer true; \ 227fb9f9b97Skupfer fi 228fb9f9b97Skupfer 229fb9f9b97Skupfer$(CLOSED_KMODS): FRC 230fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 231fb9f9b97Skupfer 232fb9f9b97Skupferinstall_h check: install_platforms $(IMPLEMENTATIONS) \ 233fb9f9b97Skupfer $(CLOSED_IMPLEMENTATIONS) FRC 2347c478bd9Sstevel@tonic-gate @cd sys; pwd; $(MAKE) $(TARGET) 2357c478bd9Sstevel@tonic-gate @cd vm; pwd; $(MAKE) $(TARGET) 2367c478bd9Sstevel@tonic-gate 2377c478bd9Sstevel@tonic-gate# 2387c478bd9Sstevel@tonic-gate# Rules for the /platforms directories. This is hardwired here because 2397c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 2407c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 2417c478bd9Sstevel@tonic-gate# here in kernel land. 2427c478bd9Sstevel@tonic-gate# 2437c478bd9Sstevel@tonic-gate$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 2447c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 2457c478bd9Sstevel@tonic-gate 2467c478bd9Sstevel@tonic-gate# 2477c478bd9Sstevel@tonic-gate# create directories in /usr/platform/ for the implementations that are 2487c478bd9Sstevel@tonic-gate# defined in $(IMPLEMENTED_PLATFORM) 2497c478bd9Sstevel@tonic-gate# (eg. SUNW,Ultra-1) 2507c478bd9Sstevel@tonic-gate# 2517c478bd9Sstevel@tonic-gate# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 2527c478bd9Sstevel@tonic-gate# that are linked to it. 2537c478bd9Sstevel@tonic-gate# 2547c478bd9Sstevel@tonic-gate$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 2557c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 2567c478bd9Sstevel@tonic-gate 2577c478bd9Sstevel@tonic-gate# 2587c478bd9Sstevel@tonic-gate# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 2597c478bd9Sstevel@tonic-gate# to it's corresponding $(IMPLEMENTED_PLATFORM). 2607c478bd9Sstevel@tonic-gate# 2617c478bd9Sstevel@tonic-gatePLATFORMS = $(LINKED_PLATFORMS) 2627c478bd9Sstevel@tonic-gate 2637c478bd9Sstevel@tonic-gate$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 2647c478bd9Sstevel@tonic-gate $(INS.slink3) 2657c478bd9Sstevel@tonic-gate 2667c478bd9Sstevel@tonic-gatePLATFORMS += $(IMPLEMENTED_PLATFORM) 2677c478bd9Sstevel@tonic-gate 2687c478bd9Sstevel@tonic-gate# 2697c478bd9Sstevel@tonic-gate# Make the /platforms directories. This is hardwired here because 2707c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 2717c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 2727c478bd9Sstevel@tonic-gate# here in kernel land. 2737c478bd9Sstevel@tonic-gate# 2747c478bd9Sstevel@tonic-gateinstall_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 2757c478bd9Sstevel@tonic-gate $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 2767c478bd9Sstevel@tonic-gate $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 2777c478bd9Sstevel@tonic-gate $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate# 2807c478bd9Sstevel@tonic-gate# rules for making include, sbin, lib dirs/links in 2817c478bd9Sstevel@tonic-gate# /usr/platform/$(PLATFORM)/ for desktop platforms 2827c478bd9Sstevel@tonic-gate# 2837c478bd9Sstevel@tonic-gate$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 2847c478bd9Sstevel@tonic-gate $(INS.slink4) 2857c478bd9Sstevel@tonic-gate 2867c478bd9Sstevel@tonic-gate$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 2877c478bd9Sstevel@tonic-gate $(INS.slink5) 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gate$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 2907c478bd9Sstevel@tonic-gate -$(INS.dir.root.bin) 2917c478bd9Sstevel@tonic-gate 2927c478bd9Sstevel@tonic-gate# 2937c478bd9Sstevel@tonic-gate# Full kernel lint target. 2947c478bd9Sstevel@tonic-gate# 2957c478bd9Sstevel@tonic-gateLINT_TARGET = globallint 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gategloballint: 298*98157a70Sakolb @pwd 2997c478bd9Sstevel@tonic-gate @-$(ECHO) "\nSUN4U KERNEL: global crosschecks:" 3007c478bd9Sstevel@tonic-gate @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) 3017c478bd9Sstevel@tonic-gate 3027c478bd9Sstevel@tonic-gatelint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \ 303fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS) 3047c478bd9Sstevel@tonic-gate 3057c478bd9Sstevel@tonic-gate# EXPORT DELETE START 3067c478bd9Sstevel@tonic-gate 3077c478bd9Sstevel@tonic-gateEXPORT_SRC: 3087c478bd9Sstevel@tonic-gate $(RM) Makefile+ 3097c478bd9Sstevel@tonic-gate sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ 3107c478bd9Sstevel@tonic-gate < Makefile > Makefile+ 3117c478bd9Sstevel@tonic-gate $(MV) Makefile+ Makefile 3127c478bd9Sstevel@tonic-gate $(CHMOD) 444 Makefile 3137c478bd9Sstevel@tonic-gate 3147c478bd9Sstevel@tonic-gate# EXPORT DELETE END 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 3177c478bd9Sstevel@tonic-gate 3187c478bd9Sstevel@tonic-gate# 3197c478bd9Sstevel@tonic-gate# Cross-reference customization: build a cross-reference over all of the 3207c478bd9Sstevel@tonic-gate# sun4u-related directories. 3217c478bd9Sstevel@tonic-gate# 322fb9f9b97SkupferSHARED_XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common 323fb9f9b97SkupferCLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%) 324fb9f9b97SkupferXRDIRS = $(SHARED_XRDIRS) 325fb9f9b97Skupfer$(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=) 326fb9f9b97Skupfer 3277c478bd9Sstevel@tonic-gateXRPRUNE = i86pc 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gatecscope.out tags: FRC 3307c478bd9Sstevel@tonic-gate $(XREF) -x $@ 331