xref: /titanic_52/usr/src/uts/sun4v/Makefile (revision b0f673c4626e4cb1db7785287eaeed2731dfefe8)
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 2009 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
64def		:=	TARGET= def
65all		:=	TARGET= all
66install		:=	TARGET= install
67install_h	:=	TARGET= install_h
68clean		:=	TARGET= clean
69clobber		:=	TARGET= clobber
70lint		:=	TARGET= lint
71lintlib		:=	TARGET= lintlib
72modlintlib	:=	TARGET= modlintlib
73modlist		:=	TARGET= modlist
74modlist	modlist.sparc :=	NO_STATE= -K $$MODSTATE$$$$
75clean.lint	:=	TARGET= clean.lint
76check		:=	TARGET= check
77
78.KEEP_STATE:
79
80.PARALLEL:	$(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
81		modlist modlist.sparc
82
83# Override for CPU_KMODS... they cannot be built
84# in parallel
85.NO_PARALLEL:	$(CPU_KMODS)
86
87def all clean clobber clean.lint: genassym unix .WAIT \
88	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS)
89
90# list the modules under sun4v.
91modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
92	$(IMPLEMENTATIONS)
93
94# list the modules for Install -k sun4v.
95modlist.karch: modlist modlist.sparc
96
97modlist.sparc:
98	@cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
99
100install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
101	$(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS)
102
103lintlib:	unix
104
105modlintlib:	$(LINT_KMODS) $(CLOSED_LINT_KMODS)
106
107genassym unix $(KMODS):	FRC
108	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
109
110$(IMPLEMENTATIONS):	FRC
111	@cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
112
113$(XMODS):	FRC
114	@if [ -f $@/Makefile  ]; then \
115		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
116	else \
117		true; \
118	fi
119
120$(CLOSED_XMODS):	FRC
121	@if [ -f $(CLOSED)/uts/sun4v/$@/Makefile  ]; then \
122		cd $(CLOSED)/uts/sun4v/$@; pwd; \
123		    $(MAKE) $(NO_STATE) $(TARGET); \
124	else \
125		true; \
126	fi
127
128$(CLOSED_KMODS):	FRC
129	cd $(CLOSED)/uts/sun4v/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
130
131install_h check:	install_platforms $(IMPLEMENTATIONS) FRC
132	@cd sys; pwd; $(MAKE) $(TARGET)
133	@cd vm; pwd; $(MAKE) $(TARGET)
134
135#
136# Rules for the /platforms directories.  This is hardwired here because
137# the first stage of the project (KBI) only implements the userland
138# changes, but the only reasonable place to record the aliases is
139# here in kernel land.
140#
141$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR)
142	-$(INS.dir)
143
144$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%): $(ROOT_PLAT_DIR)
145	$(INS.slink1)
146
147#
148# create directories in /usr/platform/ for the implementations that are
149# defined in $(IMPLEMENTED_PLATFORM)
150#
151
152# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
153# that are linked to it.
154#
155$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM):	$(USR_PLAT_DIR)
156	-$(INS.dir)
157
158#
159# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
160# to it's corresponding $(IMPLEMENTED_PLATFORM).
161#
162PLATFORMS	= $(LINKED_PLATFORMS)
163
164$(USR_PLAT_DIRS): $(USR_PLAT_DIR)
165	$(INS.slink3)
166
167PLATFORMS	+= $(IMPLEMENTED_PLATFORM)
168
169
170#
171# Make the /platforms directories.  This is hardwired here because
172# the first stage of the project (KBI) only implements the userland
173# changes, but the only reasonable place to record the aliases is
174# here in kernel land.
175#
176
177install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
178			$(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
179			$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%) \
180			$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
181			$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR) \
182			$(USR_STPAUL_DIR) $(USR_STPAUL_SBIN_DIR) \
183			$(USR_STPAUL_LIB_DIR) \
184			$(USR_GLENDALE_DIR) $(USR_GLENDALE_SBIN_DIR) \
185			$(USR_GLENDALE_LIB_DIR) \
186			$(USR_HURON_DIR) \
187			$(USR_HURON_SBIN_DIR) $(USR_HURON_LIB_DIR) \
188			$(USR_MARAMBA_DIR) $(USR_MARAMBA_SBIN_DIR) \
189			$(USR_MARAMBA_LIB_DIR) \
190			$(USR_THUNDER_DIR) $(USR_THUNDER_SBIN_DIR) \
191			$(USR_THUNDER_LIB_DIR) \
192			$(USR_TURGO_DIR) $(USR_TURGO_SBIN_DIR) \
193			$(USR_TURGO_LIB_DIR) \
194			$(USR_CONGO_DIR) $(USR_CONGO_SBIN_DIR) \
195			$(USR_CONGO_LIB_DIR) \
196			$(USR_MONZA_DIR) \
197			$(USR_MONZA_SBIN_DIR) $(USR_MONZA_SBIN_LINKS)
198
199
200#
201# rules for making include, sbin, lib dirs/links in
202# /usr/platform/$(PLATFORM)/ for desktop platforms
203#
204$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
205	$(INS.slink4)
206
207$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
208	$(INS.slink5)
209
210$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
211	-$(INS.dir)
212
213$(USR_STPAUL_DIR):		$(USR_SUN4V_PLAT_DIR)
214	-$(INS.dir)
215
216$(USR_STPAUL_SBIN_DIR):		$(USR_STPAUL_DIR)
217	$(INS.slink5)
218
219$(USR_STPAUL_LIB_DIR):		$(USR_STPAUL_DIR)
220	-$(INS.dir)
221
222$(USR_HURON_DIR):		$(USR_SUN4V_PLAT_DIR)
223	-$(INS.dir)
224
225$(USR_HURON_SBIN_DIR):		$(USR_HURON_DIR)
226	$(INS.slink5)
227
228$(USR_HURON_LIB_DIR):		$(USR_HURON_DIR)
229	-$(INS.dir)
230
231$(USR_GLENDALE_DIR):		$(USR_SUN4V_PLAT_DIR)
232	-$(INS.dir)
233
234$(USR_GLENDALE_SBIN_DIR):		$(USR_GLENDALE_DIR)
235	$(INS.slink5)
236
237$(USR_GLENDALE_LIB_DIR):		$(USR_GLENDALE_DIR)
238	-$(INS.dir)
239
240$(USR_MARAMBA_DIR):		$(USR_SUN4V_PLAT_DIR)
241	-$(INS.dir)
242
243$(USR_MARAMBA_SBIN_DIR):	$(USR_MARAMBA_DIR)
244	$(INS.slink5)
245
246$(USR_MARAMBA_LIB_DIR):		$(USR_MARAMBA_DIR)
247	-$(INS.dir)
248
249$(USR_THUNDER_DIR):		$(USR_SUN4V_PLAT_DIR)
250	-$(INS.dir)
251
252$(USR_THUNDER_SBIN_DIR):	$(USR_THUNDER_DIR)
253	$(INS.slink5)
254
255$(USR_THUNDER_LIB_DIR):		$(USR_THUNDER_DIR)
256	-$(INS.dir)
257
258$(USR_TURGO_DIR):		$(USR_SUN4V_PLAT_DIR)
259	-$(INS.dir)
260
261$(USR_TURGO_SBIN_DIR):		$(USR_TURGO_DIR)
262	$(INS.slink5)
263
264$(USR_TURGO_LIB_DIR):		$(USR_TURGO_DIR)
265	-$(INS.dir)
266
267$(USR_CONGO_DIR):		$(USR_SUN4V_PLAT_DIR)
268	-$(INS.dir)
269
270$(USR_CONGO_SBIN_DIR):		$(USR_CONGO_DIR)
271	$(INS.slink5)
272
273$(USR_CONGO_LIB_DIR):		$(USR_CONGO_DIR)
274	-$(INS.dir)
275
276$(USR_MONZA_DIR):		$(USR_SUN4V_PLAT_DIR)
277	-$(INS.dir)
278
279$(USR_MONZA_SBIN_DIR):		$(USR_MONZA_DIR)
280	-$(INS.dir)
281
282$(USR_MONZA_SBIN_LINKS):	$(USR_MONZA_SBIN_DIR)
283	$(INS.slink7)
284
285#
286#	Full kernel lint target.
287#
288LINT_TARGET	= globallint
289
290globallint:
291	@-$(ECHO) "\nSUN4V KERNEL: global crosschecks:"
292	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
293
294lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
295	$(IMPLEMENTATIONS) $(LINT_CPU_KMODS)
296
297include ../Makefile.targ
298
299#
300# Cross-reference customization: build a cross-reference over all of the
301# sun4v-related directories.
302#
303XRDIRS	= ../sun4v ../sun4 ../sfmmu ../sparc ../sun ../common
304XRPRUNE = i86pc sun4u intel
305
306cscope.out tags: FRC
307	$(XREF) -x $@
308