xref: /illumos-gate/usr/src/uts/i86pc/Makefile (revision fb9f9b97)
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 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
72def all clean clobber clean.lint: genassym unix .WAIT \
73	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
74
75install: install_platforms genassym unix .WAIT $(KMODS) $(CLOSED_KMODS) \
76	$(XMODS) $(CLOSED_XMODS)
77
78# list the modules under i86pc.
79modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
80
81# list the modules for Install -k i86pc.
82modlist.karch: modlist modlist.intel
83
84modlist.intel:
85	@cd $(SRC)/uts/intel; pwd; $(MAKE) $(NO_STATE) modlist
86
87lintlib:	unix
88
89modlintlib:	$(KMODS) $(CLOSED_KMODS)
90
91genassym unix $(KMODS):	FRC
92	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
93
94$(XMODS):	FRC
95	@if [ -f $@/Makefile  ]; then \
96		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
97	else \
98		true; \
99	fi
100
101$(CLOSED_KMODS):	FRC
102	cd $(CLOSED)/uts/i86pc/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
103
104$(CLOSED_XMODS):	FRC
105	@if [ -f $(CLOSED)/uts/i86pc/$@/Makefile  ]; then \
106		cd $(CLOSED)/uts/i86pc/$@; pwd; \
107		    $(MAKE) $(NO_STATE) $(TARGET); \
108	else \
109		true; \
110	fi
111
112install_h check:	FRC
113	@cd sys; pwd; $(MAKE) $(TARGET)
114
115#
116# For some x86 OEMs that deliver their own platform kernel modules but
117# will not deliver anything in usr/platform, they should add their platforms
118# here so a symlink will be created to the standard usr/platform/i86pc.
119#
120OEM_LINKS	= ncri86pc
121
122OEM_USR_PLAT_LINKS	= $(OEM_LINKS:%=$(USR_PLAT_DIR)/%)
123
124$(OEM_USR_PLAT_LINKS):
125	$(INS.slink1)
126
127#
128# Definitions for the /platform directory aliases.
129# Currently none for i86pc.
130#
131PLAT_LINKS	=
132
133#
134# Make the /platform directories.  This is hardwired here because
135# the first stage of the project (KBI) only implements the userland
136# changes, but the only reasonable place to record the aliases is
137# here in kernel land.
138#
139install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
140			$(ROOT_PLAT_LINKS) $(USR_PLAT_LINKS) \
141			$(OEM_USR_PLAT_LINKS)
142
143#
144# Work-around to disable acpica global crosscheck lint warnings
145#
146LGREP.i86pc =	grep -v 'i86pc/io/acpica'
147
148#
149#	Full kernel lint target.
150#
151LINT_TARGET	= globallint
152
153# workaround for multiply defined errors
154globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
155
156globallint:
157	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
158	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) | $(LGREP.i86pc)
159
160lint:	lintlib .WAIT modlintlib .WAIT $(INTEL_LINTS) $(LINT_DEPS)
161
162$(INTEL_LINTS):	FRC
163	@cd $(UTSBASE)/intel/$@; pwd; $(MAKE) modlintlib
164
165FRC:
166
167include ../Makefile.targ
168
169#
170# Cross-reference customization: build a cross-reference over all of the
171# i86pc-related directories.
172#
173SHARED_XRDIRS	= ../i86pc ../intel ../common
174XRDIRS		= $(SHARED_XRDIRS)
175$(CLOSED_BUILD)XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
176XRPRUNE	= sun4u sun4
177
178cscope.out tags: FRC
179	$(XREF) -x $@
180