xref: /illumos-gate/usr/src/uts/intel/Makefile (revision 74e12c43fe52f2c30f36e65a4d0fb0e8dfd7068a)
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
37#
38# dprov is delivered in the SUNWcryptoint package.
39#
40DRV_KMODS	+= dprov
41
42#
43#
44def		:=	TARGET= def
45def.prereq	:=	TARGET= def
46all		:=	TARGET= all
47all.prereq	:=	TARGET= all
48install		:=	TARGET= install
49install.prereq	:=	TARGET= install
50clean		:=	TARGET= clean
51clobber		:=	TARGET= clobber
52modlist		:=	TARGET= modlist
53modlist		:=	NO_STATE= -K $$MODSTATE$$$$
54check		:=	TARGET= check
55install_h	:=	TARGET= install_h
56install_h.prereq	:=	TARGET= install_h
57
58.KEEP_STATE:
59
60.PARALLEL:	$(PARALLEL_KMODS) $(XMODS) config
61
62def all install clean clobber modlist: $(KMODS) $(XMODS) config
63
64clobber: clobber.targ
65
66#
67# Privilege constants
68#
69# NOTE: The rules for generating priv_const.c file are shared between all
70# processor architectures and and should be kept in sync. If they are changed in
71# this file make sure that sparc rules are updated as well.
72#
73PRIVS_C = $(SRC)/uts/common/os/priv_const.c
74
75$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
76	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
77
78CLOBBERFILES += $(PRIVS_C)
79
80#
81# Prerequisites
82#
83# The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
84# i86xpv and intel are all built in parallel. This requires building certain
85# parts before the parallel build can start. The uts/Makefile appends the
86# '.prereq' string to the original target and executes this Makefile to build
87# any prerequisites needed before the full parallel build can start. After that
88# make continues with normal targets.
89#
90# Any build prerequisites for x86 builds should be described here.
91#
92# genassym is used to build intel/dtrace and genunix, so it should be built
93# first.
94#
95# priv_const.c is required to build genunix.
96#
97# genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
98#   intel/ip so as a side effect this dependency builds intel/ip as part of the
99#   prerequisites.
100#
101# intel/dtrace depends on i86pc/genassym, so we need to build both
102# i86pc/genassym and intel/genassym.
103#
104all.prereq install.prereq def.prereq: genunix FRC
105	@cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
106
107#
108# Nothing to do for any other prerequisite targets.
109#
110%.prereq:
111
112genunix: $(PRIVS_C)
113
114$(KMODS) $(SUBDIRS) config:	FRC
115	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
116
117$(XMODS):	FRC
118	cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
119
120install_h check:	FRC
121	@cd sys; pwd; $(MAKE) $(TARGET)
122	@cd asm; pwd; $(MAKE) $(TARGET)
123	@cd ia32/sys; pwd; $(MAKE) $(TARGET)
124	@cd amd64/sys; pwd; $(MAKE) $(TARGET)
125
126include ../Makefile.targ
127