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