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