xref: /illumos-gate/usr/src/uts/i86pc/Makefile (revision 34a0f871d192b33b865455a8812a3d34c1866315)
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 2007 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_PARALLEL_KMODS	= $(PARALLEL_KMODS:nxge=)
46LINT_LIBS	 = $(LINT_LIB) \
47		   $(GENUNIX_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
48		   $(LINT_PARALLEL_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
49		   $(CLOSED_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
50		   $(INTEL_LINTS:%=$(INTEL_LIB_DIR)/llib-l%.ln)
51
52#
53#
54#
55def		:=	TARGET= def
56all		:=	TARGET= all
57install		:=	TARGET= install
58clean		:=	TARGET= clean
59clobber		:=	TARGET= clobber
60lint		:=	TARGET= lint
61lintlib		:=	TARGET= lintlib
62machmodlintlib	:=	TARGET= modlintlib
63modlist		:=	TARGET= modlist
64modlist	modlist.intel :=	NO_STATE= -K $$MODSTATE$$$$
65clean.lint	:=	TARGET= clean.lint
66check		:=	TARGET= check
67
68.KEEP_STATE:
69
70.PARALLEL:	$(PARALLEL_KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS) \
71		modlist modlist.intel
72
73INITIAL_TARGETS = \
74	genassym \
75	unix \
76	cpu/scripts
77
78def all clean clobber clean.lint: setup genassym unix .WAIT \
79	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
80
81install: install_platforms setup genassym unix .WAIT \
82	$(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
83
84# list the modules under i86pc.
85modlist: unix $(KMODS) $(CLOSED_KMODS) $(XMODS) $(CLOSED_XMODS)
86
87# list the modules for Install -k i86pc.
88modlist.karch: modlist modlist.intel
89
90modlist.intel:
91	@cd $(SRC)/uts/intel; pwd; $(MAKE) $(NO_STATE) modlist
92
93lintlib:	unix
94
95modlintlib:	$(KMODS) $(CLOSED_KMODS)
96
97genassym unix $(KMODS):	FRC
98	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
99
100setup: FRC
101	@cd cpu/scripts; pwd; $(MAKE) $(TARGET)
102
103$(XMODS):	FRC
104	@if [ -f $@/Makefile  ]; then \
105		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
106	else \
107		true; \
108	fi
109
110$(CLOSED_KMODS):	FRC
111	cd $(CLOSED)/uts/i86pc/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
112
113$(CLOSED_XMODS):	FRC
114	@if [ -f $(CLOSED)/uts/i86pc/$@/Makefile  ]; then \
115		cd $(CLOSED)/uts/i86pc/$@; pwd; \
116		    $(MAKE) $(NO_STATE) $(TARGET); \
117	else \
118		true; \
119	fi
120
121install_h check:	FRC
122	@cd sys; pwd; $(MAKE) $(TARGET)
123
124#
125# Definitions for the /platform directory aliases.
126# Currently none for i86pc.
127#
128PLAT_LINKS	=
129
130#
131# Make the /platform directories.  This is hardwired here because
132# the first stage of the project (KBI) only implements the userland
133# changes, but the only reasonable place to record the aliases is
134# here in kernel land.
135#
136install_platforms:	$(ROOT_PSM_DIR) $(USR_PSM_DIR) \
137			$(ROOT_PLAT_LINKS) $(USR_PLAT_LINKS) \
138			$(OEM_USR_PLAT_LINKS)
139
140#
141#	Full kernel lint target.
142#
143LINT_TARGET	= globallint
144
145# workaround for multiply defined errors
146globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
147
148globallint:
149	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
150	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2)
151
152lint:	lintlib .WAIT modlintlib .WAIT $(INTEL_LINTS) $(LINT_DEPS)
153
154$(INTEL_LINTS):	FRC
155	@cd $(UTSBASE)/intel/$@; pwd; $(MAKE) modlintlib
156
157include ../Makefile.targ
158
159#
160# Cross-reference customization: build a cross-reference over all of the
161# i86pc-related directories.
162#
163SHARED_XRDIRS	= ../i86pc ../intel ../common
164XRDIRS		= $(SHARED_XRDIRS)
165$(CLOSED_BUILD)XRDIRS	= $(SHARED_XRDIRS:../%=../% ../../../closed/uts/%)
166XRPRUNE	= sun4u sun4
167
168cscope.out tags: FRC
169	$(XREF) -x $@
170