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