xref: /titanic_51/usr/src/uts/sun4u/Makefile (revision 06e1a7147edd272b7296f208141627a5b1191731)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile drives the production of all implementation architecture
29#	dependent modules for the sun4u architecture.
30#
31
32UTSBASE = ..
33
34include Makefile.sun4u
35
36#
37#	The following are SPARC specific (rather than sun4u) specific modules
38#	which are required for the sun4u 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 sun4u
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 these for OpenSolaris, since they will be replaced by
63# binaries that are signed by Sun RE.
64#
65$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= aes256
66$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= arcfour2048
67# EXPORT DELETE END
68
69
70def		:=	TARGET= def
71all		:=	TARGET= all
72install		:=	TARGET= install
73install_h	:=	TARGET= install_h
74clean		:=	TARGET= clean
75clobber		:=	TARGET= clobber
76lint		:=	TARGET= lint
77lintlib		:=	TARGET= lintlib
78modlintlib	:=	TARGET= modlintlib
79modlist		:=	TARGET= modlist
80modlist	modlist.sparc :=	NO_STATE= -K $$MODSTATE$$$$
81clean.lint	:=	TARGET= clean.lint
82check		:=	TARGET= check
83
84.KEEP_STATE:
85
86.PARALLEL:	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
87		$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) \
88		modlist modlist.sparc
89
90# Override for CPU_KMODS... they cannot be built
91# in parallel
92.NO_PARALLEL:	$(CPU_KMODS)
93
94def all clean clobber clean.lint: genassym unix .WAIT \
95	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
96	$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS)
97
98# list the modules under sun4u.
99modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
100	$(IMPLEMENTATIONS:.WAIT=) $(CLOSED_IMPLEMENTATIONS)
101
102# list the modules for Install -k sun4u.
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) $(CLOSED_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$(CLOSED_IMPLEMENTATIONS):	FRC
122	cd $(CLOSED)/uts/sun4u/$@; pwd; \
123	    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/sun4u/$@/Makefile ]; then \
134		cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
135	else \
136		true; \
137	fi
138
139$(CLOSED_KMODS):	FRC
140	cd $(CLOSED)/uts/sun4u/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
141
142install_h check: install_platforms $(IMPLEMENTATIONS) \
143	$(CLOSED_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#
157# create directories in /usr/platform/ for the implementations that are
158# defined in $(IMPLEMENTED_PLATFORM)
159#       (eg. SUNW,Ultra-1)
160#
161# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
162# that are linked to it.
163#
164$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM):	$(USR_PLAT_DIR)
165	-$(INS.dir.root.sys)
166
167#
168# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
169# to it's corresponding $(IMPLEMENTED_PLATFORM).
170#
171PLATFORMS	= $(LINKED_PLATFORMS)
172
173$(USR_PLAT_DIRS): $(USR_PLAT_DIR)
174	$(INS.slink3)
175
176PLATFORMS	+= $(IMPLEMENTED_PLATFORM)
177
178#
179# Make the /platforms directories.  This is hardwired here because
180# the first stage of the project (KBI) only implements the userland
181# changes, but the only reasonable place to record the aliases is
182# here in kernel land.
183#
184install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
185			$(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
186			$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
187			$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
188
189#
190# rules for making include, sbin, lib dirs/links in
191# /usr/platform/$(PLATFORM)/ for desktop platforms
192#
193$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
194	$(INS.slink4)
195
196$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
197	$(INS.slink5)
198
199$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
200	-$(INS.dir.root.bin)
201
202#
203#	Full kernel lint target.
204#
205LINT_TARGET	= globallint
206
207globallint:
208	@-$(ECHO) "\nSUN4U KERNEL: global crosschecks:"
209	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
210
211lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
212	$(IMPLEMENTATIONS) $(CLOSED_IMPLEMENTATIONS) $(CPU_KMODS)
213
214# EXPORT DELETE START
215
216EXPORT_SRC:
217	$(RM) Makefile+
218	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
219	    < Makefile > Makefile+
220	$(MV) Makefile+ Makefile
221	$(CHMOD) 444 Makefile
222
223# EXPORT DELETE END
224
225include ../Makefile.targ
226
227#
228# Cross-reference customization: build a cross-reference over all of the
229# sun4u-related directories.
230#
231SHARED_XRDIRS	= ../sun4u ../sun4 ../sfmmu ../sparc ../sun ../common
232CLOSED_XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
233XRDIRS		= $(SHARED_XRDIRS)
234$(CLOSED_BUILD)XRDIRS	= $(CLOSED_XRDIRS:../../../closed/uts/sfmmu=)
235
236XRPRUNE = i86pc
237
238cscope.out tags: FRC
239	$(XREF) -x $@
240