xref: /illumos-gate/usr/src/uts/Makefile.uts (revision bd0ce624)
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
502e56f3fSwesolows# Common Development and Distribution License (the "License").
602e56f3fSwesolows# 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#
2102e56f3fSwesolows
227c478bd9Sstevel@tonic-gate#
23b83ec4edSjmcp# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
2489b43686SBayard Bell# Copyright (c) 2011 Bayard G. Bell. All rights reserved.
2519b94df9SMatthew Ahrens# Copyright (c) 2011 by Delphix. All rights reserved.
26ea76c26cSAndy Stormont# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
27f73e0305SHans Rosenfeld# Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
287c478bd9Sstevel@tonic-gate#
2902e56f3fSwesolows
307c478bd9Sstevel@tonic-gate#
317c478bd9Sstevel@tonic-gate#	This Makefile contains the common targets and definitions for
327c478bd9Sstevel@tonic-gate#	all kernels. It is to be included in the Makefiles for specific
337c478bd9Sstevel@tonic-gate#	implementation architectures and processor architecture dependent
347c478bd9Sstevel@tonic-gate#	modules: i.e.: all driving kernel Makefiles.
357c478bd9Sstevel@tonic-gate#
367c478bd9Sstevel@tonic-gate#	Include global definitions:
377c478bd9Sstevel@tonic-gate#
387c478bd9Sstevel@tonic-gateinclude $(SRC)/Makefile.master
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate#
417c478bd9Sstevel@tonic-gate#	No text domain in the kernel.
427c478bd9Sstevel@tonic-gate#
437c478bd9Sstevel@tonic-gateDTEXTDOM =
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gate#
467c478bd9Sstevel@tonic-gate# 	Keep references to $(SRC)/common relative.
477c478bd9Sstevel@tonic-gateCOMMONBASE=	$(UTSBASE)/../common
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gate#
507c478bd9Sstevel@tonic-gate#	Setup build-specific vars
517c478bd9Sstevel@tonic-gate#	To add a build type:
527c478bd9Sstevel@tonic-gate#		add name to ALL_BUILDS32 & ALL_BUILDS64
537c478bd9Sstevel@tonic-gate#		set CLASS_name and OBJ_DIR_name
547c478bd9Sstevel@tonic-gate#		add targets to Makefile.targ
557c478bd9Sstevel@tonic-gate#
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate#
58112f9fc1Syz#	DEF_BUILDS is for def, lint, sischeck, and install
597c478bd9Sstevel@tonic-gate#	ALL_BUILDS is for everything else (all, clean, ...)
607c478bd9Sstevel@tonic-gate#
617c478bd9Sstevel@tonic-gate# The NOT_RELEASE_BUILD noise is to maintain compatibility with the
627c478bd9Sstevel@tonic-gate# gatekeeper's nightly build script.
637c478bd9Sstevel@tonic-gate#
647c478bd9Sstevel@tonic-gateDEF_BUILDS64				= obj64
657c478bd9Sstevel@tonic-gateDEF_BUILDSONLY64			= obj64
667c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)DEF_BUILDS64	= debug64
677c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)DEF_BUILDSONLY64	= debug64
687c478bd9Sstevel@tonic-gateALL_BUILDS64				= obj64 debug64
697c478bd9Sstevel@tonic-gateALL_BUILDSONLY64			= obj64 debug64
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate#
727c478bd9Sstevel@tonic-gate#	For modules in 64b dirs that aren't built 64b
737c478bd9Sstevel@tonic-gate#	or modules in 64b dirs that aren't built 32b we
747c478bd9Sstevel@tonic-gate#	need to create empty modlintlib files so global lint works
757c478bd9Sstevel@tonic-gate#
767c478bd9Sstevel@tonic-gateLINT64_BUILDS	= debug64
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate#
7995cb2e31SToomas Soome#	Build class (64b)
807c478bd9Sstevel@tonic-gate#
817c478bd9Sstevel@tonic-gateCLASS_OBJ64	= 64
827c478bd9Sstevel@tonic-gateCLASS_DBG64	= 64
837c478bd9Sstevel@tonic-gateCLASS		= $(CLASS_$(BUILD_TYPE))
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate#
867c478bd9Sstevel@tonic-gate#	Build subdirectory
877c478bd9Sstevel@tonic-gate#
887c478bd9Sstevel@tonic-gateOBJS_DIR_OBJ64	= obj64
897c478bd9Sstevel@tonic-gateOBJS_DIR_DBG64	= debug64
907c478bd9Sstevel@tonic-gateOBJS_DIR	= $(OBJS_DIR_$(BUILD_TYPE))
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate#
937c478bd9Sstevel@tonic-gate#	Create defaults so empty rules don't
947c478bd9Sstevel@tonic-gate#	confuse make
957c478bd9Sstevel@tonic-gate#
9695cb2e31SToomas SoomeCLASS_		= 64
9795cb2e31SToomas SoomeOBJS_DIR_	= debug64
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate#
1007c478bd9Sstevel@tonic-gate#	Build tools
1017c478bd9Sstevel@tonic-gate#
1027c478bd9Sstevel@tonic-gateCC_sparc_32	= $(sparc_CC)
1037c478bd9Sstevel@tonic-gateCC_sparc_64	= $(sparcv9_CC)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gateCC_i386_32	= $(i386_CC)
1067c478bd9Sstevel@tonic-gateCC_i386_64	= $(amd64_CC)
1077c478bd9Sstevel@tonic-gateCC_amd64_64	= $(amd64_CC)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gateCC		= $(CC_$(MACH)_$(CLASS))
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gateAS_sparc_32	= $(sparc_AS)
1127c478bd9Sstevel@tonic-gateAS_sparc_64	= $(sparcv9_AS)
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateAS_i386_32	= $(i386_AS)
1157c478bd9Sstevel@tonic-gateAS_i386_64	= $(amd64_AS)
1167c478bd9Sstevel@tonic-gateAS_amd64_64	= $(amd64_AS)
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gateAS		= $(AS_$(MACH)_$(CLASS))
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gateLD_sparc_32	= $(sparc_LD)
1217c478bd9Sstevel@tonic-gateLD_sparc_64	= $(sparcv9_LD)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gateLD_i386_32	= $(i386_LD)
1247c478bd9Sstevel@tonic-gateLD_i386_64	= $(amd64_LD)
1257c478bd9Sstevel@tonic-gateLD_amd64_64	= $(amd64_LD)
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gateLD		= $(LD_$(MACH)_$(CLASS))
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gateLINT_sparc_32	= $(sparc_LINT)
1307c478bd9Sstevel@tonic-gateLINT_sparc_64	= $(sparcv9_LINT)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gateLINT_i386_32	= $(i386_LINT)
1337c478bd9Sstevel@tonic-gateLINT_i386_64	= $(amd64_LINT)
1347c478bd9Sstevel@tonic-gateLINT_amd64_64	= $(amd64_LINT)
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gateLINT		= $(LINT_$(MACH)_$(CLASS))
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gateMODEL_32	= ilp32
1397c478bd9Sstevel@tonic-gateMODEL_64	= lp64
1407c478bd9Sstevel@tonic-gateMODEL		= $(MODEL_$(CLASS))
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gate#
1437c478bd9Sstevel@tonic-gate#	Build rules for linting the kernel.
1447c478bd9Sstevel@tonic-gate#
14591178d6bSBill MooreLHEAD =	$(ECHO) "\n$@";
1467c478bd9Sstevel@tonic-gate
14718b1f5baScarlsonj# Note: egrep returns "failure" if there are no matches, which is
14818b1f5baScarlsonj# exactly the opposite of what we need.
14989b43686SBayard BellLGREP.2 =	if egrep -v ' (_init|_fini|_info) '; then false; else true; fi
1507c478bd9Sstevel@tonic-gate
15191178d6bSBill MooreLTAIL =
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gateLINT.c =	$(LINT) -c -dirout=$(LINTS_DIR) $(LINTFLAGS) $(LINT_DEFS) $(CPPFLAGS)
1547c478bd9Sstevel@tonic-gate
155055d7c80Scarlsonj# Please do not add new erroff directives here.  If you need to disable
156055d7c80Scarlsonj# lint warnings in your module for things that cannot be fixed in any
157055d7c80Scarlsonj# reasonable manner, please augment LINTTAGS in your module Makefile
158055d7c80Scarlsonj# instead.
1598793b36bSNick ToddLINTTAGS	= -erroff=E_INCONS_ARG_DECL2
1608793b36bSNick ToddLINTTAGS	+= -erroff=E_INCONS_VAL_TYPE_DECL2
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gateLINTFLAGS_sparc_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
1630bb07399SNick ToddLINTFLAGS_sparc_64	= $(LINTFLAGS_sparc_32) -m64
1647c478bd9Sstevel@tonic-gateLINTFLAGS_i386_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
1650bb07399SNick ToddLINTFLAGS_i386_64	= $(LINTFLAGS_i386_32) -m64
1667c478bd9Sstevel@tonic-gate
167055d7c80ScarlsonjLINTFLAGS	= $(LINTFLAGS_$(MACH)_$(CLASS)) $(LINTTAGS)
1687c478bd9Sstevel@tonic-gateLINTFLAGS	+= $(C99LMODE)
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gate#
1717c478bd9Sstevel@tonic-gate#	Override this variable to modify the name of the lint target.
1727c478bd9Sstevel@tonic-gate#
1737c478bd9Sstevel@tonic-gateLINT_MODULE=	$(MODULE)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate#
1767c478bd9Sstevel@tonic-gate#	Build the compile/assemble lines:
1777c478bd9Sstevel@tonic-gate#
1787c478bd9Sstevel@tonic-gateEXTRA_OPTIONS		=
1797c478bd9Sstevel@tonic-gateAS_DEFS			= -D_ASM -D__STDC__=0
1807c478bd9Sstevel@tonic-gate
1814ab75253SmrjALWAYS_DEFS_32		= -D_KERNEL -D_SYSCALL32 -D_DDI_STRICT
1824ab75253SmrjALWAYS_DEFS_64		= -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64 \
1834ab75253Smrj			-D_DDI_STRICT
1847c478bd9Sstevel@tonic-gate#
1857c478bd9Sstevel@tonic-gate# XX64	This should be defined by the compiler!
1867c478bd9Sstevel@tonic-gate#
1877c478bd9Sstevel@tonic-gateALWAYS_DEFS_64		+= -Dsun -D__sun -D__SVR4
1887c478bd9Sstevel@tonic-gateALWAYS_DEFS		= $(ALWAYS_DEFS_$(CLASS))
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gate#
1917c478bd9Sstevel@tonic-gate#	CPPFLAGS is deliberatly set with a "=" and not a "+=".  For the kernel
1927c478bd9Sstevel@tonic-gate#	the header include path should not look for header files outside of
1937c478bd9Sstevel@tonic-gate#	the kernel code.  This "=" removes the search path built in
1947c478bd9Sstevel@tonic-gate#	Makefile.master inside CPPFLAGS.  Ditto for AS_CPPFLAGS.
1957c478bd9Sstevel@tonic-gate#
1967c478bd9Sstevel@tonic-gateCPPFLAGS	= $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) \
1977c478bd9Sstevel@tonic-gate		   $(INCLUDE_PATH) $(EXTRA_OPTIONS)
1987c478bd9Sstevel@tonic-gateASFLAGS		+= -P
1997c478bd9Sstevel@tonic-gateAS_CPPFLAGS	= $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \
2007c478bd9Sstevel@tonic-gate		   $(AS_INC_PATH) $(EXTRA_OPTIONS)
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gate#
2037c478bd9Sstevel@tonic-gate#	Make it (relatively) easy to share compilation options between
2047c478bd9Sstevel@tonic-gate#	all kernel implementations.
2057c478bd9Sstevel@tonic-gate#
2067c478bd9Sstevel@tonic-gate
207f56c1286Srobinson# Override the default, the kernel is squeaky clean
208f56c1286SrobinsonCERRWARN = -errtags=yes -errwarn=%all
209f56c1286Srobinson
2107014882cSRichard LoweCERRWARN += -_gcc=-Wno-missing-braces
2117014882cSRichard LoweCERRWARN += -_gcc=-Wno-sign-compare
2127014882cSRichard LoweCERRWARN += -_gcc=-Wno-unknown-pragmas
2137014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-parameter
2147014882cSRichard LoweCERRWARN += -_gcc=-Wno-missing-field-initializers
2157014882cSRichard Lowe
2167014882cSRichard Lowe# DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
2177014882cSRichard Lowe# -nd builds
2187014882cSRichard Lowe$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
2197014882cSRichard Lowe$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body
2207014882cSRichard Lowe
221*bd0ce624SYuri PankovCSTD = $(CSTD_GNU99)
222ae115bc7Smrj
2237c478bd9Sstevel@tonic-gateCFLAGS_uts		=
2247c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(STAND_FLAGS_$(CLASS))
2257c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(CCVERBOSE)
2267c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(ILDOFF)
2277c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(XAOPT)
2282d4be7aaSRichard LoweCFLAGS_uts		+= $(CTF_FLAGS_$(CLASS))
2297c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(CERRWARN)
2306a3e8e86SRichard LoweCFLAGS_uts		+= $(CCNOAUTOINLINE)
23196ccc8cbSesaxeCFLAGS_uts		+= $(CGLOBALSTATIC)
2327c478bd9Sstevel@tonic-gateCFLAGS_uts		+= $(EXTRA_CFLAGS)
233d69cdb36SRichard LoweCFLAGS_uts		+= $(CSOURCEDEBUGFLAGS)
234d69cdb36SRichard LoweCFLAGS_uts		+= $(CUSERFLAGS)
2357c478bd9Sstevel@tonic-gate
2367c478bd9Sstevel@tonic-gate#
2377c478bd9Sstevel@tonic-gate#	Declare that $(OBJECTS) and $(LINTS) can be compiled in parallel.
2387c478bd9Sstevel@tonic-gate#	The DUMMY target is for those instances where OBJECTS and LINTS
2397c478bd9Sstevel@tonic-gate#	are empty (to avoid an unconditional .PARALLEL).
2407c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJECTS) $(LINTS) DUMMY
2417c478bd9Sstevel@tonic-gate
2427c478bd9Sstevel@tonic-gate#
2437c478bd9Sstevel@tonic-gate#	Expanded dependencies
2447c478bd9Sstevel@tonic-gate#
2457c478bd9Sstevel@tonic-gateDEF_DEPS	= $(DEF_BUILDS:%=def.%)
2467c478bd9Sstevel@tonic-gateALL_DEPS	= $(ALL_BUILDS:%=all.%)
2477c478bd9Sstevel@tonic-gateCLEAN_DEPS	= $(ALL_BUILDS:%=clean.%)
2487c478bd9Sstevel@tonic-gateCLOBBER_DEPS	= $(ALL_BUILDS:%=clobber.%)
2497c478bd9Sstevel@tonic-gateLINT_DEPS	= $(DEF_BUILDS:%=lint.%)
2507c478bd9Sstevel@tonic-gateMODLINTLIB_DEPS	= $(DEF_BUILDS:%=modlintlib.%)
251fb9f9b97SkupferMODLIST_DEPS	= $(DEF_BUILDS:%=modlist.%)
2527c478bd9Sstevel@tonic-gateCLEAN_LINT_DEPS	= $(ALL_BUILDS:%=clean.lint.%)
2537c478bd9Sstevel@tonic-gateINSTALL_DEPS	= $(DEF_BUILDS:%=install.%)
2547c478bd9Sstevel@tonic-gateSYM_DEPS	= $(SYM_BUILDS:%=symcheck.%)
255112f9fc1SyzSISCHECK_DEPS	= $(DEF_BUILDS:%=sischeck.%)
256112f9fc1SyzSISCLEAN_DEPS	= $(ALL_BUILDS:%=sisclean.%)
2577c478bd9Sstevel@tonic-gate
2587c478bd9Sstevel@tonic-gate#
2597c478bd9Sstevel@tonic-gate#	Default module name
2607c478bd9Sstevel@tonic-gate#
2617c478bd9Sstevel@tonic-gateBINARY		= $(OBJS_DIR)/$(MODULE)
2627c478bd9Sstevel@tonic-gate
2637c478bd9Sstevel@tonic-gate#
2647c478bd9Sstevel@tonic-gate#	Default cleanup definitions
2657c478bd9Sstevel@tonic-gate#
2667c478bd9Sstevel@tonic-gateCLEANLINTFILES	= $(LINTS) $(MOD_LINT_LIB)
2677c478bd9Sstevel@tonic-gateCLEANFILES	= $(OBJECTS) $(CLEANLINTFILES)
2687c478bd9Sstevel@tonic-gateCLOBBERFILES	= $(BINARY) $(CLEANFILES)
2697c478bd9Sstevel@tonic-gate
2707c478bd9Sstevel@tonic-gate#
2717c478bd9Sstevel@tonic-gate#	Installation constants:
2727c478bd9Sstevel@tonic-gate#
2737c478bd9Sstevel@tonic-gate#		FILEMODE is the mode given to the kernel modules
2747c478bd9Sstevel@tonic-gate#		CFILEMODE is the mode given to the '.conf' files
2757c478bd9Sstevel@tonic-gate#
2767c478bd9Sstevel@tonic-gateFILEMODE	 = 755
2777c478bd9Sstevel@tonic-gateDIRMODE		 = 755
2787c478bd9Sstevel@tonic-gateCFILEMODE	 = 644
2797c478bd9Sstevel@tonic-gate
2807c478bd9Sstevel@tonic-gate#
2817c478bd9Sstevel@tonic-gate#	Special Installation Macros for the installation of '.conf' files.
2827c478bd9Sstevel@tonic-gate#
2837c478bd9Sstevel@tonic-gate#	These are unique because they are not installed from the current
2847c478bd9Sstevel@tonic-gate#	working directory.
2857c478bd9Sstevel@tonic-gate#
2867c478bd9Sstevel@tonic-gate# Sigh.  Apparently at some time in the past there was a confusion on
2877c478bd9Sstevel@tonic-gate# whether the name is SRC_CONFFILE or SRC_CONFILE.  Consistency with the
2887c478bd9Sstevel@tonic-gate# other names would indicate SRC_CONFFILE, but the voting is >180 Makefiles
2897c478bd9Sstevel@tonic-gate# with SRC_CONFILE and about 11 with SRC_CONFFILE.  Software development
2907c478bd9Sstevel@tonic-gate# isn't a popularity contest, though, and so my inclination is to define
2917c478bd9Sstevel@tonic-gate# both names for now and incrementally convert to SRC_CONFFILE to be consistent
2927c478bd9Sstevel@tonic-gate# with the other names.
2937c478bd9Sstevel@tonic-gate#
2947c478bd9Sstevel@tonic-gateCONFFILE		= $(MODULE).conf
2957c478bd9Sstevel@tonic-gateSRC_CONFFILE		= $(CONF_SRCDIR)/$(CONFFILE)
2967c478bd9Sstevel@tonic-gateSRC_CONFILE		= $(SRC_CONFFILE)
2977c478bd9Sstevel@tonic-gateROOT_CONFFILE_32	= $(ROOTMODULE).conf
2987c478bd9Sstevel@tonic-gateROOT_CONFFILE_64	= $(ROOTMODULE:%/$(SUBDIR64)/$(MODULE)=%/$(MODULE)).conf
2997c478bd9Sstevel@tonic-gateROOT_CONFFILE		= $(ROOT_CONFFILE_$(CLASS))
3007c478bd9Sstevel@tonic-gate
3017c478bd9Sstevel@tonic-gate
3027c478bd9Sstevel@tonic-gateINS.conffile= \
3037c478bd9Sstevel@tonic-gate	$(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE)
30444961713Sgirish
3057c478bd9Sstevel@tonic-gate#
3067c478bd9Sstevel@tonic-gate# The CTF merge of child kernel modules is performed against one of the genunix
3077c478bd9Sstevel@tonic-gate# modules.  For Intel builds, all modules will be used with a single genunix:
3087c478bd9Sstevel@tonic-gate# the one built in intel/genunix.  For SPARC builds, a given
3097c478bd9Sstevel@tonic-gate# module may be
3107c478bd9Sstevel@tonic-gate# used with one of a number of genunix files, depending on what platform the
3117c478bd9Sstevel@tonic-gate# module is deployed on.  We merge against the sun4u genunix to optimize for
3127c478bd9Sstevel@tonic-gate# the common case.  We also merge against the ip driver since networking is
3137c478bd9Sstevel@tonic-gate# typically loaded and types defined therein are shared between many modules.
3147c478bd9Sstevel@tonic-gate#
3157c478bd9Sstevel@tonic-gateCTFMERGE_GUDIR_sparc	= sun4u
3167c478bd9Sstevel@tonic-gateCTFMERGE_GUDIR_i386	= intel
3177c478bd9Sstevel@tonic-gateCTFMERGE_GUDIR		= $(CTFMERGE_GUDIR_$(MACH))
3187c478bd9Sstevel@tonic-gate
3197c478bd9Sstevel@tonic-gateCTFMERGE_GENUNIX 	= \
3207c478bd9Sstevel@tonic-gate	$(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix
3217c478bd9Sstevel@tonic-gate
3227c478bd9Sstevel@tonic-gate#
323105958d7SGarrett D'Amore# Used to uniquify a non-genunix module against genunix. $VERSION is used
324105958d7SGarrett D'Amore# for the label.
3257c478bd9Sstevel@tonic-gate#
326b1e09399SJonathan Adams# For the ease of developers dropping modules onto possibly unrelated systems,
32719b94df9SMatthew Ahrens# you can set NO_GENUNIX_UNIQUIFY= in the environment to skip uniquifying
32819b94df9SMatthew Ahrens# against genunix.
329b1e09399SJonathan Adams#
330b1e09399SJonathan AdamsNO_GENUNIX_UNIQUIFY=$(POUND_SIGN)
331105958d7SGarrett D'AmoreCTFMERGE_GENUNIX_DFLAG=-d $(CTFMERGE_GENUNIX)
332105958d7SGarrett D'Amore$(NO_GENUNIX_UNIQUIFY)CTF_GENUNIX_DFLAG=
333b1e09399SJonathan Adams
3347c478bd9Sstevel@tonic-gateCTFMERGE_UNIQUIFY_AGAINST_GENUNIX	= \
335105958d7SGarrett D'Amore	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION \
336105958d7SGarrett D'Amore	$(CTFMERGE_GENUNIX_DFLAG) -o $@ $(OBJECTS) $(CTFEXTRAOBJS)
337105958d7SGarrett D'Amore
338105958d7SGarrett D'Amore#
339105958d7SGarrett D'Amore# Used to merge the genunix module.
3407c478bd9Sstevel@tonic-gate#
3417c478bd9Sstevel@tonic-gateCTFMERGE_GENUNIX_MERGE		= \
342105958d7SGarrett D'Amore	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION -o $@ \
343105958d7SGarrett D'Amore	$(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)
3447c478bd9Sstevel@tonic-gate
3457c478bd9Sstevel@tonic-gate#
3467c478bd9Sstevel@tonic-gate# We ctfmerge the ip objects into genunix to maximize the number of common types
3477c478bd9Sstevel@tonic-gate# found there, thus maximizing the effectiveness of uniquification.  We don't
3487c478bd9Sstevel@tonic-gate# want the genunix build to have to know about the individual ip objects, so we
3497c478bd9Sstevel@tonic-gate# put them in an archive.  The genunix ctfmerge then includes this archive.
3507c478bd9Sstevel@tonic-gate#
351ae115bc7SmrjIPCTF		= $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a
3527c478bd9Sstevel@tonic-gate
35302e56f3fSwesolows#
35402e56f3fSwesolows# Rule for building fake shared libraries used for symbol resolution
35502e56f3fSwesolows# when building other modules.  -znoreloc is needed here to avoid
35602e56f3fSwesolows# tripping over code that isn't really suitable for shared libraries.
35702e56f3fSwesolows#
35802e56f3fSwesolowsBUILD.SO		= \
35902e56f3fSwesolows	$(LD) -o $@ $(GSHARED) $(ZNORELOC) -h $(SONAME)
36002e56f3fSwesolows
36102e56f3fSwesolows#
36202e56f3fSwesolows# SONAME defaults for common fake shared libraries.
36302e56f3fSwesolows#
36402e56f3fSwesolows$(LIBGEN)		:= SONAME = $(MODULE)
36502e56f3fSwesolows$(PLATLIB)		:= SONAME = misc/platmod
36602e56f3fSwesolows$(CPULIB)		:= SONAME = 'cpu/$$CPU'
36702e56f3fSwesolows$(DTRACESTUBS)		:= SONAME = dtracestubs
36802e56f3fSwesolows
3697c478bd9Sstevel@tonic-gate#
3707c478bd9Sstevel@tonic-gate#	Installation directories
3717c478bd9Sstevel@tonic-gate#
3727c478bd9Sstevel@tonic-gate
3737c478bd9Sstevel@tonic-gate#
3747c478bd9Sstevel@tonic-gate#	For now, 64b modules install into a subdirectory
3757c478bd9Sstevel@tonic-gate#	of their 32b brethren.
3767c478bd9Sstevel@tonic-gate#
3777c478bd9Sstevel@tonic-gateSUBDIR64_sparc		= sparcv9
3787c478bd9Sstevel@tonic-gateSUBDIR64_i386		= amd64
3797c478bd9Sstevel@tonic-gateSUBDIR64		= $(SUBDIR64_$(MACH))
3807c478bd9Sstevel@tonic-gate
3817c478bd9Sstevel@tonic-gateROOT_MOD_DIR		= $(ROOT)/kernel
3827c478bd9Sstevel@tonic-gate
3837c478bd9Sstevel@tonic-gateROOT_KERN_DIR_32	= $(ROOT_MOD_DIR)
3849acbbeafSnnROOT_BRAND_DIR_32	= $(ROOT_MOD_DIR)/brand
3857c478bd9Sstevel@tonic-gateROOT_DRV_DIR_32		= $(ROOT_MOD_DIR)/drv
3867c478bd9Sstevel@tonic-gateROOT_DTRACE_DIR_32	= $(ROOT_MOD_DIR)/dtrace
3877c478bd9Sstevel@tonic-gateROOT_EXEC_DIR_32	= $(ROOT_MOD_DIR)/exec
3887c478bd9Sstevel@tonic-gateROOT_FS_DIR_32		= $(ROOT_MOD_DIR)/fs
3897c478bd9Sstevel@tonic-gateROOT_SCHED_DIR_32	= $(ROOT_MOD_DIR)/sched
3900f1702c5SYu XiangningROOT_SOCK_DIR_32	= $(ROOT_MOD_DIR)/socketmod
3917c478bd9Sstevel@tonic-gateROOT_STRMOD_DIR_32	= $(ROOT_MOD_DIR)/strmod
3927c478bd9Sstevel@tonic-gateROOT_IPP_DIR_32		= $(ROOT_MOD_DIR)/ipp
3937c478bd9Sstevel@tonic-gateROOT_SYS_DIR_32		= $(ROOT_MOD_DIR)/sys
3947c478bd9Sstevel@tonic-gateROOT_MISC_DIR_32	= $(ROOT_MOD_DIR)/misc
3957c478bd9Sstevel@tonic-gateROOT_KGSS_DIR_32	= $(ROOT_MOD_DIR)/misc/kgss
3961e1ddd6cScthROOT_SCSI_VHCI_DIR_32	= $(ROOT_MOD_DIR)/misc/scsi_vhci
3972fd415f4SDavid HollisterROOT_PMCS_FW_DIR_32	= $(ROOT_MOD_DIR)/misc/pmcs
398fcf3ce44SJohn ForteROOT_QLC_FW_DIR_32	= $(ROOT_MOD_DIR)/misc/qlc
399291a2b48SSukumar SwaminathanROOT_EMLXS_FW_DIR_32	= $(ROOT_MOD_DIR)/misc/emlxs
4007c478bd9Sstevel@tonic-gateROOT_NLMISC_DIR_32	= $(ROOT_MOD_DIR)/misc
4017c478bd9Sstevel@tonic-gateROOT_MACH_DIR_32	= $(ROOT_MOD_DIR)/mach
4027c478bd9Sstevel@tonic-gateROOT_CPU_DIR_32		= $(ROOT_MOD_DIR)/cpu
4037c478bd9Sstevel@tonic-gateROOT_TOD_DIR_32		= $(ROOT_MOD_DIR)/tod
4047c478bd9Sstevel@tonic-gateROOT_FONT_DIR_32	= $(ROOT_MOD_DIR)/fonts
4057c478bd9Sstevel@tonic-gateROOT_DACF_DIR_32	= $(ROOT_MOD_DIR)/dacf
4067c478bd9Sstevel@tonic-gateROOT_CRYPTO_DIR_32	= $(ROOT_MOD_DIR)/crypto
407ba2e4443SsebROOT_MAC_DIR_32		= $(ROOT_MOD_DIR)/mac
408d14d7d31SisROOT_KICONV_DIR_32	= $(ROOT_MOD_DIR)/kiconv
4097c478bd9Sstevel@tonic-gate
4107c478bd9Sstevel@tonic-gateROOT_KERN_DIR_64	= $(ROOT_MOD_DIR)/$(SUBDIR64)
4119acbbeafSnnROOT_BRAND_DIR_64	= $(ROOT_MOD_DIR)/brand/$(SUBDIR64)
4127c478bd9Sstevel@tonic-gateROOT_DRV_DIR_64		= $(ROOT_MOD_DIR)/drv/$(SUBDIR64)
4137c478bd9Sstevel@tonic-gateROOT_DTRACE_DIR_64	= $(ROOT_MOD_DIR)/dtrace/$(SUBDIR64)
4147c478bd9Sstevel@tonic-gateROOT_EXEC_DIR_64	= $(ROOT_MOD_DIR)/exec/$(SUBDIR64)
4157c478bd9Sstevel@tonic-gateROOT_FS_DIR_64		= $(ROOT_MOD_DIR)/fs/$(SUBDIR64)
4167c478bd9Sstevel@tonic-gateROOT_SCHED_DIR_64	= $(ROOT_MOD_DIR)/sched/$(SUBDIR64)
4170f1702c5SYu XiangningROOT_SOCK_DIR_64	= $(ROOT_MOD_DIR)/socketmod/$(SUBDIR64)
4187c478bd9Sstevel@tonic-gateROOT_STRMOD_DIR_64	= $(ROOT_MOD_DIR)/strmod/$(SUBDIR64)
4197c478bd9Sstevel@tonic-gateROOT_IPP_DIR_64		= $(ROOT_MOD_DIR)/ipp/$(SUBDIR64)
4207c478bd9Sstevel@tonic-gateROOT_SYS_DIR_64		= $(ROOT_MOD_DIR)/sys/$(SUBDIR64)
4217c478bd9Sstevel@tonic-gateROOT_MISC_DIR_64	= $(ROOT_MOD_DIR)/misc/$(SUBDIR64)
4227c478bd9Sstevel@tonic-gateROOT_KGSS_DIR_64	= $(ROOT_MOD_DIR)/misc/kgss/$(SUBDIR64)
4231e1ddd6cScthROOT_SCSI_VHCI_DIR_64	= $(ROOT_MOD_DIR)/misc/scsi_vhci/$(SUBDIR64)
4242fd415f4SDavid HollisterROOT_PMCS_FW_DIR_64	= $(ROOT_MOD_DIR)/misc/pmcs/$(SUBDIR64)
425fcf3ce44SJohn ForteROOT_QLC_FW_DIR_64	= $(ROOT_MOD_DIR)/misc/qlc/$(SUBDIR64)
426291a2b48SSukumar SwaminathanROOT_EMLXS_FW_DIR_64	= $(ROOT_MOD_DIR)/misc/emlxs/$(SUBDIR64)
4277c478bd9Sstevel@tonic-gateROOT_NLMISC_DIR_64	= $(ROOT_MOD_DIR)/misc/$(SUBDIR64)
4287c478bd9Sstevel@tonic-gateROOT_MACH_DIR_64	= $(ROOT_MOD_DIR)/mach/$(SUBDIR64)
4297c478bd9Sstevel@tonic-gateROOT_CPU_DIR_64		= $(ROOT_MOD_DIR)/cpu/$(SUBDIR64)
4307c478bd9Sstevel@tonic-gateROOT_TOD_DIR_64		= $(ROOT_MOD_DIR)/tod/$(SUBDIR64)
4317c478bd9Sstevel@tonic-gateROOT_FONT_DIR_64	= $(ROOT_MOD_DIR)/fonts/$(SUBDIR64)
4327c478bd9Sstevel@tonic-gateROOT_DACF_DIR_64	= $(ROOT_MOD_DIR)/dacf/$(SUBDIR64)
4337c478bd9Sstevel@tonic-gateROOT_CRYPTO_DIR_64	= $(ROOT_MOD_DIR)/crypto/$(SUBDIR64)
434ba2e4443SsebROOT_MAC_DIR_64		= $(ROOT_MOD_DIR)/mac/$(SUBDIR64)
435d14d7d31SisROOT_KICONV_DIR_64	= $(ROOT_MOD_DIR)/kiconv/$(SUBDIR64)
4367c478bd9Sstevel@tonic-gate
4377c478bd9Sstevel@tonic-gateROOT_KERN_DIR		= $(ROOT_KERN_DIR_$(CLASS))
4389acbbeafSnnROOT_BRAND_DIR		= $(ROOT_BRAND_DIR_$(CLASS))
4397c478bd9Sstevel@tonic-gateROOT_DRV_DIR		= $(ROOT_DRV_DIR_$(CLASS))
4407c478bd9Sstevel@tonic-gateROOT_DTRACE_DIR		= $(ROOT_DTRACE_DIR_$(CLASS))
4417c478bd9Sstevel@tonic-gateROOT_EXEC_DIR		= $(ROOT_EXEC_DIR_$(CLASS))
4427c478bd9Sstevel@tonic-gateROOT_FS_DIR		= $(ROOT_FS_DIR_$(CLASS))
4437c478bd9Sstevel@tonic-gateROOT_SCHED_DIR		= $(ROOT_SCHED_DIR_$(CLASS))
4440f1702c5SYu XiangningROOT_SOCK_DIR		= $(ROOT_SOCK_DIR_$(CLASS))
4457c478bd9Sstevel@tonic-gateROOT_STRMOD_DIR		= $(ROOT_STRMOD_DIR_$(CLASS))
4467c478bd9Sstevel@tonic-gateROOT_IPP_DIR		= $(ROOT_IPP_DIR_$(CLASS))
4477c478bd9Sstevel@tonic-gateROOT_SYS_DIR		= $(ROOT_SYS_DIR_$(CLASS))
4487c478bd9Sstevel@tonic-gateROOT_MISC_DIR		= $(ROOT_MISC_DIR_$(CLASS))
4497c478bd9Sstevel@tonic-gateROOT_KGSS_DIR		= $(ROOT_KGSS_DIR_$(CLASS))
4501e1ddd6cScthROOT_SCSI_VHCI_DIR	= $(ROOT_SCSI_VHCI_DIR_$(CLASS))
4512fd415f4SDavid HollisterROOT_PMCS_FW_DIR	= $(ROOT_PMCS_FW_DIR_$(CLASS))
452fcf3ce44SJohn ForteROOT_QLC_FW_DIR		= $(ROOT_QLC_FW_DIR_$(CLASS))
453291a2b48SSukumar SwaminathanROOT_EMLXS_FW_DIR	= $(ROOT_EMLXS_FW_DIR_$(CLASS))
4547c478bd9Sstevel@tonic-gateROOT_NLMISC_DIR		= $(ROOT_NLMISC_DIR_$(CLASS))
4557c478bd9Sstevel@tonic-gateROOT_MACH_DIR		= $(ROOT_MACH_DIR_$(CLASS))
4567c478bd9Sstevel@tonic-gateROOT_CPU_DIR		= $(ROOT_CPU_DIR_$(CLASS))
4577c478bd9Sstevel@tonic-gateROOT_TOD_DIR		= $(ROOT_TOD_DIR_$(CLASS))
4587c478bd9Sstevel@tonic-gateROOT_FONT_DIR		= $(ROOT_FONT_DIR_$(CLASS))
4597c478bd9Sstevel@tonic-gateROOT_DACF_DIR		= $(ROOT_DACF_DIR_$(CLASS))
4607c478bd9Sstevel@tonic-gateROOT_CRYPTO_DIR		= $(ROOT_CRYPTO_DIR_$(CLASS))
461ba2e4443SsebROOT_MAC_DIR		= $(ROOT_MAC_DIR_$(CLASS))
462d14d7d31SisROOT_KICONV_DIR		= $(ROOT_KICONV_DIR_$(CLASS))
463f73e0305SHans RosenfeldROOT_FIRMWARE_DIR	= $(ROOT_MOD_DIR)/firmware
4647c478bd9Sstevel@tonic-gate
4659acbbeafSnnROOT_MOD_DIRS_32	= $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32)
4669acbbeafSnnROOT_MOD_DIRS_32	= $(ROOT_BRAND_DIR_32) $(ROOT_DRV_DIR_32)
4679acbbeafSnnROOT_MOD_DIRS_32	+= $(ROOT_EXEC_DIR_32) $(ROOT_DTRACE_DIR_32)
4687c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_FS_DIR_32) $(ROOT_SCHED_DIR_32)
4697c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_STRMOD_DIR_32) $(ROOT_SYS_DIR_32)
4700f1702c5SYu XiangningROOT_MOD_DIRS_32	+= $(ROOT_IPP_DIR_32) $(ROOT_SOCK_DIR_32)
4717c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_MISC_DIR_32) $(ROOT_MACH_DIR_32)
4727c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_KGSS_DIR_32)
4731e1ddd6cScthROOT_MOD_DIRS_32	+= $(ROOT_SCSI_VHCI_DIR_32)
4742fd415f4SDavid HollisterROOT_MOD_DIRS_32	+= $(ROOT_PMCS_FW_DIR_32)
475fcf3ce44SJohn ForteROOT_MOD_DIRS_32        += $(ROOT_QLC_FW_DIR_32)
476291a2b48SSukumar SwaminathanROOT_MOD_DIRS_32        += $(ROOT_EMLXS_FW_DIR_32)
4777c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_CPU_DIR_32) $(ROOT_FONT_DIR_32)
4787c478bd9Sstevel@tonic-gateROOT_MOD_DIRS_32	+= $(ROOT_TOD_DIR_32) $(ROOT_DACF_DIR_32)
479ba2e4443SsebROOT_MOD_DIRS_32	+= $(ROOT_CRYPTO_DIR_32) $(ROOT_MAC_DIR_32)
4803c5e027bSEric TaylorROOT_MOD_DIRS_32	+= $(ROOT_KICONV_DIR_32)
481f73e0305SHans RosenfeldROOT_MOD_DIRS_32	+= $(ROOT_FIRMWARE_DIR)
4827c478bd9Sstevel@tonic-gate
4837c478bd9Sstevel@tonic-gateUSR_MOD_DIR		= $(ROOT)/usr/kernel
4847c478bd9Sstevel@tonic-gate
4857c478bd9Sstevel@tonic-gateUSR_DRV_DIR_32		= $(USR_MOD_DIR)/drv
4867c478bd9Sstevel@tonic-gateUSR_EXEC_DIR_32		= $(USR_MOD_DIR)/exec
4877c478bd9Sstevel@tonic-gateUSR_FS_DIR_32		= $(USR_MOD_DIR)/fs
4887c478bd9Sstevel@tonic-gateUSR_SCHED_DIR_32	= $(USR_MOD_DIR)/sched
4890f1702c5SYu XiangningUSR_SOCK_DIR_32		= $(USR_MOD_DIR)/socketmod
4907c478bd9Sstevel@tonic-gateUSR_STRMOD_DIR_32	= $(USR_MOD_DIR)/strmod
4917c478bd9Sstevel@tonic-gateUSR_SYS_DIR_32		= $(USR_MOD_DIR)/sys
4927c478bd9Sstevel@tonic-gateUSR_MISC_DIR_32		= $(USR_MOD_DIR)/misc
4937c478bd9Sstevel@tonic-gateUSR_DACF_DIR_32		= $(USR_MOD_DIR)/dacf
4947c478bd9Sstevel@tonic-gateUSR_PCBE_DIR_32		= $(USR_MOD_DIR)/pcbe
4959a9ae70fSjvUSR_DTRACE_DIR_32	= $(USR_MOD_DIR)/dtrace
4969a9ae70fSjvUSR_BRAND_DIR_32	= $(USR_MOD_DIR)/brand
4977c478bd9Sstevel@tonic-gate
4987c478bd9Sstevel@tonic-gateUSR_DRV_DIR_64		= $(USR_MOD_DIR)/drv/$(SUBDIR64)
4997c478bd9Sstevel@tonic-gateUSR_EXEC_DIR_64		= $(USR_MOD_DIR)/exec/$(SUBDIR64)
5007c478bd9Sstevel@tonic-gateUSR_FS_DIR_64		= $(USR_MOD_DIR)/fs/$(SUBDIR64)
5017c478bd9Sstevel@tonic-gateUSR_SCHED_DIR_64	= $(USR_MOD_DIR)/sched/$(SUBDIR64)
5020f1702c5SYu XiangningUSR_SOCK_DIR_64		= $(USR_MOD_DIR)/socketmod/$(SUBDIR64)
5037c478bd9Sstevel@tonic-gateUSR_STRMOD_DIR_64	= $(USR_MOD_DIR)/strmod/$(SUBDIR64)
5047c478bd9Sstevel@tonic-gateUSR_SYS_DIR_64		= $(USR_MOD_DIR)/sys/$(SUBDIR64)
5057c478bd9Sstevel@tonic-gateUSR_MISC_DIR_64		= $(USR_MOD_DIR)/misc/$(SUBDIR64)
5067c478bd9Sstevel@tonic-gateUSR_DACF_DIR_64		= $(USR_MOD_DIR)/dacf/$(SUBDIR64)
5077c478bd9Sstevel@tonic-gateUSR_PCBE_DIR_64		= $(USR_MOD_DIR)/pcbe/$(SUBDIR64)
5089a9ae70fSjvUSR_DTRACE_DIR_64	= $(USR_MOD_DIR)/dtrace/$(SUBDIR64)
5099a9ae70fSjvUSR_BRAND_DIR_64	= $(USR_MOD_DIR)/brand/$(SUBDIR64)
5107c478bd9Sstevel@tonic-gate
5117c478bd9Sstevel@tonic-gateUSR_DRV_DIR		= $(USR_DRV_DIR_$(CLASS))
5127c478bd9Sstevel@tonic-gateUSR_EXEC_DIR		= $(USR_EXEC_DIR_$(CLASS))
5137c478bd9Sstevel@tonic-gateUSR_FS_DIR		= $(USR_FS_DIR_$(CLASS))
5147c478bd9Sstevel@tonic-gateUSR_SCHED_DIR		= $(USR_SCHED_DIR_$(CLASS))
5150f1702c5SYu XiangningUSR_SOCK_DIR		= $(USR_SOCK_DIR_$(CLASS))
5167c478bd9Sstevel@tonic-gateUSR_STRMOD_DIR		= $(USR_STRMOD_DIR_$(CLASS))
5177c478bd9Sstevel@tonic-gateUSR_SYS_DIR		= $(USR_SYS_DIR_$(CLASS))
5187c478bd9Sstevel@tonic-gateUSR_MISC_DIR		= $(USR_MISC_DIR_$(CLASS))
5197c478bd9Sstevel@tonic-gateUSR_DACF_DIR		= $(USR_DACF_DIR_$(CLASS))
5207c478bd9Sstevel@tonic-gateUSR_PCBE_DIR		= $(USR_PCBE_DIR_$(CLASS))
5219a9ae70fSjvUSR_DTRACE_DIR		= $(USR_DTRACE_DIR_$(CLASS))
5229a9ae70fSjvUSR_BRAND_DIR		= $(USR_BRAND_DIR_$(CLASS))
5237c478bd9Sstevel@tonic-gate
5247c478bd9Sstevel@tonic-gateUSR_MOD_DIRS_32		= $(USR_DRV_DIR_32) $(USR_EXEC_DIR_32)
5257c478bd9Sstevel@tonic-gateUSR_MOD_DIRS_32		+= $(USR_FS_DIR_32) $(USR_SCHED_DIR_32)
5267c478bd9Sstevel@tonic-gateUSR_MOD_DIRS_32		+= $(USR_STRMOD_DIR_32) $(USR_SYS_DIR_32)
5277c478bd9Sstevel@tonic-gateUSR_MOD_DIRS_32		+= $(USR_MISC_DIR_32) $(USR_DACF_DIR_32)
5283c5e027bSEric TaylorUSR_MOD_DIRS_32		+= $(USR_PCBE_DIR_32)
5299a9ae70fSjvUSR_MOD_DIRS_32		+= $(USR_DTRACE_DIR_32) $(USR_BRAND_DIR_32)
5300a0e9771SDarren ReedUSR_MOD_DIRS_32		+= $(USR_SOCK_DIR_32)
5317c478bd9Sstevel@tonic-gate
5327c478bd9Sstevel@tonic-gate#
5337c478bd9Sstevel@tonic-gate#
5347c478bd9Sstevel@tonic-gate#
5357c478bd9Sstevel@tonic-gateinclude $(SRC)/Makefile.psm
5367c478bd9Sstevel@tonic-gate
5377c478bd9Sstevel@tonic-gate#
5387c478bd9Sstevel@tonic-gate#	The "-r" on the remove may be considered temporary, but is required
5397c478bd9Sstevel@tonic-gate#	while the replacement of the SUNW,SPARCstation-10,SX directory by
5407c478bd9Sstevel@tonic-gate#	a symbolic link is being propagated.
5417c478bd9Sstevel@tonic-gate#
54224fe0b3bSjmcpINS.slink1= $(RM) -r $@; $(SYMLINK) $(PLATFORM) $@
54324fe0b3bSjmcpINS.slink2= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/$(@F) $@
54424fe0b3bSjmcpINS.slink3= $(RM) -r $@; $(SYMLINK) $(IMPLEMENTED_PLATFORM) $@
54524fe0b3bSjmcpINS.slink4= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/include $@
54624fe0b3bSjmcpINS.slink5= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/sbin $@
54724fe0b3bSjmcpINS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
54824fe0b3bSjmcpINS.slink7= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/$(@F) $@
5497c478bd9Sstevel@tonic-gate
5507c478bd9Sstevel@tonic-gateROOT_PLAT_LINKS		 = $(PLAT_LINKS:%=$(ROOT_PLAT_DIR)/%)
5517c478bd9Sstevel@tonic-gateROOT_PLAT_LINKS_2	 = $(PLAT_LINKS_2:%=$(ROOT_PLAT_DIR)/%)
5527c478bd9Sstevel@tonic-gateUSR_PLAT_LINKS		 = $(PLAT_LINKS:%=$(USR_PLAT_DIR)/%)
5537c478bd9Sstevel@tonic-gateUSR_PLAT_LINKS_2	 = $(PLAT_LINKS_2:%=$(USR_PLAT_DIR)/%)
5547c478bd9Sstevel@tonic-gate
5557c478bd9Sstevel@tonic-gate#
556ae115bc7Smrj# Collection of all relevant, delivered kernel modules.
557ae115bc7Smrj#
558ae115bc7Smrj# Note that we insist on building genunix first, because everything else
559ae115bc7Smrj# uniquifies against it.  When doing a 'make' from usr/src/uts/, we'll enter
560ae115bc7Smrj# the platform directories first.  These will cd into the corresponding genunix
561ae115bc7Smrj# directory and build it.  So genunix /shouldn't/ get rebuilt when we get to
562ae115bc7Smrj# building all the kernel modules.  However, due to an as-yet-unexplained
563ae115bc7Smrj# problem with dependencies, sometimes it does get rebuilt, which then messes
564ae115bc7Smrj# up the other modules.  So we always force the issue here rather than try to
565ae115bc7Smrj# build genunix in parallel with everything else.
5667c478bd9Sstevel@tonic-gate#
567ae115bc7SmrjPARALLEL_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \
568ae115bc7Smrj		 $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \
569ae115bc7Smrj		 $(NLMISC_KMODS) $(MACH_KMODS) $(CPU_KMODS) $(GSS_KMODS) \
570ae115bc7Smrj		 $(MMU_KMODS) $(DACF_KMODS) $(EXPORT_KMODS) $(IPP_KMODS) \
571b6c3f786Sbubbva		 $(CRYPTO_KMODS) $(PCBE_KMODS) \
572ae115bc7Smrj		 $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS)) $(MAC_KMODS) \
5733c5e027bSEric Taylor		 $(BRAND_KMODS) $(KICONV_KMODS) \
5740f1702c5SYu Xiangning		 $(SOCKET_KMODS)
575ae115bc7Smrj
576ae115bc7SmrjKMODS = $(GENUNIX_KMODS) $(PARALLEL_KMODS)
577ae115bc7Smrj
578ae115bc7Smrj$(PARALLEL_KMODS): $(GENUNIX_KMODS)
5797c478bd9Sstevel@tonic-gate
5807c478bd9Sstevel@tonic-gateLINT_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \
5817c478bd9Sstevel@tonic-gate	  $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \
5827c478bd9Sstevel@tonic-gate	  $(MACH_KMODS) $(GSS_KMODS) $(DACF_KMODS) $(IPP_KMODS) \
5833c5e027bSEric Taylor	  $(CRYPTO_KMODS) $(PCBE_KMODS) \
5844a75c0c1Sedp	  $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS)) $(MAC_KMODS) \
5850f1702c5SYu Xiangning	  $(BRAND_KMODS) $(KICONV_KMODS) $(SOCKET_KMODS)
5867c478bd9Sstevel@tonic-gate
5877c478bd9Sstevel@tonic-gate#
5887c478bd9Sstevel@tonic-gate#	Files to be compiled with -xa, to generate basic block execution
5897c478bd9Sstevel@tonic-gate#	count data.
5907c478bd9Sstevel@tonic-gate#
5917c478bd9Sstevel@tonic-gate#	There are several ways to compile parts of the kernel for kcov:
5927c478bd9Sstevel@tonic-gate#               1)  Add targets to BB_FILES here or in other Makefiles
5937c478bd9Sstevel@tonic-gate#                       (they must in the form of $(OBJS_DIR)/target.o)
5947c478bd9Sstevel@tonic-gate#               2)  setenv BB_FILES '$(XXX_OBJS:%=$(OBJS_DIR)/%)'
5957c478bd9Sstevel@tonic-gate#               3)  setenv BB_FILES '$(OBJECTS)'
5967c478bd9Sstevel@tonic-gate#
5977c478bd9Sstevel@tonic-gate#       Do NOT setenv CFLAGS -xa, as that will cause infinite recursion
5987c478bd9Sstevel@tonic-gate#       in unix_bb.o
5997c478bd9Sstevel@tonic-gate#
6007c478bd9Sstevel@tonic-gateBB_FILES =
6017c478bd9Sstevel@tonic-gate$(BB_FILES)	:= XAOPT = -xa
6027c478bd9Sstevel@tonic-gate
6037c478bd9Sstevel@tonic-gate#
6047c478bd9Sstevel@tonic-gate#	The idea here is for unix_bb.o to be in all kernels except the
6057c478bd9Sstevel@tonic-gate#	kernel which actually gets shipped to customers.  In practice,
6067c478bd9Sstevel@tonic-gate#	$(RELEASE_BUILD) is on for a number of the late beta and fcs builds.
6077c478bd9Sstevel@tonic-gate#
608ea76c26cSAndy Stormont$(NOT_RELEASE_BUILD)$(OBJS_DIR)/unix_bb.o   := CPPFLAGS     += -DKCOV
609ea76c26cSAndy Stormont$(NOT_RELEASE_BUILD)$(OBJS_DIR)/unix_bb.ln  := CPPFLAGS     += -DKCOV
6107c478bd9Sstevel@tonic-gate
6117c478bd9Sstevel@tonic-gate#
6127c478bd9Sstevel@tonic-gate#	Do not let unix_bb.o get compiled with -xa!
6137c478bd9Sstevel@tonic-gate#
6147c478bd9Sstevel@tonic-gate$(OBJS_DIR)/unix_bb.o	:= XAOPT =
6157c478bd9Sstevel@tonic-gate
6167c478bd9Sstevel@tonic-gate#
6177c478bd9Sstevel@tonic-gate# Privilege files
6187c478bd9Sstevel@tonic-gate#
6197c478bd9Sstevel@tonic-gatePRIVS_AWK = $(SRC)/uts/common/os/privs.awk
6207c478bd9Sstevel@tonic-gatePRIVS_DEF = $(SRC)/uts/common/os/priv_defs
621de81e71eSTim Marsland
622de81e71eSTim Marsland#
623de81e71eSTim Marsland# USB device data
624de81e71eSTim Marsland#
625de81e71eSTim MarslandUSBDEVS_AWK =	$(SRC)/uts/common/io/usb/usbdevs2h.awk
626de81e71eSTim MarslandUSBDEVS_DATA =	$(SRC)/uts/common/io/usb/usbdevs
627