xref: /titanic_41/usr/src/uts/sun4v/Makefile (revision fd9cb95cbb2f626355a60efb9d02c5f0a33c10e6)
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 sun4v architecture.
30#
31
32UTSBASE = ..
33
34include Makefile.sun4v
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		   $(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#
61CRYPTO_EK_KMODS	+= arcfour2048
62# EXPORT DELETE END
63
64def		:=	TARGET= def
65all		:=	TARGET= all
66install		:=	TARGET= install
67install_h	:=	TARGET= install_h
68clean		:=	TARGET= clean
69clobber		:=	TARGET= clobber
70lint		:=	TARGET= lint
71lintlib		:=	TARGET= lintlib
72modlintlib	:=	TARGET= modlintlib
73clean.lint	:=	TARGET= clean.lint
74check		:=	TARGET= check
75
76.KEEP_STATE:
77
78.PARALLEL:	$(KMODS) $(XMODS)
79
80# Override for CPU_KMODS... they cannot be built
81# in parallel
82.NO_PARALLEL:	$(CPU_KMODS)
83
84def all clean clobber clean.lint: genassym unix .WAIT $(KMODS) $(XMODS) \
85	$(IMPLEMENTATIONS)
86
87install: install_platforms genassym unix .WAIT $(KMODS) $(XMODS) \
88	$(IMPLEMENTATIONS)
89
90lintlib:	unix
91
92modlintlib:	$(LINT_KMODS)
93
94genassym unix $(KMODS) $(IMPLEMENTATIONS):	FRC
95	@cd $@; pwd; $(MAKE) $(TARGET)
96
97$(XMODS):	FRC
98	@if [ -f $@/Makefile  ]; then \
99		cd $@; pwd; $(MAKE) $(TARGET); \
100	else \
101		true; \
102	fi
103
104install_h check:	install_platforms $(IMPLEMENTATIONS) FRC
105	@cd sys; pwd; $(MAKE) $(TARGET)
106	@cd vm; pwd; $(MAKE) $(TARGET)
107
108#
109# Rules for the /platforms directories.  This is hardwired here because
110# the first stage of the project (KBI) only implements the userland
111# changes, but the only reasonable place to record the aliases is
112# here in kernel land.
113#
114$(ROOT_PLAT_DIRS): $(ROOT_PLAT_DIR)
115	-$(INS.dir.root.sys)
116
117$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%): $(ROOT_PLAT_DIR)
118	$(INS.slink1)
119
120#
121# create directories in /usr/platform/ for the implementations that are
122# defined in $(IMPLEMENTED_PLATFORM)
123#
124
125# Foreach $(IMPLEMENTED_PLATFORM) there can be a list of $(LINKED_PLATFORMS)
126# that are linked to it.
127#
128$(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM):	$(USR_PLAT_DIR)
129	-$(INS.dir.root.sys)
130
131#
132# create the links in /usr/platform/ foreach $(LINKED_PLATFORMS)
133# to it's corresponding $(IMPLEMENTED_PLATFORM).
134#
135PLATFORMS	= $(LINKED_PLATFORMS)
136
137$(USR_PLAT_DIRS): $(USR_PLAT_DIR)
138	$(INS.slink3)
139
140PLATFORMS	+= $(IMPLEMENTED_PLATFORM)
141
142#
143# Make the /platforms directories.  This is hardwired here because
144# the first stage of the project (KBI) only implements the userland
145# changes, but the only reasonable place to record the aliases is
146# here in kernel land.
147#
148install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
149			$(ROOT_PLAT_DIRS) $(USR_PLAT_DIRS) \
150			$(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%) \
151			$(USR_DESKTOP_DIR) $(USR_DESKTOP_INC_DIR) \
152			$(USR_DESKTOP_SBIN_DIR) $(USR_DESKTOP_LIB_DIR)
153
154#
155# rules for making include, sbin, lib dirs/links in
156# /usr/platform/$(PLATFORM)/ for desktop platforms
157#
158$(USR_DESKTOP_INC_DIR):		$(USR_DESKTOP_DIR)
159	$(INS.slink4)
160
161$(USR_DESKTOP_SBIN_DIR):	$(USR_DESKTOP_DIR)
162	$(INS.slink5)
163
164$(USR_DESKTOP_LIB_DIR):		$(USR_DESKTOP_DIR)
165	-$(INS.dir.root.bin)
166
167#
168#	Full kernel lint target.
169#
170LINT_TARGET	= globallint
171
172globallint:
173	@-$(ECHO) "\nSUN4V KERNEL: global crosschecks:"
174	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
175
176lint:	lintlib .WAIT modlintlib .WAIT $(SPARC_LINTS) $(LINT_DEPS) \
177	$(IMPLEMENTATIONS)
178
179# EXPORT DELETE START
180
181EXPORT_SRC:
182	$(RM) Makefile+
183	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
184	    < Makefile > Makefile+
185	$(MV) Makefile+ Makefile
186	$(CHMOD) 444 Makefile
187
188# EXPORT DELETE END
189
190include ../Makefile.targ
191
192#
193# Cross-reference customization: build a cross-reference over all of the
194# sun4v-related directories.
195#
196XRDIRS	= ../sun4v ../sun4 ../sfmmu ../sparc ../sun ../common
197XRPRUNE = i86pc
198
199cscope.out tags: FRC
200	$(XREF) -x $@
201