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