xref: /illumos-gate/usr/src/uts/intel/Makefile (revision c057d312c6f715bb3aeadb653466e7046f26c4af)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
588543b5cSkrishna# Common Development and Distribution License (the "License").
688543b5cSkrishna# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate# uts/intel/Makefile
227c478bd9Sstevel@tonic-gate#
238f8c16c4SGarrett D'Amore# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
247b07063dSIgor Kozhukhov# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate#	This makefile drives the production of all implementation architecture
277c478bd9Sstevel@tonic-gate#	independent modules for Intel processors.
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateUTSBASE = ..
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude Makefile.intel
327c478bd9Sstevel@tonic-gate
33*c057d312SToomas Soome# Unset BINARY for clobber.targ because otherwise it will try to remove
34*c057d312SToomas Soome# a directory under uts/intel.
35*c057d312SToomas SoomeBINARY=
36*c057d312SToomas Soome
374bff34e3SthurlowLINT_KMODS_X1	= $(LINT_KMODS:nsmb=)
384bff34e3SthurlowLINT_KMODS_X2	= $(LINT_KMODS_X1:smbfs=)
39aec11327SToomas SoomeLINT_KMODS_X3	= $(LINT_KMODS_X2:e1000g=)
4014b24e2bSVaishali KulkarniLINT_KMODS_X4	= $(LINT_KMODS_X3:qede=)
4114b24e2bSVaishali KulkarniLINT_KMODLIBS	= $(LINT_KMODS_X4:iwn=)
427c478bd9Sstevel@tonic-gateLINT_LIBS	= $(LINT_LIB) $(GEN_LINT_LIB) \
43c0e7977aSJosef 'Jeff' Sipek		  $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gate#
46b6c3f786Sbubbva# dprov is delivered in the SUNWcryptoint package.
477c478bd9Sstevel@tonic-gate#
487c478bd9Sstevel@tonic-gateDRV_KMODS	+= dprov
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate#
517c478bd9Sstevel@tonic-gate#
527c478bd9Sstevel@tonic-gatedef		:=	TARGET= def
5398157a70Sakolbdef.prereq	:=	TARGET= def
547c478bd9Sstevel@tonic-gateall		:=	TARGET= all
5598157a70Sakolball.prereq	:=	TARGET= all
567c478bd9Sstevel@tonic-gateinstall		:=	TARGET= install
575db531e3SRichard Loweinstall.prereq	:=	TARGET= install
587c478bd9Sstevel@tonic-gateclean		:=	TARGET= clean
597c478bd9Sstevel@tonic-gateclobber		:=	TARGET= clobber
607c478bd9Sstevel@tonic-gatelint		:=	TARGET= lint
6198157a70Sakolblint.prereq	:=	TARGET= lint
627c478bd9Sstevel@tonic-gatemodlintlib	:=	TARGET= modlintlib
63fb9f9b97Skupfermodlist		:=	TARGET= modlist
64fb9f9b97Skupfermodlist		:=	NO_STATE= -K $$MODSTATE$$$$
657c478bd9Sstevel@tonic-gateclean.lint	:=	TARGET= clean.lint
667c478bd9Sstevel@tonic-gatecheck		:=	TARGET= check
677c478bd9Sstevel@tonic-gateinstall_h	:=	TARGET= install_h
6898157a70Sakolbinstall_h.prereq	:=	TARGET= install_h
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate.KEEP_STATE:
717c478bd9Sstevel@tonic-gate
72c0e7977aSJosef 'Jeff' Sipek.PARALLEL:	$(PARALLEL_KMODS) $(XMODS) config $(LINT_DEPS)
737c478bd9Sstevel@tonic-gate
74c0e7977aSJosef 'Jeff' Sipekdef all install clean clobber modlist: $(KMODS) $(XMODS) config
757c478bd9Sstevel@tonic-gate
76b6805bf7SGordon Rossclobber: clobber.targ
7798157a70Sakolb
7898157a70Sakolb#
7998157a70Sakolb# Privilege constants
8098157a70Sakolb#
8198157a70Sakolb# NOTE: The rules for generating priv_const.c file are shared between all
8298157a70Sakolb# processor architectures and and should be kept in sync. If they are changed in
8398157a70Sakolb# this file make sure that sparc rules are updated as well.
8498157a70Sakolb#
8598157a70SakolbPRIVS_C = $(SRC)/uts/common/os/priv_const.c
8698157a70Sakolb
8798157a70Sakolb$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
887b07063dSIgor Kozhukhov	$(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
8998157a70Sakolb
90b6805bf7SGordon RossCLOBBERFILES += $(PRIVS_C)
91b6805bf7SGordon Ross
9298157a70Sakolb#
9398157a70Sakolb# Prerequisites
9498157a70Sakolb#
9598157a70Sakolb# The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
9698157a70Sakolb# i86xpv and intel are all built in parallel. This requires building certain
9798157a70Sakolb# parts before the parallel build can start. The uts/Makefile appends the
9898157a70Sakolb# '.prereq' string to the original target and executes this Makefile to build
9998157a70Sakolb# any prerequisites needed before the full parallel build can start. After that
10098157a70Sakolb# make continues with normal targets.
10198157a70Sakolb#
10298157a70Sakolb# Any build prerequisites for x86 builds should be described here.
10398157a70Sakolb#
10498157a70Sakolb# genassym is used to build intel/dtrace and genunix, so it should be built
10598157a70Sakolb# first.
10698157a70Sakolb#
10798157a70Sakolb# priv_const.c is required to build genunix.
10898157a70Sakolb#
10998157a70Sakolb# genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
11098157a70Sakolb#   intel/ip so as a side effect this dependency builds intel/ip as part of the
11198157a70Sakolb#   prerequisites.
11298157a70Sakolb#
11398157a70Sakolb# intel/dtrace depends on i86pc/genassym, so we need to build both
11498157a70Sakolb# i86pc/genassym and intel/genassym.
11598157a70Sakolb#
116eb5a5c78SSurya Prakkiall.prereq install.prereq def.prereq: genunix FRC
11798157a70Sakolb	@cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
11898157a70Sakolb
11998157a70Sakolb#
12098157a70Sakolb# i86pc lint libraries should be built first
12198157a70Sakolb#
12298157a70Sakolblint.prereq: FRC
12398157a70Sakolb	@cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
12498157a70Sakolb
12598157a70Sakolb#
12698157a70Sakolb# Nothing to do for any other prerequisite targets.
12798157a70Sakolb#
12898157a70Sakolb%.prereq:
12998157a70Sakolb
13098157a70Sakolbgenunix: $(PRIVS_C)
13198157a70Sakolb
132c0e7977aSJosef 'Jeff' Sipekmodlintlib clean.lint: $(LINT_KMODS) $(XMODS)
1337c478bd9Sstevel@tonic-gate
134eb5a5c78SSurya Prakki$(KMODS) $(SUBDIRS) config:	FRC
135fb9f9b97Skupfer	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
1367c478bd9Sstevel@tonic-gate
137fb9f9b97Skupfer$(XMODS):	FRC
1387c478bd9Sstevel@tonic-gate	@if [ -f $@/Makefile  ]; then \
139fb9f9b97Skupfer		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
140fb9f9b97Skupfer	else \
141fb9f9b97Skupfer		true; \
142fb9f9b97Skupfer	fi
143fb9f9b97Skupfer
1447c478bd9Sstevel@tonic-gateinstall_h check:	FRC
1457c478bd9Sstevel@tonic-gate	@cd sys; pwd; $(MAKE) $(TARGET)
1467c478bd9Sstevel@tonic-gate	@cd asm; pwd; $(MAKE) $(TARGET)
1477c478bd9Sstevel@tonic-gate	@cd ia32/sys; pwd; $(MAKE) $(TARGET)
1487c478bd9Sstevel@tonic-gate	@cd amd64/sys; pwd; $(MAKE) $(TARGET)
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate#
151ae115bc7Smrj# Work-around to disable acpica global crosscheck lint warnings
152ae115bc7Smrj#
153ae115bc7SmrjLGREP.intel =	grep -v 'intel/io/acpica'
154ae115bc7Smrj
155ae115bc7Smrj#
1567c478bd9Sstevel@tonic-gate#	Full kernel lint target.
1577c478bd9Sstevel@tonic-gate#
1587c478bd9Sstevel@tonic-gateLINT_TARGET	= globallint
1597c478bd9Sstevel@tonic-gate
160ae115bc7Smrj# workaround for multiply defined errors
161ae115bc7Smrjgloballint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
162ae115bc7Smrj
1637c478bd9Sstevel@tonic-gategloballint:
16498157a70Sakolb	@pwd
1657c478bd9Sstevel@tonic-gate	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
1666e541dddSmrj	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gatelint:	modlintlib .WAIT $(LINT_DEPS)
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
171