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