xref: /titanic_44/usr/src/uts/sun4u/Makefile (revision dd4eeefdb8e4583c47e28a7f315db6087931ef06)
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 sun4u architecture.
29#
30
31UTSBASE = ..
32
33include Makefile.sun4u
34
35#
36#	The following are SPARC specific (rather than sun4u) specific modules
37#	which are required for the sun4u kernel to completely lint. They are
38#	not involved in the build in any other way. In order to minimize
39#	build time, it is assumed that they are up to date. But since sun4u
40#	is really a separate architecture we cannot use the v7 sparc modules.
41#
42SPARC_LIB_DIR	 = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
43
44SPARC_LINTS	 =
45
46#
47#
48#
49LINT_LIBS	 = $(LINT_LIB) \
50		   $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
51		   $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
52		   $(SPARC_LINTS:%=$(SPARC_LIB_DIR)/llib-l%.ln)
53
54# EXPORT DELETE START
55#
56# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*)
57# They need to be listed separately since they duplicate global symbols
58# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS
59# should not be listed in the lint target.
60#
61# Don't build these for OpenSolaris, since they will be replaced by
62# binaries that are signed by Sun RE.
63#
64$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= aes256
65$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= arcfour2048
66# EXPORT DELETE END
67
68
69def		:=	TARGET= def
70all		:=	TARGET= all
71install		:=	TARGET= install
72install_h	:=	TARGET= install_h
73clean		:=	TARGET= clean
74clobber		:=	TARGET= clobber
75lint		:=	TARGET= lint
76lintlib		:=	TARGET= lintlib
77modlintlib	:=	TARGET= modlintlib
78modlist		:=	TARGET= modlist
79modlist	modlist.sparc :=	NO_STATE= -K $$MODSTATE$$$$
80clean.lint	:=	TARGET= clean.lint
81check		:=	TARGET= check
82
83.KEEP_STATE:
84
85.PARALLEL:	$(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
86		$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \
87		modlist modlist.sparc
88
89# Override for CPU_KMODS... they cannot be built
90# in parallel
91.NO_PARALLEL:	$(CPU_KMODS)
92
93def all clean clobber clean.lint: genassym unix .WAIT \
94	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
95	$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
96
97# list the modules under sun4u.
98modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
99	$(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS)
100
101# list the modules for Install -k sun4u.
102modlist.karch: modlist modlist.sparc
103
104modlist.sparc:
105	@cd $(SRC)/uts/sparc; pwd; $(MAKE) $(NO_STATE) modlist
106
107install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
108	$(XMODS) $(CLOSED_XMODS) $(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
109
110lintlib:	unix
111
112modlintlib:	$(LINT_KMODS) $(CLOSED_LINT_KMODS)
113
114genassym unix $(KMODS):	FRC
115	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
116
117$(IMPLEMENTATIONS):	FRC
118	@cd $@; pwd; THISIMPL=$@ $(MAKE) $(NO_STATE) $(TARGET)
119
120$(CLOSED_IMPLEMENTATIONS):	FRC
121	cd $(CLOSED)/uts/sun4u/$@; pwd; \
122	    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/sun4u/$@/Makefile ]; then \
133		cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
134	else \
135		true; \
136	fi
137
138$(CLOSED_KMODS):	FRC
139	cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
140
141install_h check: install_platforms $(IMPLEMENTATIONS) \
142	$(CLOSED_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#
156# create directories in /usr/platform/ for the implementations that are
157# defined in $(IMPLEMENTED_PLATFORM)
158#       (eg. SUNW,Ultra-1)
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			$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
186			$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
187
188#
189# rules for making include, sbin, lib dirs/links in
190# /usr/platform/$(PLATFORM)/ for desktop platforms
191#
192$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
193	$(INS.slink4)
194
195$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
196	$(INS.slink5)
197
198$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
199	-$(INS.dir.root.bin)
200
201#
202#	Full kernel lint target.
203#
204LINT_TARGET	= globallint
205
206globallint:
207	@-$(ECHO) "\nSUN4U KERNEL: global crosschecks:"
208	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
209
210lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
211	$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS)
212
213# EXPORT DELETE START
214
215EXPORT_SRC:
216	$(RM) Makefile+
217	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
218	    < Makefile > Makefile+
219	$(MV) Makefile+ Makefile
220	$(CHMOD) 444 Makefile
221
222# EXPORT DELETE END
223
224include ../Makefile.targ
225
226#
227# Cross-reference customization: build a cross-reference over all of the
228# sun4u-related directories.
229#
230SHARED_XRDIRS	= ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common
231CLOSED_XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
232XRDIRS		= $(SHARED_XRDIRS)
233$(CLOSED_BUILD)XRDIRS	= $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=)
234
235XRPRUNE = i86pc
236
237cscope.out tags: FRC
238	$(XREF) -x $@
239