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 57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate# with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 227c478bd9Sstevel@tonic-gate# 23*fb9f9b97Skupfer# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate# This makefile drives the production of all implementation architecture 297c478bd9Sstevel@tonic-gate# dependent modules for the sun4u architecture. 307c478bd9Sstevel@tonic-gate# 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateUTSBASE = .. 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gateinclude Makefile.sun4u 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate# 377c478bd9Sstevel@tonic-gate# The following are SPARC specific (rather than sun4u) specific modules 387c478bd9Sstevel@tonic-gate# which are required for the sun4u kernel to completely lint. They are 397c478bd9Sstevel@tonic-gate# not involved in the build in any other way. In order to minimize 407c478bd9Sstevel@tonic-gate# build time, it is assumed that they are up to date. But since sun4u 417c478bd9Sstevel@tonic-gate# is really a separate architecture we cannot use the v7 sparc modules. 427c478bd9Sstevel@tonic-gate# 437c478bd9Sstevel@tonic-gateSPARC_LIB_DIR = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR) 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gateSPARC_LINTS = 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gate# 497c478bd9Sstevel@tonic-gate# 507c478bd9Sstevel@tonic-gateLINT_LIBS = $(LINT_LIB) \ 517c478bd9Sstevel@tonic-gate $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 52*fb9f9b97Skupfer $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \ 537c478bd9Sstevel@tonic-gate $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln) 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate# EXPORT DELETE START 567c478bd9Sstevel@tonic-gate# 577c478bd9Sstevel@tonic-gate# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*) 587c478bd9Sstevel@tonic-gate# They need to be listed separately since they duplicate global symbols 597c478bd9Sstevel@tonic-gate# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS 607c478bd9Sstevel@tonic-gate# should not be listed in the lint target. 617c478bd9Sstevel@tonic-gate# 62*fb9f9b97Skupfer# Don't build these for OpenSolaris, since they will be replaced by 63*fb9f9b97Skupfer# binaries that are signed by Sun RE. 64*fb9f9b97Skupfer# 65*fb9f9b97Skupfer$(CLOSED_BUILD)CRYPTO_EK_KMODS += aes256 66*fb9f9b97Skupfer$(CLOSED_BUILD)CRYPTO_EK_KMODS += arcfour2048 677c478bd9Sstevel@tonic-gate# EXPORT DELETE END 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gatedef := TARGET= def 717c478bd9Sstevel@tonic-gateall := TARGET= all 727c478bd9Sstevel@tonic-gateinstall := TARGET= install 737c478bd9Sstevel@tonic-gateinstall_h := TARGET= install_h 747c478bd9Sstevel@tonic-gateclean := TARGET= clean 757c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 767c478bd9Sstevel@tonic-gatelint := TARGET= lint 777c478bd9Sstevel@tonic-gatelintlib := TARGET= lintlib 787c478bd9Sstevel@tonic-gatemodlintlib := TARGET= modlintlib 79*fb9f9b97Skupfermodlist := TARGET= modlist 80*fb9f9b97Skupfermodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$ 817c478bd9Sstevel@tonic-gateclean.lint := TARGET= clean.lint 827c478bd9Sstevel@tonic-gatecheck := TARGET= check 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate.KEEP_STATE: 857c478bd9Sstevel@tonic-gate 86*fb9f9b97Skupfer.PARALLEL: $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 87*fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \ 88*fb9f9b97Skupfer modlist modlist.sparc 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate# Override for CPU_KMODS... they cannot be built 917c478bd9Sstevel@tonic-gate# in parallel 927c478bd9Sstevel@tonic-gate.NO_PARALLEL: $(CPU_KMODS) 937c478bd9Sstevel@tonic-gate 94*fb9f9b97Skupferdef all clean clobber clean.lint: genassym unix .WAIT \ 95*fb9f9b97Skupfer $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 96*fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 977c478bd9Sstevel@tonic-gate 98*fb9f9b97Skupfer# list the modules under sun4u. 99*fb9f9b97Skupfermodlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \ 100*fb9f9b97Skupfer $(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS) 101*fb9f9b97Skupfer 102*fb9f9b97Skupfer# list the modules for Install -k sun4u. 103*fb9f9b97Skupfermodlist.karch: modlist modlist.sparc 104*fb9f9b97Skupfer 105*fb9f9b97Skupfermodlist.sparc: 106*fb9f9b97Skupfer @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist 107*fb9f9b97Skupfer 108*fb9f9b97Skupferinstall: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \ 109*fb9f9b97Skupfer $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gatelintlib: unix 1127c478bd9Sstevel@tonic-gate 113*fb9f9b97Skupfermodlintlib: $(LINT_KMODS) $(CLOSED_LINT_KMODS) 1147c478bd9Sstevel@tonic-gate 115*fb9f9b97Skupfergenassym unix $(KMODS): FRC 116*fb9f9b97Skupfer @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 117*fb9f9b97Skupfer 118*fb9f9b97Skupfer$(IMPLEMENTATIONS): FRC 119*fb9f9b97Skupfer @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET) 120*fb9f9b97Skupfer 121*fb9f9b97Skupfer$(CLOSED_IMPLEMENTATIONS): FRC 122*fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; \ 123*fb9f9b97Skupfer THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET); \ 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate$(XMODS): FRC 1267c478bd9Sstevel@tonic-gate @if [ -f $@/Makefile ]; then \ 127*fb9f9b97Skupfer cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 1287c478bd9Sstevel@tonic-gate else \ 1297c478bd9Sstevel@tonic-gate true; \ 1307c478bd9Sstevel@tonic-gate fi 1317c478bd9Sstevel@tonic-gate 132*fb9f9b97Skupfer$(CLOSED_XMODS): FRC 133*fb9f9b97Skupfer @if [ -f $(CLOSED)/uts/sun4u/$@/Makefile ]; then \ 134*fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \ 135*fb9f9b97Skupfer else \ 136*fb9f9b97Skupfer true; \ 137*fb9f9b97Skupfer fi 138*fb9f9b97Skupfer 139*fb9f9b97Skupfer$(CLOSED_KMODS): FRC 140*fb9f9b97Skupfer cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 141*fb9f9b97Skupfer 142*fb9f9b97Skupferinstall_h check: install_platforms $(IMPLEMENTATIONS) \ 143*fb9f9b97Skupfer $(CLOSED_IMPLEMENTATIONS) FRC 1447c478bd9Sstevel@tonic-gate @cd sys; pwd; $(MAKE) $(TARGET) 1457c478bd9Sstevel@tonic-gate @cd vm; pwd; $(MAKE) $(TARGET) 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate# 1487c478bd9Sstevel@tonic-gate# Rules for the /platforms directories. This is hardwired here because 1497c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 1507c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 1517c478bd9Sstevel@tonic-gate# here in kernel land. 1527c478bd9Sstevel@tonic-gate# 1537c478bd9Sstevel@tonic-gate$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 1547c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 1557c478bd9Sstevel@tonic-gate 1567c478bd9Sstevel@tonic-gate# 1577c478bd9Sstevel@tonic-gate# create directories in /usr/platform/ for the implementations that are 1587c478bd9Sstevel@tonic-gate# defined in $(IMPLEMENTED_PLATFORM) 1597c478bd9Sstevel@tonic-gate# (eg. SUNW,Ultra-1) 1607c478bd9Sstevel@tonic-gate# 1617c478bd9Sstevel@tonic-gate# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 1627c478bd9Sstevel@tonic-gate# that are linked to it. 1637c478bd9Sstevel@tonic-gate# 1647c478bd9Sstevel@tonic-gate$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 1657c478bd9Sstevel@tonic-gate -$(INS.dir.root.sys) 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate# 1687c478bd9Sstevel@tonic-gate# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 1697c478bd9Sstevel@tonic-gate# to it's corresponding $(IMPLEMENTED_PLATFORM). 1707c478bd9Sstevel@tonic-gate# 1717c478bd9Sstevel@tonic-gatePLATFORMS = $(LINKED_PLATFORMS) 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 1747c478bd9Sstevel@tonic-gate $(INS.slink3) 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gatePLATFORMS += $(IMPLEMENTED_PLATFORM) 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate# 1797c478bd9Sstevel@tonic-gate# Make the /platforms directories. This is hardwired here because 1807c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 1817c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 1827c478bd9Sstevel@tonic-gate# here in kernel land. 1837c478bd9Sstevel@tonic-gate# 1847c478bd9Sstevel@tonic-gateinstall_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 1857c478bd9Sstevel@tonic-gate $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 1867c478bd9Sstevel@tonic-gate $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 1877c478bd9Sstevel@tonic-gate $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate# 1907c478bd9Sstevel@tonic-gate# rules for making include, sbin, lib dirs/links in 1917c478bd9Sstevel@tonic-gate# /usr/platform/$(PLATFORM)/ for desktop platforms 1927c478bd9Sstevel@tonic-gate# 1937c478bd9Sstevel@tonic-gate$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 1947c478bd9Sstevel@tonic-gate $(INS.slink4) 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 1977c478bd9Sstevel@tonic-gate $(INS.slink5) 1987c478bd9Sstevel@tonic-gate 1997c478bd9Sstevel@tonic-gate$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 2007c478bd9Sstevel@tonic-gate -$(INS.dir.root.bin) 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate# 2037c478bd9Sstevel@tonic-gate# Full kernel lint target. 2047c478bd9Sstevel@tonic-gate# 2057c478bd9Sstevel@tonic-gateLINT_TARGET = globallint 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gategloballint: 2087c478bd9Sstevel@tonic-gate @-$(ECHO) "\nSUN4U KERNEL: global crosschecks:" 2097c478bd9Sstevel@tonic-gate @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gatelint: lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \ 212*fb9f9b97Skupfer $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS) 2137c478bd9Sstevel@tonic-gate 2147c478bd9Sstevel@tonic-gate# EXPORT DELETE START 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gateEXPORT_SRC: 2177c478bd9Sstevel@tonic-gate $(RM) Makefile+ 2187c478bd9Sstevel@tonic-gate sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ 2197c478bd9Sstevel@tonic-gate < Makefile > Makefile+ 2207c478bd9Sstevel@tonic-gate $(MV) Makefile+ Makefile 2217c478bd9Sstevel@tonic-gate $(CHMOD) 444 Makefile 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate# EXPORT DELETE END 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 2267c478bd9Sstevel@tonic-gate 2277c478bd9Sstevel@tonic-gate# 2287c478bd9Sstevel@tonic-gate# Cross-reference customization: build a cross-reference over all of the 2297c478bd9Sstevel@tonic-gate# sun4u-related directories. 2307c478bd9Sstevel@tonic-gate# 231*fb9f9b97SkupferSHARED_XRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common 232*fb9f9b97SkupferCLOSED_XRDIRS = $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%) 233*fb9f9b97SkupferXRDIRS = $(SHARED_XRDIRS) 234*fb9f9b97Skupfer$(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=) 235*fb9f9b97Skupfer 2367c478bd9Sstevel@tonic-gateXRPRUNE = i86pc 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gatecscope.out tags: FRC 2397c478bd9Sstevel@tonic-gate $(XREF) -x $@ 240