xref: /titanic_52/usr/src/uts/sun4v/Makefile (revision b9e93c10c0a2a4bb069d38bb311021a9478c4711)
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#	This makefile drives the production of all implementation architecture
26#	dependent modules for the sun4v architecture.
27#
28
29UTSBASE = ..
30
31include Makefile.sun4v
32include Makefile.stpaul
33include Makefile.huron
34include Makefile.maramba
35include Makefile.thunder
36include Makefile.turgo
37include Makefile.congo
38include Makefile.monza
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			$(USR_CONGO_DIR) $(USR_CONGO_SBIN_DIR) \
208			$(USR_CONGO_LIB_DIR) \
209			$(USR_MONZA_DIR) \
210			$(USR_MONZA_SBIN_DIR) $(USR_MONZA_SBIN_LINKS)
211
212
213#
214# rules for making include, sbin, lib dirs/links in
215# /usr/platform/$(PLATFORM)/ for desktop platforms
216#
217$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
218	$(INS.slink4)
219
220$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
221	$(INS.slink5)
222
223$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
224	-$(INS.dir.root.bin)
225
226$(USR_STPAUL_DIR):		$(USR_SUN4V_PLAT_DIR)
227	-$(INS.dir.root.sys)
228
229$(USR_STPAUL_SBIN_DIR):		$(USR_STPAUL_DIR)
230	$(INS.slink5)
231
232$(USR_STPAUL_LIB_DIR):		$(USR_STPAUL_DIR)
233	-$(INS.dir.root.bin)
234
235$(USR_HURON_DIR):		$(USR_SUN4V_PLAT_DIR)
236	-$(INS.dir.root.sys)
237
238$(USR_HURON_SBIN_DIR):		$(USR_HURON_DIR)
239	$(INS.slink5)
240
241$(USR_HURON_LIB_DIR):		$(USR_HURON_DIR)
242	-$(INS.dir.root.bin)
243
244$(USR_GLENDALE_DIR):		$(USR_SUN4V_PLAT_DIR)
245	-$(INS.dir.root.sys)
246
247$(USR_GLENDALE_SBIN_DIR):		$(USR_GLENDALE_DIR)
248	$(INS.slink5)
249
250$(USR_GLENDALE_LIB_DIR):		$(USR_GLENDALE_DIR)
251	-$(INS.dir.root.bin)
252
253$(USR_MARAMBA_DIR):		$(USR_SUN4V_PLAT_DIR)
254	-$(INS.dir.root.sys)
255
256$(USR_MARAMBA_SBIN_DIR):	$(USR_MARAMBA_DIR)
257	$(INS.slink5)
258
259$(USR_MARAMBA_LIB_DIR):		$(USR_MARAMBA_DIR)
260	-$(INS.dir.root.bin)
261
262$(USR_THUNDER_DIR):		$(USR_SUN4V_PLAT_DIR)
263	-$(INS.dir.root.sys)
264
265$(USR_THUNDER_SBIN_DIR):	$(USR_THUNDER_DIR)
266	$(INS.slink5)
267
268$(USR_THUNDER_LIB_DIR):		$(USR_THUNDER_DIR)
269	-$(INS.dir.root.bin)
270
271$(USR_TURGO_DIR):		$(USR_SUN4V_PLAT_DIR)
272	-$(INS.dir.root.sys)
273
274$(USR_TURGO_SBIN_DIR):		$(USR_TURGO_DIR)
275	$(INS.slink5)
276
277$(USR_TURGO_LIB_DIR):		$(USR_TURGO_DIR)
278	-$(INS.dir.root.bin)
279
280$(USR_CONGO_DIR):		$(USR_SUN4V_PLAT_DIR)
281	-$(INS.dir.root.sys)
282
283$(USR_CONGO_SBIN_DIR):		$(USR_CONGO_DIR)
284	$(INS.slink5)
285
286$(USR_CONGO_LIB_DIR):		$(USR_CONGO_DIR)
287	-$(INS.dir.root.bin)
288
289$(USR_MONZA_DIR):		$(USR_SUN4V_PLAT_DIR)
290	-$(INS.dir.root.sys)
291
292$(USR_MONZA_SBIN_DIR):		$(USR_MONZA_DIR)
293	-$(INS.dir.root.sys)
294
295$(USR_MONZA_SBIN_LINKS):	$(USR_MONZA_SBIN_DIR)
296	$(INS.slink7)
297
298#
299#	Full kernel lint target.
300#
301LINT_TARGET	= globallint
302
303globallint:
304	@-$(ECHO) "\nSUN4V KERNEL: global crosschecks:"
305	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
306
307lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
308	$(IMPLEMENTATIONS) $(LINT_CPU_KMODS)
309
310# EXPORT DELETE START
311
312EXPORT_SRC:
313	$(RM) Makefile+
314	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
315	    < Makefile > Makefile+
316	$(MV) Makefile+ Makefile
317	$(CHMOD) 444 Makefile
318
319# EXPORT DELETE END
320
321include ../Makefile.targ
322
323#
324# Cross-reference customization: build a cross-reference over all of the
325# sun4v-related directories.
326#
327SHARED_XRDIRS	= ../sun4v ../sun4 ../sfmmu ../sparc ../sun ../common
328CLOSED_XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
329XRDIRS		= $(SHARED_XRDIRS)
330$(CLOSED_BUILD)XRDIRS	= $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=)
331
332XRPRUNE = i86pc sun4u intel
333
334cscope.out tags: FRC
335	$(XREF) -x $@
336