xref: /illumos-gate/usr/src/uts/intel/Makefile (revision 45bf502ff96d3c90215cf16c25a80d757f276431)
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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
25#
26#	This makefile drives the production of all implementation architecture
27#	independent modules for Intel processors.
28
29UTSBASE = ..
30
31include Makefile.intel
32
33LINT_KMODS_X1	= $(LINT_KMODS:nsmb=)
34LINT_KMODS_X2	= $(LINT_KMODS_X1:smbfs=)
35LINT_KMODS_X3	= $(LINT_KMODS_X2:e1000g=)
36LINT_KMODS_X4	= $(LINT_KMODS_X3:qede=)
37LINT_KMODLIBS	= $(LINT_KMODS_X4:iwn=)
38LINT_LIBS	= $(LINT_LIB) $(GEN_LINT_LIB) \
39		  $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
40
41#
42# dprov is delivered in the SUNWcryptoint package.
43#
44DRV_KMODS	+= dprov
45
46#
47#
48def		:=	TARGET= def
49def.prereq	:=	TARGET= def
50all		:=	TARGET= all
51all.prereq	:=	TARGET= all
52install		:=	TARGET= install
53install.prereq	:=	TARGET= install
54clean		:=	TARGET= clean
55clobber		:=	TARGET= clobber
56lint		:=	TARGET= lint
57lint.prereq	:=	TARGET= lint
58modlintlib	:=	TARGET= modlintlib
59modlist		:=	TARGET= modlist
60modlist		:=	NO_STATE= -K $$MODSTATE$$$$
61clean.lint	:=	TARGET= clean.lint
62check		:=	TARGET= check
63install_h	:=	TARGET= install_h
64install_h.prereq	:=	TARGET= install_h
65
66.KEEP_STATE:
67
68.PARALLEL:	$(PARALLEL_KMODS) $(XMODS) config $(LINT_DEPS)
69
70def all install clean clobber modlist: $(KMODS) $(XMODS) config
71
72clobber: clobber.targ
73
74#
75# Privilege constants
76#
77# NOTE: The rules for generating priv_const.c file are shared between all
78# processor architectures and and should be kept in sync. If they are changed in
79# this file make sure that sparc rules are updated as well.
80#
81PRIVS_C = $(SRC)/uts/common/os/priv_const.c
82
83$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
84	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
85
86CLOBBERFILES += $(PRIVS_C)
87
88#
89# Prerequisites
90#
91# The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
92# i86xpv and intel are all built in parallel. This requires building certain
93# parts before the parallel build can start. The uts/Makefile appends the
94# '.prereq' string to the original target and executes this Makefile to build
95# any prerequisites needed before the full parallel build can start. After that
96# make continues with normal targets.
97#
98# Any build prerequisites for x86 builds should be described here.
99#
100# genassym is used to build intel/dtrace and genunix, so it should be built
101# first.
102#
103# priv_const.c is required to build genunix.
104#
105# genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
106#   intel/ip so as a side effect this dependency builds intel/ip as part of the
107#   prerequisites.
108#
109# intel/dtrace depends on i86pc/genassym, so we need to build both
110# i86pc/genassym and intel/genassym.
111#
112all.prereq install.prereq def.prereq: genunix FRC
113	@cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
114
115#
116# i86pc lint libraries should be built first
117#
118lint.prereq: FRC
119	@cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
120
121#
122# Nothing to do for any other prerequisite targets.
123#
124%.prereq:
125
126genunix: $(PRIVS_C)
127
128modlintlib clean.lint: $(LINT_KMODS) $(XMODS)
129
130$(KMODS) $(SUBDIRS) config:	FRC
131	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
132
133$(XMODS):	FRC
134	@if [ -f $@/Makefile  ]; then \
135		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
136	else \
137		true; \
138	fi
139
140install_h check:	FRC
141	@cd sys; pwd; $(MAKE) $(TARGET)
142	@cd asm; pwd; $(MAKE) $(TARGET)
143	@cd ia32/sys; pwd; $(MAKE) $(TARGET)
144	@cd amd64/sys; pwd; $(MAKE) $(TARGET)
145
146#
147# Work-around to disable acpica global crosscheck lint warnings
148#
149LGREP.intel =	grep -v 'intel/io/acpica'
150
151#
152#	Full kernel lint target.
153#
154LINT_TARGET	= globallint
155
156# workaround for multiply defined errors
157globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
158
159globallint:
160	@pwd
161	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
162	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
163
164lint:	modlintlib .WAIT $(LINT_DEPS)
165
166include ../Makefile.targ
167