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