xref: /illumos-gate/usr/src/uts/intel/Makefile (revision eb5a5c78)
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.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate#	This makefile drives the production of all implementation architecture
267c478bd9Sstevel@tonic-gate#	independent modules for Intel processors.
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateUTSBASE = ..
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateinclude Makefile.intel
317c478bd9Sstevel@tonic-gate
324bff34e3SthurlowLINT_KMODS_X1	= $(LINT_KMODS:nsmb=)
334bff34e3SthurlowLINT_KMODS_X2	= $(LINT_KMODS_X1:smbfs=)
344bff34e3SthurlowLINT_KMODLIBS	= $(LINT_KMODS_X2:e1000g=)
357c478bd9Sstevel@tonic-gateLINT_LIBS	= $(LINT_LIB) $(GEN_LINT_LIB) \
3608057504Sxy		  $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln) \
37fb9f9b97Skupfer		  $(CLOSED_LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gate# EXPORT DELETE START
4088543b5cSkrishna$(CLOSED_BUILD)LINT_LIBS	+= $(SVVS_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)
418f8c16c4SGarrett D'Amore$(CLOSED_BUILD)LINT_CLOSED_XMOD4	= $(CLOSED_XMODS:bnx=)
428f8c16c4SGarrett D'Amore$(CLOSED_BUILD)LINT_CLOSED_XMOD3	= $(LINT_CLOSED_XMOD4:bnxe=)
438f8c16c4SGarrett D'Amore$(CLOSED_BUILD)LINT_CLOSED_XMOD2	= $(LINT_CLOSED_XMOD3:lsimega=)
4408057504Sxy$(CLOSED_BUILD)LINT_CLOSED_XMOD1	= $(LINT_CLOSED_XMOD2:adpu320=)
45fb9f9b97Skupfer$(CLOSED_BUILD)LINT_LIBS	+= $(LINT_XMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gate#
48b6c3f786Sbubbva# dprov is delivered in the SUNWcryptoint package.
497c478bd9Sstevel@tonic-gate#
507c478bd9Sstevel@tonic-gateDRV_KMODS	+= dprov
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gate# EXPORT DELETE END
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate#
567c478bd9Sstevel@tonic-gatedef		:=	TARGET= def
5798157a70Sakolbdef.prereq	:=	TARGET= def
587c478bd9Sstevel@tonic-gateall		:=	TARGET= all
5998157a70Sakolball.prereq	:=	TARGET= all
607c478bd9Sstevel@tonic-gateinstall		:=	TARGET= install
6198157a70Sakolbinstall.prereq	:=	TARGET= all
627c478bd9Sstevel@tonic-gateclean		:=	TARGET= clean
637c478bd9Sstevel@tonic-gateclobber		:=	TARGET= clobber
647c478bd9Sstevel@tonic-gatelint		:=	TARGET= lint
6598157a70Sakolblint.prereq	:=	TARGET= lint
667c478bd9Sstevel@tonic-gatemodlintlib	:=	TARGET= modlintlib
67fb9f9b97Skupfermodlist		:=	TARGET= modlist
68fb9f9b97Skupfermodlist		:=	NO_STATE= -K $$MODSTATE$$$$
697c478bd9Sstevel@tonic-gateclean.lint	:=	TARGET= clean.lint
707c478bd9Sstevel@tonic-gatecheck		:=	TARGET= check
717c478bd9Sstevel@tonic-gateinstall_h	:=	TARGET= install_h
7298157a70Sakolbinstall_h.prereq	:=	TARGET= install_h
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate.KEEP_STATE:
757c478bd9Sstevel@tonic-gate
76ae115bc7Smrj.PARALLEL:	$(PARALLEL_KMODS) $(CLOSED_KMODS) $(SVVS) $(XMODS) \
77ae115bc7Smrj		$(CLOSED_XMODS) config $(LINT_DEPS)
787c478bd9Sstevel@tonic-gate
79*eb5a5c78SSurya Prakkidef all install clean clobber modlist: $(KMODS) $(CLOSED_KMODS) \
809acbbeafSnn	$(SVVS) $(XMODS) $(CLOSED_XMODS) config
817c478bd9Sstevel@tonic-gate
8298157a70Sakolb
8398157a70Sakolb#
8498157a70Sakolb# Privilege constants
8598157a70Sakolb#
8698157a70Sakolb# NOTE: The rules for generating priv_const.c file are shared between all
8798157a70Sakolb# processor architectures and and should be kept in sync. If they are changed in
8898157a70Sakolb# this file make sure that sparc rules are updated as well.
8998157a70Sakolb#
9098157a70SakolbPRIVS_C = $(SRC)/uts/common/os/priv_const.c
9198157a70Sakolb
9298157a70Sakolb$(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
9398157a70Sakolb	$(NAWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
9498157a70Sakolb
9598157a70Sakolb#
9698157a70Sakolb# Prerequisites
9798157a70Sakolb#
9898157a70Sakolb# The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
9998157a70Sakolb# i86xpv and intel are all built in parallel. This requires building certain
10098157a70Sakolb# parts before the parallel build can start. The uts/Makefile appends the
10198157a70Sakolb# '.prereq' string to the original target and executes this Makefile to build
10298157a70Sakolb# any prerequisites needed before the full parallel build can start. After that
10398157a70Sakolb# make continues with normal targets.
10498157a70Sakolb#
10598157a70Sakolb# Any build prerequisites for x86 builds should be described here.
10698157a70Sakolb#
10798157a70Sakolb# genassym is used to build intel/dtrace and genunix, so it should be built
10898157a70Sakolb# first.
10998157a70Sakolb#
11098157a70Sakolb# priv_const.c is required to build genunix.
11198157a70Sakolb#
11298157a70Sakolb# genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
11398157a70Sakolb#   intel/ip so as a side effect this dependency builds intel/ip as part of the
11498157a70Sakolb#   prerequisites.
11598157a70Sakolb#
11698157a70Sakolb# intel/dtrace depends on i86pc/genassym, so we need to build both
11798157a70Sakolb# i86pc/genassym and intel/genassym.
11898157a70Sakolb#
119*eb5a5c78SSurya Prakkiall.prereq install.prereq def.prereq: genunix FRC
12098157a70Sakolb	@cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
12198157a70Sakolb
12298157a70Sakolb#
12398157a70Sakolb# i86pc lint libraries should be built first
12498157a70Sakolb#
12598157a70Sakolblint.prereq: FRC
12698157a70Sakolb	@cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
12798157a70Sakolb
12898157a70Sakolb#
12998157a70Sakolb# Nothing to do for any other prerequisite targets.
13098157a70Sakolb#
13198157a70Sakolb%.prereq:
13298157a70Sakolb
13398157a70Sakolbgenunix: $(PRIVS_C)
13498157a70Sakolb
135fb9f9b97Skupfermodlintlib clean.lint: $(LINT_KMODS) $(CLOSED_LINT_KMODS) $(SVVS) \
136fb9f9b97Skupfer	$(XMODS) $(CLOSED_XMODS)
1377c478bd9Sstevel@tonic-gate
138*eb5a5c78SSurya Prakki$(KMODS) $(SUBDIRS) config:	FRC
139fb9f9b97Skupfer	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
140fb9f9b97Skupfer
141fb9f9b97Skupfer$(CLOSED_KMODS):	FRC
142fb9f9b97Skupfer	cd $(CLOSED)/uts/intel/$@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
1437c478bd9Sstevel@tonic-gate
144fb9f9b97Skupfer$(XMODS):	FRC
1457c478bd9Sstevel@tonic-gate	@if [ -f $@/Makefile  ]; then \
146fb9f9b97Skupfer		cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
147fb9f9b97Skupfer	else \
148fb9f9b97Skupfer		true; \
149fb9f9b97Skupfer	fi
150fb9f9b97Skupfer
151fb9f9b97Skupfer$(SVVS) $(CLOSED_XMODS):	FRC
152fb9f9b97Skupfer	@if [ -f $(CLOSED)/uts/intel/$@/Makefile  ]; then \
153fb9f9b97Skupfer		cd $(CLOSED)/uts/intel/$@; pwd; \
154fb9f9b97Skupfer		    $(MAKE) $(NO_STATE) $(TARGET); \
1557c478bd9Sstevel@tonic-gate	else \
1567c478bd9Sstevel@tonic-gate		true; \
1577c478bd9Sstevel@tonic-gate	fi
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gateinstall_h check:	FRC
1607c478bd9Sstevel@tonic-gate	@cd sys; pwd; $(MAKE) $(TARGET)
1617c478bd9Sstevel@tonic-gate	@cd asm; pwd; $(MAKE) $(TARGET)
1627c478bd9Sstevel@tonic-gate	@cd ia32/sys; pwd; $(MAKE) $(TARGET)
1637c478bd9Sstevel@tonic-gate	@cd amd64/sys; pwd; $(MAKE) $(TARGET)
1647c478bd9Sstevel@tonic-gate
165ae115bc7Smrj#
166ae115bc7Smrj# Work-around to disable acpica global crosscheck lint warnings
167ae115bc7Smrj#
168ae115bc7SmrjLGREP.intel =	grep -v 'intel/io/acpica'
169ae115bc7Smrj
1707c478bd9Sstevel@tonic-gate#
1717c478bd9Sstevel@tonic-gate#	Full kernel lint target.
1727c478bd9Sstevel@tonic-gate#
1737c478bd9Sstevel@tonic-gateLINT_TARGET	= globallint
1747c478bd9Sstevel@tonic-gate
175ae115bc7Smrj# workaround for multiply defined errors
176ae115bc7Smrjgloballint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
177ae115bc7Smrj
1787c478bd9Sstevel@tonic-gategloballint:
17998157a70Sakolb	@pwd
1807c478bd9Sstevel@tonic-gate	@-$(ECHO) "\nFULL KERNEL: global crosschecks:"
1816e541dddSmrj	@-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
1827c478bd9Sstevel@tonic-gate
1837c478bd9Sstevel@tonic-gatelint:	modlintlib .WAIT $(LINT_DEPS)
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gate# EXPORT DELETE START
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gateEXPORT_SRC:
1887c478bd9Sstevel@tonic-gate	$(RM) Makefile+
1897c478bd9Sstevel@tonic-gate	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
1907c478bd9Sstevel@tonic-gate	    < Makefile > Makefile+
1917c478bd9Sstevel@tonic-gate	$(MV) Makefile+ Makefile
1927c478bd9Sstevel@tonic-gate	$(CHMOD) 444 Makefile
1937c478bd9Sstevel@tonic-gate
1947c478bd9Sstevel@tonic-gate# EXPORT DELETE END
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
197