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