xref: /titanic_44/usr/src/uts/i86pc/Makefile (revision 28cdc3d776761766afeb198769d1b70ed7e0f2e1)
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 2006 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 i86pc architecture.
30#
31
32UTSBASE = ..
33
34include Makefile.i86pc
35
36#
37#	The following are x86 specific (rather than i86pc) specific modules
38#	which are required for the i86pc 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.
41#
42INTEL_LIB_DIR	 = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
43
44INTEL_LINTS	 = genunix
45
46LINT_LIBS	 = $(LINT_LIB) \
47		   $(KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
48		   $(CLOSED_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
49		   $(INTEL_LINTS:%=$(INTEL_LIB_DIR)/llib-l%.ln)
50
51#
52#
53#
54def		:=	TARGET= def
55all		:=	TARGET= all
56install		:=	TARGET= install
57clean		:=	TARGET= clean
58clobber		:=	TARGET= clobber
59lint		:=	TARGET= lint
60lintlib		:=	TARGET= lintlib
61machmodlintlib	:=	TARGET= modlintlib
62modlist		:=	TARGET= modlist
63modlist	modlist.intel :=	NO_STATE= -K $$MODSTATE$$$$
64clean.lint	:=	TARGET= clean.lint
65check		:=	TARGET= check
66
67.KEEP_STATE:
68
69.PARALLEL:	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
70		modlist modlist.intel
71
72INITIAL_TARGETS = \
73	genassym \
74	unix \
75	cpu/scripts
76
77def all clean clobber clean.lint: setup genassym unix .WAIT \
78	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
79
80install: install_platforms setup genassym unix .WAIT \
81	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
82
83# list the modules under i86pc.
84modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
85
86# list the modules for Install -k i86pc.
87modlist.karch: modlist modlist.intel
88
89modlist.intel:
90	@cd $(SRC)/uts/intel; pwd; $(MAKE) $(NO_STATE) modlist
91
92lintlib:	unix
93
94modlintlib:	$(KMODS) $(CLOSED_KMODS)
95
96genassym unix $(KMODS):	FRC
97	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
98
99setup: FRC
100	@cd cpu/scripts; pwd; $(MAKE) setup
101
102$(XMODS):	FRC
103	@if [ -f $@/Makefile  ]; then \
104		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
105	else \
106		true; \
107	fi
108
109$(CLOSED_KMODS):	FRC
110	cd $(CLOSED)/uts/i86pc/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
111
112$(CLOSED_XMODS):	FRC
113	@if [ -f $(CLOSED)/uts/i86pc/$@/Makefile  ]; then \
114		cd $(CLOSED)/uts/i86pc/$@; pwd; \
115		    $(MAKE) $(NO_STATE) $(TARGET); \
116	else \
117		true; \
118	fi
119
120install_h check:	FRC
121	@cd sys; pwd; $(MAKE) $(TARGET)
122
123#
124# For some x86 OEMs that deliver their own platform kernel modules but
125# will not deliver anything in usr/platform, they should add their platforms
126# here so a symlink will be created to the standard usr/platform/i86pc.
127#
128OEM_LINKS	= ncri86pc
129
130OEM_USR_PLAT_LINKS	= $(OEM_LINKS:%=$(USR_PLAT_DIR)/%)
131
132$(OEM_USR_PLAT_LINKS):
133	$(INS.slink1)
134
135#
136# Definitions for the /platform directory aliases.
137# Currently none for i86pc.
138#
139PLAT_LINKS	=
140
141#
142# Make the /platform directories.  This is hardwired here because
143# the first stage of the project (KBI) only implements the userland
144# changes, but the only reasonable place to record the aliases is
145# here in kernel land.
146#
147install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
148			$(ROOT_PLAT_LINKS) $(USR_PLAT_LINKS) \
149			$(OEM_USR_PLAT_LINKS)
150
151#
152# Work-around to disable acpica global crosscheck lint warnings
153#
154LGREP.i86pc =	grep -v 'i86pc/io/acpica'
155
156#
157#	Full kernel lint target.
158#
159LINT_TARGET	= globallint
160
161# workaround for multiply defined errors
162globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
163
164globallint:
165	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
166	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) | $(LGREP.i86pc)
167
168lint:	lintlib .WAIT modlintlib .WAIT $(INTEL_LINTS) $(LINT_DEPS)
169
170$(INTEL_LINTS):	FRC
171	@cd $(UTSBASE)/intel/$@; pwd; $(MAKE) modlintlib
172
173FRC:
174
175include ../Makefile.targ
176
177#
178# Cross-reference customization: build a cross-reference over all of the
179# i86pc-related directories.
180#
181SHARED_XRDIRS	= ../i86pc ../intel ../common
182XRDIRS		= $(SHARED_XRDIRS)
183$(CLOSED_BUILD)XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
184XRPRUNE	= sun4u sun4
185
186cscope.out tags: FRC
187	$(XREF) -x $@
188