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