xref: /titanic_41/usr/src/uts/sun4v/Makefile (revision 31e37bb439502e3f7c4c0a9a77d655ea5d56887a)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile drives the production of all implementation architecture
29#	dependent modules for the sun4v architecture.
30#
31
32UTSBASE = ..
33
34include Makefile.sun4v
35
36#
37#	The following are SPARC specific (rather than sun4v) specific modules
38#	which are required for the sun4v kernel to completely lint. They are
39#	not involved in the build in any other way. In order to minimize
40#	build time, it is assumed that they are up to date. But since sun4v
41#	is really a separate architecture we cannot use the v7 sparc modules.
42#
43SPARC_LIB_DIR	 = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
44
45SPARC_LINTS	 =
46
47#
48#
49#
50LINT_LIBS	 = $(LINT_LIB) \
51		   $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
52		   $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
53		   $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln)
54
55# EXPORT DELETE START
56#
57# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*)
58# They need to be listed separately since they duplicate global symbols
59# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS
60# should not be listed in the lint target.
61#
62# Don't build this for OpenSolaris, since it will be replaced by
63# a binary that is signed by Sun RE.
64#
65$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= arcfour2048
66# EXPORT DELETE END
67
68def		:=	TARGET= def
69all		:=	TARGET= all
70install		:=	TARGET= install
71install_h	:=	TARGET= install_h
72clean		:=	TARGET= clean
73clobber		:=	TARGET= clobber
74lint		:=	TARGET= lint
75lintlib		:=	TARGET= lintlib
76modlintlib	:=	TARGET= modlintlib
77modlist		:=	TARGET= modlist
78modlist	modlist.sparc :=	NO_STATE= -K $$MODSTATE$$$$
79clean.lint	:=	TARGET= clean.lint
80check		:=	TARGET= check
81
82.KEEP_STATE:
83
84.PARALLEL:	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
85		modlist modlist.sparc
86
87# Override for CPU_KMODS... they cannot be built
88# in parallel
89.NO_PARALLEL:	$(CPU_KMODS)
90
91def all clean clobber clean.lint: genassym unix .WAIT \
92	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS)
93
94# list the modules under sun4v.
95modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
96	$(IMPLEMENTATIONS)
97
98# list the modules for Install -k sun4v.
99modlist.karch: modlist modlist.sparc
100
101modlist.sparc:
102	@cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
103
104install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
105	$(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS)
106
107lintlib:	unix
108
109modlintlib:	$(LINT_KMODS) $(CLOSED_LINT_KMODS)
110
111genassym unix $(KMODS):	FRC
112	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
113
114$(IMPLEMENTATIONS):	FRC
115	@cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
116
117$(XMODS):	FRC
118	@if [ -f $@/Makefile  ]; then \
119		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
120	else \
121		true; \
122	fi
123
124$(CLOSED_XMODS):	FRC
125	@if [ -f $(CLOSED)/uts/sun4v/$@/Makefile  ]; then \
126		cd $(CLOSED)/uts/sun4v/$@; pwd; \
127		    $(MAKE) $(NO_STATE) $(TARGET); \
128	else \
129		true; \
130	fi
131
132$(CLOSED_KMODS):	FRC
133	cd $(CLOSED)/uts/sun4v/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
134
135install_h check:	install_platforms $(IMPLEMENTATIONS) FRC
136	@cd sys; pwd; $(MAKE) $(TARGET)
137	@cd vm; pwd; $(MAKE) $(TARGET)
138
139#
140# Rules for the /platforms directories.  This is hardwired here because
141# the first stage of the project (KBI) only implements the userland
142# changes, but the only reasonable place to record the aliases is
143# here in kernel land.
144#
145$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR)
146	-$(INS.dir.root.sys)
147
148$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%): $(ROOT_PLAT_DIR)
149	$(INS.slink1)
150
151#
152# create directories in /usr/platform/ for the implementations that are
153# defined in $(IMPLEMENTED_PLATFORM)
154#
155
156# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
157# that are linked to it.
158#
159$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM):	$(USR_PLAT_DIR)
160	-$(INS.dir.root.sys)
161
162#
163# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
164# to it's corresponding $(IMPLEMENTED_PLATFORM).
165#
166PLATFORMS	= $(LINKED_PLATFORMS)
167
168$(USR_PLAT_DIRS): $(USR_PLAT_DIR)
169	$(INS.slink3)
170
171PLATFORMS	+= $(IMPLEMENTED_PLATFORM)
172
173#
174# Make the /platforms directories.  This is hardwired here because
175# the first stage of the project (KBI) only implements the userland
176# changes, but the only reasonable place to record the aliases is
177# here in kernel land.
178#
179install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
180			$(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
181			$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%) \
182			$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
183			$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
184
185#
186# rules for making include, sbin, lib dirs/links in
187# /usr/platform/$(PLATFORM)/ for desktop platforms
188#
189$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
190	$(INS.slink4)
191
192$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
193	$(INS.slink5)
194
195$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
196	-$(INS.dir.root.bin)
197
198#
199#	Full kernel lint target.
200#
201LINT_TARGET	= globallint
202
203globallint:
204	@-$(ECHO) "\nSUN4V KERNEL: global crosschecks:"
205	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
206
207lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
208	$(IMPLEMENTATIONS)
209
210# EXPORT DELETE START
211
212EXPORT_SRC:
213	$(RM) Makefile+
214	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
215	    < Makefile > Makefile+
216	$(MV) Makefile+ Makefile
217	$(CHMOD) 444 Makefile
218
219# EXPORT DELETE END
220
221include ../Makefile.targ
222
223#
224# Cross-reference customization: build a cross-reference over all of the
225# sun4v-related directories.
226#
227SHARED_XRDIRS	= ../sun4v ../sun4 ../sfmmu ../sparc ../sun ../common
228CLOSED_XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
229XRDIRS		= $(SHARED_XRDIRS)
230$(CLOSED_BUILD)XRDIRS	= $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=)
231
232XRPRUNE = i86pc
233
234cscope.out tags: FRC
235	$(XREF) -x $@
236