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