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