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