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