xref: /illumos-gate/usr/src/uts/intel/Makefile (revision 98157a70)
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# uts/intel/Makefile
22#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#
29#	This makefile drives the production of all implementation architecture
30#	independent modules for Intel processors.
31
32UTSBASE = ..
33
34include Makefile.intel
35
36LINT_KMODS_X1	= $(LINT_KMODS:nsmb=)
37LINT_KMODS_X2	= $(LINT_KMODS_X1:smbfs=)
38LINT_KMODLIBS	= $(LINT_KMODS_X2:e1000g=)
39LINT_LIBS	= $(LINT_LIB) $(GEN_LINT_LIB) \
40		  $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
41		  $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)
42
43# EXPORT DELETE START
44$(CLOSED_BUILD)LINT_LIBS	+= $(SVVS_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)
45$(CLOSED_BUILD)LINT_CLOSED_XMOD4	= $(CLOSED_XMODS:bnx=)
46$(CLOSED_BUILD)LINT_CLOSED_XMOD3	= $(LINT_CLOSED_XMOD4:lsimega=)
47$(CLOSED_BUILD)LINT_CLOSED_XMOD2	= $(LINT_CLOSED_XMOD3:spwr=)
48$(CLOSED_BUILD)LINT_CLOSED_XMOD1	= $(LINT_CLOSED_XMOD2:adpu320=)
49$(CLOSED_BUILD)LINT_LIBS	+= $(LINT_XMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
50
51#
52# dprov is delivered in the SUNWcrtptoint package.
53#
54DRV_KMODS	+= dprov
55
56#
57# CRYPTO_EK_KMODS modules go in the encryption pack (SUNWcry*)
58# They need to be listed separately since they duplicate global symbols
59# causing the 2nd pass of lint on the kernel to complain. CRYPTO_EK_KMODS
60# should not be listed in the lint target.
61#
62# Don't build these for OpenSolaris, since they will be replaced by
63# binaries that are signed by Sun RE.
64#
65$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= aes256
66$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= arcfour2048
67$(CLOSED_BUILD)CRYPTO_EK_KMODS	+= blowfish448
68
69# EXPORT DELETE END
70
71#
72#
73def		:=	TARGET= def
74def.prereq	:=	TARGET= def
75all		:=	TARGET= all
76all.prereq	:=	TARGET= all
77install		:=	TARGET= install
78install.prereq	:=	TARGET= all
79clean		:=	TARGET= clean
80clobber		:=	TARGET= clobber
81lint		:=	TARGET= lint
82lint.prereq	:=	TARGET= lint
83modlintlib	:=	TARGET= modlintlib
84modlist		:=	TARGET= modlist
85modlist		:=	NO_STATE= -K $$MODSTATE$$$$
86clean.lint	:=	TARGET= clean.lint
87check		:=	TARGET= check
88install_h	:=	TARGET= install_h
89install_h.prereq	:=	TARGET= install_h
90
91.KEEP_STATE:
92
93.PARALLEL:	$(PARALLEL_KMODS) $(CLOSED_KMODS) $(SVVS) $(XMODS) \
94		$(CLOSED_XMODS) config $(LINT_DEPS)
95
96def all install clean clobber modlist: genassym $(KMODS) $(CLOSED_KMODS) \
97	$(SVVS) $(XMODS) $(CLOSED_XMODS) config
98
99
100#
101# Privilege constants
102#
103# NOTE: The rules for generating priv_const.c file are shared between all
104# processor architectures and and should be kept in sync. If they are changed in
105# this file make sure that sparc rules are updated as well.
106#
107PRIVS_C = $(SRC)/uts/common/os/priv_const.c
108
109$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
110	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
111
112#
113# Prerequisites
114#
115# The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
116# i86xpv and intel are all built in parallel. This requires building certain
117# parts before the parallel build can start. The uts/Makefile appends the
118# '.prereq' string to the original target and executes this Makefile to build
119# any prerequisites needed before the full parallel build can start. After that
120# make continues with normal targets.
121#
122# Any build prerequisites for x86 builds should be described here.
123#
124# genassym is used to build intel/dtrace and genunix, so it should be built
125# first.
126#
127# priv_const.c is required to build genunix.
128#
129# genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
130#   intel/ip so as a side effect this dependency builds intel/ip as part of the
131#   prerequisites.
132#
133# intel/dtrace depends on i86pc/genassym, so we need to build both
134# i86pc/genassym and intel/genassym.
135#
136all.prereq install.prereq def.prereq: genassym genunix FRC
137	@cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
138
139#
140# i86pc lint libraries should be built first
141#
142lint.prereq: FRC
143	@cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
144
145#
146# Nothing to do for any other prerequisite targets.
147#
148%.prereq:
149
150genunix: $(PRIVS_C)
151
152modlintlib clean.lint: $(LINT_KMODS) $(CLOSED_LINT_KMODS) $(SVVS) \
153	$(XMODS) $(CLOSED_XMODS)
154
155genassym $(KMODS) $(SUBDIRS) config:	FRC
156	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
157
158$(CLOSED_KMODS):	FRC
159	cd $(CLOSED)/uts/intel/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
160
161$(XMODS):	FRC
162	@if [ -f $@/Makefile  ]; then \
163		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
164	else \
165		true; \
166	fi
167
168$(SVVS) $(CLOSED_XMODS):	FRC
169	@if [ -f $(CLOSED)/uts/intel/$@/Makefile  ]; then \
170		cd $(CLOSED)/uts/intel/$@; pwd; \
171		    $(MAKE) $(NO_STATE) $(TARGET); \
172	else \
173		true; \
174	fi
175
176install_h check:	FRC
177	@cd sys; pwd; $(MAKE) $(TARGET)
178	@cd asm; pwd; $(MAKE) $(TARGET)
179	@cd ia32/sys; pwd; $(MAKE) $(TARGET)
180	@cd amd64/sys; pwd; $(MAKE) $(TARGET)
181
182#
183# Work-around to disable acpica global crosscheck lint warnings
184#
185LGREP.intel =	grep -v 'intel/io/acpica'
186
187#
188#	Full kernel lint target.
189#
190LINT_TARGET	= globallint
191
192# workaround for multiply defined errors
193globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
194
195globallint:
196	@pwd
197	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
198	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
199
200lint:	modlintlib .WAIT $(LINT_DEPS)
201
202# EXPORT DELETE START
203
204EXPORT_SRC:
205	$(RM) Makefile+
206	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
207	    < Makefile > Makefile+
208	$(MV) Makefile+ Makefile
209	$(CHMOD) 444 Makefile
210
211# EXPORT DELETE END
212
213include ../Makefile.targ
214