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. 247b07063dSIgor Kozhukhov# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com> 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate# This makefile drives the production of all implementation architecture 277c478bd9Sstevel@tonic-gate# dependent modules for the sun4u architecture. 287c478bd9Sstevel@tonic-gate# 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateUTSBASE = .. 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateinclude Makefile.sun4u 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gatedef := TARGET= def 3598157a70Sakolbdef.prereq := TARGET= def 367c478bd9Sstevel@tonic-gateall := TARGET= all 3798157a70Sakolball.prereq := TARGET= all 387c478bd9Sstevel@tonic-gateinstall := TARGET= install 395db531e3SRichard Loweinstall.prereq := TARGET= install 407c478bd9Sstevel@tonic-gateinstall_h := TARGET= install_h 4198157a70Sakolbinstall_h.prere := TARGET= install_h 427c478bd9Sstevel@tonic-gateclean := TARGET= clean 437c478bd9Sstevel@tonic-gateclobber := TARGET= clobber 44fb9f9b97Skupfermodlist := TARGET= modlist 45fb9f9b97Skupfermodlist modlist.sparc := NO_STATE= -K $$MODSTATE$$$$ 467c478bd9Sstevel@tonic-gatecheck := TARGET= check 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate.KEEP_STATE: 497c478bd9Sstevel@tonic-gate 50c0e7977aSJosef 'Jeff' Sipek.PARALLEL: $(PARALLEL_KMODS) $(XMODS) \ 51c0e7977aSJosef 'Jeff' Sipek $(IMPLEMENTATIONS) \ 52fb9f9b97Skupfer modlist modlist.sparc 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate# Override for CPU_KMODS... they cannot be built 557c478bd9Sstevel@tonic-gate# in parallel 567c478bd9Sstevel@tonic-gate.NO_PARALLEL: $(CPU_KMODS) 577c478bd9Sstevel@tonic-gate 580aaef2f5SRichard Lowedef all clean clobber: genassym unix .WAIT \ 59c0e7977aSJosef 'Jeff' Sipek $(KMODS) $(XMODS) $(IMPLEMENTATIONS) 60fb9f9b97Skupfer 61b6805bf7SGordon Rossclobber: clobber.targ 62b6805bf7SGordon Ross 63fb9f9b97Skupfer# list the modules under sun4u. 64c0e7977aSJosef 'Jeff' Sipekmodlist: unix $(KMODS) $(XMODS) $(IMPLEMENTATIONS:.WAIT=) 65fb9f9b97Skupfer 66fb9f9b97Skupfer# list the modules for Install -k sun4u. 67fb9f9b97Skupfermodlist.karch: modlist modlist.sparc 687c478bd9Sstevel@tonic-gate 69fb9f9b97Skupfermodlist.sparc: 70fb9f9b97Skupfer @cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist 71fb9f9b97Skupfer 72c0e7977aSJosef 'Jeff' Sipekinstall: install_platforms genassym unix .WAIT $(KMODS) \ 73c0e7977aSJosef 'Jeff' Sipek $(XMODS) $(IMPLEMENTATIONS) 747c478bd9Sstevel@tonic-gate 75fb9f9b97Skupfergenassym unix $(KMODS): FRC 76fb9f9b97Skupfer @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 77fb9f9b97Skupfer 7898157a70Sakolb# 7998157a70Sakolb# Privilege constants 8098157a70Sakolb# 8198157a70Sakolb# NOTE: The rules for generating priv_const.c file are shared between all 8298157a70Sakolb# processor architectures and should be kept in sync. If they are changed in 8398157a70Sakolb# this file make sure that x86 rules are updated as well. 8498157a70Sakolb# 8598157a70SakolbPRIVS_C = $(UTSBASE)/common/os/priv_const.c 8698157a70Sakolb 8798157a70Sakolb$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF) 887b07063dSIgor Kozhukhov $(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@ 8998157a70Sakolb 90b6805bf7SGordon RossCLOBBERFILES += $(PRIVS_C) 9198157a70Sakolb 9298157a70Sakolb# 9398157a70Sakolb# Prerequisites 9498157a70Sakolb# 9598157a70Sakolb# The uts/Makefile defines build parallelism for sun4 platforms such that sparc, 9698157a70Sakolb# sun4u and sun4v are all built in parallel. Also this Makefile specifies that 9798157a70Sakolb# all IMPLEMENTATIONS sun4u sub-platforms are built in parallel. This requires 9898157a70Sakolb# building certain parts before the parallel build can start. The uts/Makefile 9998157a70Sakolb# appends the '.prereq' string to the original target and executes this Makefile 10098157a70Sakolb# to build any prerequisites needed before the full parallel build can start. 10198157a70Sakolb# After that make continues with normal targets. 10298157a70Sakolb# 10398157a70Sakolb# Any build prerequisites for sun4 and IMPLEMENTATIONS builds should be 10498157a70Sakolb# described here. 10598157a70Sakolb# 10698157a70Sakolb# genassym is used to build dtrace and genunix, so it should be built first. 10798157a70Sakolb# 10898157a70Sakolb# priv_const.c is required to build genunix. 10998157a70Sakolb# 11098157a70Sakolb# genunix is used by everyone to ctfmerge with. Genunix is merged with sparc/ip 11198157a70Sakolb# so as a side effect this dependency builds sparc/ip as part of the 11298157a70Sakolb# prerequisites. 11398157a70Sakolb# 11498157a70Sakolb# unix is not required by itself but several sun4u platforms require 11598157a70Sakolb# sun4u/platmod to be present. The easiest way to achieve this is to build 11698157a70Sakolb# sun4u/unix first since sun4u/unix Makefile builds sun4u/platform correctly. 11798157a70Sakolb# This causes full sun4u/unix to be built before all sun4u platforms and 11898157a70Sakolb# before uts/sun4v and uts/sparc, but it acceptable since it is not spending 11998157a70Sakolb# too much time building sun4u/unix. 12098157a70Sakolb# 12198157a70Sakolball.prereq def.prereq install.prereq: genassym genunix unix 12298157a70Sakolb 12398157a70Sakolb# 12498157a70Sakolb# Various sun4u platforms expect proto/root_sparc/platform/sun4u/include to be 12598157a70Sakolb# present. This is handled by running make install_h in sun4u/unix directory 12698157a70Sakolb# first. 12798157a70Sakolb# 12898157a70Sakolbinstall_h.prereq: FRC 12998157a70Sakolb @cd sys; pwd; $(MAKE) $(TARGET) 13098157a70Sakolb 13198157a70Sakolb# 13298157a70Sakolb# Nothing to do with any other prerequisites 13398157a70Sakolb# 13498157a70Sakolb%.prereq: 13598157a70Sakolb 13698157a70Sakolb# 13798157a70Sakolb# Platform inter-dependencies 13898157a70Sakolb# 13998157a70Sakolblw8: serengeti 14098157a70Sakolb 14198157a70Sakolbquasar: darwin 14298157a70Sakolb 14398157a70Sakolb# 14498157a70Sakolb# The genunix requires priv_const.c file to be generated first. 14598157a70Sakolb# 14698157a70Sakolbgenunix: $(PRIVS_C) 14798157a70Sakolb 14898157a70Sakolb# 14998157a70Sakolb# Rules 15098157a70Sakolb# 15198157a70Sakolb 152fb9f9b97Skupfer$(IMPLEMENTATIONS): FRC 153fb9f9b97Skupfer @cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET) 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate$(XMODS): FRC 156*3aa6c130SRichard Lowe cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) 1577c478bd9Sstevel@tonic-gate 158c0e7977aSJosef 'Jeff' Sipekinstall_h check: install_platforms $(IMPLEMENTATIONS) 1597c478bd9Sstevel@tonic-gate @cd sys; pwd; $(MAKE) $(TARGET) 1607c478bd9Sstevel@tonic-gate @cd vm; pwd; $(MAKE) $(TARGET) 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gate# 1637c478bd9Sstevel@tonic-gate# Rules for the /platforms directories. This is hardwired here because 1647c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 1657c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 1667c478bd9Sstevel@tonic-gate# here in kernel land. 1677c478bd9Sstevel@tonic-gate# 1687c478bd9Sstevel@tonic-gate$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR) 16948bc00d6Sjmcp -$(INS.dir) 1707c478bd9Sstevel@tonic-gate 1717c478bd9Sstevel@tonic-gate# 1727c478bd9Sstevel@tonic-gate# create directories in /usr/platform/ for the implementations that are 1737c478bd9Sstevel@tonic-gate# defined in $(IMPLEMENTED_PLATFORM) 1747c478bd9Sstevel@tonic-gate# (eg. SUNW,Ultra-1) 1757c478bd9Sstevel@tonic-gate# 1767c478bd9Sstevel@tonic-gate# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS) 1777c478bd9Sstevel@tonic-gate# that are linked to it. 1787c478bd9Sstevel@tonic-gate# 1797c478bd9Sstevel@tonic-gate$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM): $(USR_PLAT_DIR) 18048bc00d6Sjmcp -$(INS.dir) 1817c478bd9Sstevel@tonic-gate 1827c478bd9Sstevel@tonic-gate# 1837c478bd9Sstevel@tonic-gate# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS) 1847c478bd9Sstevel@tonic-gate# to it's corresponding $(IMPLEMENTED_PLATFORM). 1857c478bd9Sstevel@tonic-gate# 1867c478bd9Sstevel@tonic-gatePLATFORMS = $(LINKED_PLATFORMS) 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gate$(USR_PLAT_DIRS): $(USR_PLAT_DIR) 1897c478bd9Sstevel@tonic-gate $(INS.slink3) 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gatePLATFORMS += $(IMPLEMENTED_PLATFORM) 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate# 1947c478bd9Sstevel@tonic-gate# Make the /platforms directories. This is hardwired here because 1957c478bd9Sstevel@tonic-gate# the first stage of the project (KBI) only implements the userland 1967c478bd9Sstevel@tonic-gate# changes, but the only reasonable place to record the aliases is 1977c478bd9Sstevel@tonic-gate# here in kernel land. 1987c478bd9Sstevel@tonic-gate# 1997c478bd9Sstevel@tonic-gateinstall_platforms: $(ROOT_PSM_DIR) $(USR_PSM_DIR) \ 2007c478bd9Sstevel@tonic-gate $(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \ 2017c478bd9Sstevel@tonic-gate $(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \ 2027c478bd9Sstevel@tonic-gate $(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate# 2057c478bd9Sstevel@tonic-gate# rules for making include, sbin, lib dirs/links in 2067c478bd9Sstevel@tonic-gate# /usr/platform/$(PLATFORM)/ for desktop platforms 2077c478bd9Sstevel@tonic-gate# 2087c478bd9Sstevel@tonic-gate$(USR_DESKTOP_INC_DIR): $(USR_DESKTOP_DIR) 2097c478bd9Sstevel@tonic-gate $(INS.slink4) 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gate$(USR_DESKTOP_SBIN_DIR): $(USR_DESKTOP_DIR) 2127c478bd9Sstevel@tonic-gate $(INS.slink5) 2137c478bd9Sstevel@tonic-gate 2147c478bd9Sstevel@tonic-gate$(USR_DESKTOP_LIB_DIR): $(USR_DESKTOP_DIR) 21548bc00d6Sjmcp -$(INS.dir) 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate# 2207c478bd9Sstevel@tonic-gate# Cross-reference customization: build a cross-reference over all of the 2217c478bd9Sstevel@tonic-gate# sun4u-related directories. 2227c478bd9Sstevel@tonic-gate# 223c0e7977aSJosef 'Jeff' SipekXRDIRS = ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common 2247c478bd9Sstevel@tonic-gateXRPRUNE = i86pc 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gatecscope.out tags: FRC 2277c478bd9Sstevel@tonic-gate $(XREF) -x $@ 228