xref: /titanic_52/usr/src/uts/Makefile.uts (revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This Makefile contains the common targets and definitions for
29#	all kernels. It is to be included in the Makefiles for specific
30#	implementation architectures and processor architecture dependent
31#	modules: i.e.: all driving kernel Makefiles.
32#
33#	Include global definitions:
34#
35include $(SRC)/Makefile.master
36
37#
38#	No text domain in the kernel.
39#
40DTEXTDOM =
41
42#
43# 	Keep references to $(SRC)/common relative.
44COMMONBASE=	$(UTSBASE)/../common
45
46#
47#	Setup build-specific vars
48#	To add a build type:
49#		add name to ALL_BUILDS32 & ALL_BUILDS64
50#		set CLASS_name and OBJ_DIR_name
51#		add targets to Makefile.targ
52#
53
54#
55#	DEF_BUILDS is for def, lint and install
56#	ALL_BUILDS is for everything else (all, clean, ...)
57#
58# The NOT_RELEASE_BUILD noise is to maintain compatibility with the
59# gatekeeper's nightly build script.
60#
61DEF_BUILDS32				= obj32
62DEF_BUILDS64				= obj64
63DEF_BUILDSONLY64			= obj64
64$(NOT_RELEASE_BUILD)DEF_BUILDS32	= debug32
65$(NOT_RELEASE_BUILD)DEF_BUILDS64	= debug64
66$(NOT_RELEASE_BUILD)DEF_BUILDSONLY64	= debug64
67ALL_BUILDS32				= obj32 debug32
68ALL_BUILDS64				= obj64 debug64
69ALL_BUILDSONLY64			= obj64 debug64
70
71#
72#	For modules in 64b dirs that aren't built 64b
73#	or modules in 64b dirs that aren't built 32b we
74#	need to create empty modlintlib files so global lint works
75#
76LINT32_BUILDS	= debug32
77LINT64_BUILDS	= debug64
78
79#
80#	Build class (32b or 64b)
81#
82CLASS_OBJ32	= 32
83CLASS_DBG32	= 32
84CLASS_OBJ64	= 64
85CLASS_DBG64	= 64
86CLASS		= $(CLASS_$(BUILD_TYPE))
87
88#
89#	Build subdirectory
90#
91OBJS_DIR_OBJ32	= obj32
92OBJS_DIR_DBG32	= debug32
93OBJS_DIR_OBJ64	= obj64
94OBJS_DIR_DBG64	= debug64
95OBJS_DIR	= $(OBJS_DIR_$(BUILD_TYPE))
96
97#
98#	Create defaults so empty rules don't
99#	confuse make
100#
101CLASS_		= 32
102OBJS_DIR_	= debug32
103
104#
105#	Build tools
106#
107CC_sparc_32	= $(sparc_CC)
108CC_sparc_64	= $(sparcv9_CC)
109
110CC_i386_32	= $(i386_CC)
111CC_i386_64	= $(amd64_CC)
112CC_amd64_64	= $(amd64_CC)
113
114CC		= $(CC_$(MACH)_$(CLASS))
115
116AS_sparc_32	= $(sparc_AS)
117AS_sparc_64	= $(sparcv9_AS)
118
119AS_i386_32	= $(i386_AS)
120AS_i386_64	= $(amd64_AS)
121AS_amd64_64	= $(amd64_AS)
122
123AS		= $(AS_$(MACH)_$(CLASS))
124
125LD_sparc_32	= $(sparc_LD)
126LD_sparc_64	= $(sparcv9_LD)
127
128LD_i386_32	= $(i386_LD)
129LD_i386_64	= $(amd64_LD)
130LD_amd64_64	= $(amd64_LD)
131
132LD		= $(LD_$(MACH)_$(CLASS))
133
134LINT_sparc_32	= $(sparc_LINT)
135LINT_sparc_64	= $(sparcv9_LINT)
136
137LINT_i386_32	= $(i386_LINT)
138LINT_i386_64	= $(amd64_LINT)
139LINT_amd64_64	= $(amd64_LINT)
140
141LINT		= $(LINT_$(MACH)_$(CLASS))
142
143MODEL_32	= ilp32
144MODEL_64	= lp64
145MODEL		= $(MODEL_$(CLASS))
146
147#
148#	Build rules for linting the kernel.
149#
150LHEAD =	( $(ECHO) "\n$@";
151
152LGREP.2 =	grep -v ' _init ' | \
153		grep -v ' _fini ' | \
154		grep -v ' _info ' | \
155		grep -v ' _depends_on ' | \
156		cat
157
158LTAIL =	)
159
160LINT.c =	$(LINT) -c -dirout=$(LINTS_DIR) $(LINTFLAGS) $(LINT_DEFS) $(CPPFLAGS)
161
162LINTTAGS_32	=
163LINTTAGS_32	+= -erroff=E_BAD_PTR_CAST_ALIGN
164LINTTAGS_32	+= -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
165LINTTAGS_32	+= -erroff=E_SUSPICIOUS_COMPARISON
166LINTTAGS_32	+= -erroff=E_CAST_UINT_TO_SIGNED_INT
167LINTTAGS_32	+= -erroff=E_PASS_UINT_TO_SIGNED_INT
168LINTTAGS_32	+= -erroff=E_INVALID_ANNOTATION_NAME
169LINTTAGS_32	+= -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE
170LINTTAGS_32	+= -erroff=E_NO_EXPLICIT_TYPE_GIVEN
171LINTTAGS_32	+= -erroff=E_STATIC_UNUSED
172LINTTAGS_32	+= -erroff=E_PTRDIFF_OVERFLOW
173LINTTAGS_32	+= -erroff=E_ASSIGN_NARROW_CONV
174
175LINTTAGS_64	= $(LINTTAGS_32)
176
177# Selectively disable certain noisy lint errors
178LENIENT_LINTTAGS =
179LENIENT_LINTTAGS += -erroff=E_CAST_INT_TO_SMALL_INT
180LENIENT_LINTTAGS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
181LENIENT_LINTTAGS += -erroff=E_CAST_TO_PTR_FROM_INT
182LENIENT_LINTTAGS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
183LENIENT_LINTTAGS += -erroff=E_ASSIGN_INT_FROM_BIG_CONST
184LENIENT_LINTTAGS += -erroff=E_CONST_PROMOTED_UNSIGNED_LL
185LENIENT_LINTTAGS += -erroff=E_CONST_PROMOTED_LONG_LONG
186LENIENT_LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN
187LENIENT_LINTTAGS += -erroff=E_PASS_INT_FROM_BIG_CONST
188LENIENT_LINTTAGS += -erroff=E_COMP_INT_WITH_LARGE_INT
189LENIENT_LINTTAGS += -erroff=E_ASSIGN_UINT_TO_SIGNED_INT
190# These are still noisy but a bit more useful.
191# They shouldn't be used on new code.
192LENIENT_LINTTAGS += -erroff=E_PASS_INT_TO_SMALL_INT
193LENIENT_LINTTAGS += -erroff=E_PTR_CONV_LOSES_BITS
194
195# comment out next line to turn on pedantic 64-bit error checking
196LINTTAGS_64	+= $(LENIENT_LINTTAGS)
197
198LENIENT_i386_LINTTAGS	=
199
200LENIENT_amd64_LINTTAGS	=
201LENIENT_amd64_LINTTAGS	+= -erroff=E_BAD_PRAGMA_PACK_VALUE
202LENIENT_amd64_LINTTAGS	+= -erroff=E_SHIFT_CNT_NEG_TOO_BIG_L
203LENIENT_amd64_LINTTAGS	+= -erroff=E_CONST_PROMOTED_UNSIGNED_LL
204LENIENT_amd64_LINTTAGS	+= -erroff=E_CONST_PROMOTED_LONG_LONG
205
206LINTFLAGS_sparc_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
207LINTFLAGS_sparc_64	= $(LINTFLAGS_sparc_32) -Xarch=v9
208LINTFLAGS_i386_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
209LINTFLAGS_i386_64	= $(LINTFLAGS_i386_32) -Xarch=amd64
210
211LINTTAGS_sparc_32	= $(LINTTAGS_32)
212LINTTAGS_sparc_64	= $(LINTTAGS_64)
213LINTTAGS_i386_32	= $(LINTTAGS_32)
214LINTTAGS_i386_64	= $(LINTTAGS_64) $(LENIENT_amd64_LINTTAGS)
215
216LINTFLAGS	= $(LINTFLAGS_$(MACH)_$(CLASS)) $(LINTTAGS_$(MACH)_$(CLASS))
217LINTFLAGS	+= $(C99LMODE)
218
219#
220#	Override this variable to modify the name of the lint target.
221#
222LINT_MODULE=	$(MODULE)
223
224#
225#	Build the compile/assemble lines:
226#
227EXTRA_OPTIONS		=
228AS_DEFS			= -D_ASM -D__STDC__=0
229
230ALWAYS_DEFS_32		= -D_KERNEL -D_SYSCALL32
231ALWAYS_DEFS_64		= -D_KERNEL -D_SYSCALL32 -D_SYSCALL32_IMPL -D_ELF64
232#
233# XX64	This should be defined by the compiler!
234#
235ALWAYS_DEFS_64		+= -Dsun -D__sun -D__SVR4
236ALWAYS_DEFS		= $(ALWAYS_DEFS_$(CLASS))
237
238#
239#	CPPFLAGS is deliberatly set with a "=" and not a "+=".  For the kernel
240#	the header include path should not look for header files outside of
241#	the kernel code.  This "=" removes the search path built in
242#	Makefile.master inside CPPFLAGS.  Ditto for AS_CPPFLAGS.
243#
244CPPFLAGS	= $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) \
245		   $(INCLUDE_PATH) $(EXTRA_OPTIONS)
246ASFLAGS		+= -P
247AS_CPPFLAGS	= $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \
248		   $(AS_INC_PATH) $(EXTRA_OPTIONS)
249
250#
251#	Make it (relatively) easy to share compilation options between
252#	all kernel implementations.
253#
254
255#
256# XX64	Compiling with -xc99=%all on build 55 merge makes the
257#	kmem_alloc double map parts of the kernel data causing
258#	horrible overwriting and forces a hardware reset in
259#	segkp_create().  Until the origin of this problem can
260#	be tracked down (i.e. is it a deliberate C89 -> C99 semantic
261#	change for which the kernel needs repair, or is it just a
262#	bug in the x86 compiler?) disabling C99 for kernel compilation
263#	when using the Devpro compiler
264#
265i386_C99MODE		= $(C99_DISABLE)
266$(__GNUC)i386_C99MODE	= $(C99_ENABLE)
267sparc_C99MODE		= $(C99_DISABLE)
268C99MODE			= $($(MACH)_C99MODE)
269
270CFLAGS_uts		=
271CFLAGS_uts		+= $(STAND_FLAGS_$(CLASS))
272CFLAGS_uts		+= $(CCVERBOSE)
273CFLAGS_uts		+= $(ILDOFF)
274CFLAGS_uts		+= $(XAOPT)
275CFLAGS_uts		+= $(CTF_FLAGS)
276CFLAGS_uts		+= $(CERRWARN)
277CFLAGS_uts		+= $(C99MODE)
278CFLAGS_uts		+= $(EXTRA_CFLAGS)
279
280#
281#	Declare that $(OBJECTS) and $(LINTS) can be compiled in parallel.
282#	The DUMMY target is for those instances where OBJECTS and LINTS
283#	are empty (to avoid an unconditional .PARALLEL).
284.PARALLEL:	$(OBJECTS) $(LINTS) DUMMY
285
286#
287#	Expanded dependencies
288#
289DEF_DEPS	= $(DEF_BUILDS:%=def.%)
290ALL_DEPS	= $(ALL_BUILDS:%=all.%)
291CLEAN_DEPS	= $(ALL_BUILDS:%=clean.%)
292CLOBBER_DEPS	= $(ALL_BUILDS:%=clobber.%)
293LINT_DEPS	= $(DEF_BUILDS:%=lint.%)
294MODLINTLIB_DEPS	= $(DEF_BUILDS:%=modlintlib.%)
295CLEAN_LINT_DEPS	= $(ALL_BUILDS:%=clean.lint.%)
296INSTALL_DEPS	= $(DEF_BUILDS:%=install.%)
297SYM_DEPS	= $(SYM_BUILDS:%=symcheck.%)
298
299#
300#	Default module name
301#
302BINARY		= $(OBJS_DIR)/$(MODULE)
303
304#
305#	Default cleanup definitions
306#
307CLEANLINTFILES	= $(LINTS) $(MOD_LINT_LIB)
308CLEANFILES	= $(OBJECTS) $(CLEANLINTFILES)
309CLOBBERFILES	= $(BINARY) $(CLEANFILES)
310
311#
312#	Installation constants:
313#
314#		FILEMODE is the mode given to the kernel modules
315#		CFILEMODE is the mode given to the '.conf' files
316#
317FILEMODE	 = 755
318DIRMODE		 = 755
319OWNER		 = root
320GROUP		 = sys
321CFILEMODE	 = 644
322
323#
324#	Special Installation Macros for the installation of '.conf' files.
325#
326#	These are unique because they are not installed from the current
327#	working directory.
328#
329# Sigh.  Apparently at some time in the past there was a confusion on
330# whether the name is SRC_CONFFILE or SRC_CONFILE.  Consistency with the
331# other names would indicate SRC_CONFFILE, but the voting is >180 Makefiles
332# with SRC_CONFILE and about 11 with SRC_CONFFILE.  Software development
333# isn't a popularity contest, though, and so my inclination is to define
334# both names for now and incrementally convert to SRC_CONFFILE to be consistent
335# with the other names.
336#
337CONFFILE		= $(MODULE).conf
338SRC_CONFFILE		= $(CONF_SRCDIR)/$(CONFFILE)
339SRC_CONFILE		= $(SRC_CONFFILE)
340ROOT_CONFFILE_32	= $(ROOTMODULE).conf
341ROOT_CONFFILE_64	= $(ROOTMODULE:%/$(SUBDIR64)/$(MODULE)=%/$(MODULE)).conf
342ROOT_CONFFILE		= $(ROOT_CONFFILE_$(CLASS))
343
344
345INS.conffile= \
346	$(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE)
347$(CH)INS.conffile= \
348    $(INS) -s -m $(CFILEMODE) -u $(OWNER) -g $(GROUP) -f $(@D) $(SRC_CONFFILE)
349
350#
351# The CTF merge of child kernel modules is performed against one of the genunix
352# modules.  For Intel builds, all modules will be used with a single genunix:
353# the one built in intel/genunix.  For SPARC builds, a given
354# module may be
355# used with one of a number of genunix files, depending on what platform the
356# module is deployed on.  We merge against the sun4u genunix to optimize for
357# the common case.  We also merge against the ip driver since networking is
358# typically loaded and types defined therein are shared between many modules.
359#
360CTFMERGE_GUDIR_sparc	= sun4u
361CTFMERGE_GUDIR_i386	= intel
362CTFMERGE_GUDIR		= $(CTFMERGE_GUDIR_$(MACH))
363
364CTFMERGE_GENUNIX 	= \
365	$(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix
366
367#
368# Used to uniquify a non-genunix module against genunix.  If used in patch
369# mode (PATCH_BUILD != "#"), the patch ID corresponding to the module being
370# built will be used as the label.  If no ID is available, or if patch mode
371# is not being used, the value of $VERSION will be used.
372#
373CTFMERGE_UNIQUIFY_AGAINST_GENUNIX	= \
374	@label="-L VERSION" ; \
375	if [ -z "$(PATCH_BUILD)" ] ; then \
376		uniq="-D BASE" ; \
377		set -- `$(CTFFINDMOD) -n -r -t $(PMTMO_FILE) $@` ; \
378		if [ "X$$1" != "X-" ] ; then \
379			label="-l $$1" ; \
380			if [ "$$2" != "fcs" ] ; then \
381				uniq="-D $$2" ; \
382			fi ; \
383		fi ; \
384	fi ; \
385	mergecmd="$(CTFMERGE) $(CTFMRGFLAGS)" ; \
386	cmd="$$mergecmd $$label -d $(CTFMERGE_GENUNIX) $$uniq -o $@" ; \
387	echo $$cmd "$(OBJECTS) $(CTFEXTRAOBJS)" ; \
388	$$cmd $(OBJECTS) $(CTFEXTRAOBJS)
389
390#
391# Used to merge the genunix module.  genunix has special requirements in
392# patch mode.  In particular, it needs to be able to find the genunix used
393# in the previous version of the KU patch (or the FCS version of genunix in
394# the case of KU 1).
395#
396CTFMERGE_GENUNIX_MERGE		= \
397	@if [ -z "$(PATCH_BUILD)" ] ; then \
398		set -- `$(CTFFINDMOD) -b $(OBJS_DIR) -o patch,lastgu -n -r \
399		    -t $(PMTMO_FILE) $(GENUNIX) || true` '' ; \
400		msg= ; \
401		if [ $$$(POUND_SIGN) -eq 1 ] ; \
402		    then msg="Error in $(CTFFINDMOD)" ; \
403		elif [ "X$$1" = "X-" ] ; then msg="Did not get label" ; \
404		elif [ "X$$2" = "X-" ] ; then msg="Did not get withfile" ; \
405		fi ; \
406		if [ -n "$$msg" ] ; then \
407			echo "make ctf: $$msg - removing $(GENUNIX)" ; \
408			$(RM) $(GENUNIX) ; \
409			exit 1 ; \
410		fi ; \
411		label="-l $$1" ; \
412		with="-w $$2" ; \
413	else \
414		label="-L VERSION" ; \
415	fi ; \
416	cmd="$(CTFMERGE) $(CTFMRGFLAGS) $$label $$with -o $@" ; \
417	echo $$cmd "$(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)"; \
418	$$cmd $(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)
419
420#
421# Used to copy CTF data from the sun4u genunix to the sun4m genunix.  While
422# we may lose some genunix-specific sun4m-only data, there really isn't any
423# other way, since individual ctfmerges on the sun4u and sun4m genunix
424# modules will result in differing type indices for the same types, and we
425# can't uniquify a given non-genunix module against two genunix modules.
426#
427CTFMERGE_COPY_CTF_DATA		= \
428	@if [ -f $(CTFMERGE_GENUNIX) ] ; then \
429		cmd="$(CTFMERGE) $(CTFMRGFLAGS) -c $(CTFMERGE_GENUNIX) $@" ; \
430		echo $$cmd ; \
431		$$cmd ; \
432	else \
433		echo "WARNING: $(CTFMERGE_GENUNIX) not built. " \
434		    "CTF data will be incomplete" ; \
435	fi
436
437#
438# We ctfmerge the ip objects into genunix to maximize the number of common types
439# found there, thus maximizing the effectiveness of uniquification.  We don't
440# want the genunix build to have to know about the individual ip objects, so we
441# put them in an archive.  The genunix ctfmerge then includes this archive.
442#
443IPCTF			= $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a
444
445#
446#	Installation directories
447#
448
449#
450#	For now, 64b modules install into a subdirectory
451#	of their 32b brethren.
452#
453SUBDIR64_sparc		= sparcv9
454SUBDIR64_i386		= amd64
455SUBDIR64		= $(SUBDIR64_$(MACH))
456
457ROOT_MOD_DIR		= $(ROOT)/kernel
458
459ROOT_KERN_DIR_32	= $(ROOT_MOD_DIR)
460ROOT_DRV_DIR_32		= $(ROOT_MOD_DIR)/drv
461ROOT_DTRACE_DIR_32	= $(ROOT_MOD_DIR)/dtrace
462ROOT_EXEC_DIR_32	= $(ROOT_MOD_DIR)/exec
463ROOT_FS_DIR_32		= $(ROOT_MOD_DIR)/fs
464ROOT_SCHED_DIR_32	= $(ROOT_MOD_DIR)/sched
465ROOT_STRMOD_DIR_32	= $(ROOT_MOD_DIR)/strmod
466ROOT_IPP_DIR_32		= $(ROOT_MOD_DIR)/ipp
467ROOT_SYS_DIR_32		= $(ROOT_MOD_DIR)/sys
468ROOT_MISC_DIR_32	= $(ROOT_MOD_DIR)/misc
469ROOT_KGSS_DIR_32	= $(ROOT_MOD_DIR)/misc/kgss
470ROOT_NLMISC_DIR_32	= $(ROOT_MOD_DIR)/misc
471ROOT_MACH_DIR_32	= $(ROOT_MOD_DIR)/mach
472ROOT_CPU_DIR_32		= $(ROOT_MOD_DIR)/cpu
473ROOT_TOD_DIR_32		= $(ROOT_MOD_DIR)/tod
474ROOT_FONT_DIR_32	= $(ROOT_MOD_DIR)/fonts
475ROOT_DACF_DIR_32	= $(ROOT_MOD_DIR)/dacf
476ROOT_CRYPTO_DIR_32	= $(ROOT_MOD_DIR)/crypto
477
478ROOT_KERN_DIR_64	= $(ROOT_MOD_DIR)/$(SUBDIR64)
479ROOT_DRV_DIR_64		= $(ROOT_MOD_DIR)/drv/$(SUBDIR64)
480ROOT_DTRACE_DIR_64	= $(ROOT_MOD_DIR)/dtrace/$(SUBDIR64)
481ROOT_EXEC_DIR_64	= $(ROOT_MOD_DIR)/exec/$(SUBDIR64)
482ROOT_FS_DIR_64		= $(ROOT_MOD_DIR)/fs/$(SUBDIR64)
483ROOT_SCHED_DIR_64	= $(ROOT_MOD_DIR)/sched/$(SUBDIR64)
484ROOT_STRMOD_DIR_64	= $(ROOT_MOD_DIR)/strmod/$(SUBDIR64)
485ROOT_IPP_DIR_64		= $(ROOT_MOD_DIR)/ipp/$(SUBDIR64)
486ROOT_SYS_DIR_64		= $(ROOT_MOD_DIR)/sys/$(SUBDIR64)
487ROOT_MISC_DIR_64	= $(ROOT_MOD_DIR)/misc/$(SUBDIR64)
488ROOT_KGSS_DIR_64	= $(ROOT_MOD_DIR)/misc/kgss/$(SUBDIR64)
489ROOT_NLMISC_DIR_64	= $(ROOT_MOD_DIR)/misc/$(SUBDIR64)
490ROOT_MACH_DIR_64	= $(ROOT_MOD_DIR)/mach/$(SUBDIR64)
491ROOT_CPU_DIR_64		= $(ROOT_MOD_DIR)/cpu/$(SUBDIR64)
492ROOT_TOD_DIR_64		= $(ROOT_MOD_DIR)/tod/$(SUBDIR64)
493ROOT_FONT_DIR_64	= $(ROOT_MOD_DIR)/fonts/$(SUBDIR64)
494ROOT_DACF_DIR_64	= $(ROOT_MOD_DIR)/dacf/$(SUBDIR64)
495ROOT_CRYPTO_DIR_64	= $(ROOT_MOD_DIR)/crypto/$(SUBDIR64)
496
497ROOT_KERN_DIR		= $(ROOT_KERN_DIR_$(CLASS))
498ROOT_DRV_DIR		= $(ROOT_DRV_DIR_$(CLASS))
499ROOT_DTRACE_DIR		= $(ROOT_DTRACE_DIR_$(CLASS))
500ROOT_EXEC_DIR		= $(ROOT_EXEC_DIR_$(CLASS))
501ROOT_FS_DIR		= $(ROOT_FS_DIR_$(CLASS))
502ROOT_SCHED_DIR		= $(ROOT_SCHED_DIR_$(CLASS))
503ROOT_STRMOD_DIR		= $(ROOT_STRMOD_DIR_$(CLASS))
504ROOT_IPP_DIR		= $(ROOT_IPP_DIR_$(CLASS))
505ROOT_SYS_DIR		= $(ROOT_SYS_DIR_$(CLASS))
506ROOT_MISC_DIR		= $(ROOT_MISC_DIR_$(CLASS))
507ROOT_KGSS_DIR		= $(ROOT_KGSS_DIR_$(CLASS))
508ROOT_NLMISC_DIR		= $(ROOT_NLMISC_DIR_$(CLASS))
509ROOT_MACH_DIR		= $(ROOT_MACH_DIR_$(CLASS))
510ROOT_CPU_DIR		= $(ROOT_CPU_DIR_$(CLASS))
511ROOT_TOD_DIR		= $(ROOT_TOD_DIR_$(CLASS))
512ROOT_FONT_DIR		= $(ROOT_FONT_DIR_$(CLASS))
513ROOT_DACF_DIR		= $(ROOT_DACF_DIR_$(CLASS))
514ROOT_CRYPTO_DIR		= $(ROOT_CRYPTO_DIR_$(CLASS))
515
516ROOT_MOD_DIRS_32	= $(ROOT_DRV_DIR_32) $(ROOT_EXEC_DIR_32)
517ROOT_MOD_DIRS_32	+= $(ROOT_DTRACE_DIR_32)
518ROOT_MOD_DIRS_32	+= $(ROOT_FS_DIR_32) $(ROOT_SCHED_DIR_32)
519ROOT_MOD_DIRS_32	+= $(ROOT_STRMOD_DIR_32) $(ROOT_SYS_DIR_32)
520ROOT_MOD_DIRS_32	+= $(ROOT_IPP_DIR_32)
521ROOT_MOD_DIRS_32	+= $(ROOT_MISC_DIR_32) $(ROOT_MACH_DIR_32)
522ROOT_MOD_DIRS_32	+= $(ROOT_KGSS_DIR_32)
523ROOT_MOD_DIRS_32	+= $(ROOT_CPU_DIR_32) $(ROOT_FONT_DIR_32)
524ROOT_MOD_DIRS_32	+= $(ROOT_TOD_DIR_32) $(ROOT_DACF_DIR_32)
525ROOT_MOD_DIRS_32	+= $(ROOT_CRYPTO_DIR_32)
526
527USR_MOD_DIR		= $(ROOT)/usr/kernel
528
529USR_DRV_DIR_32		= $(USR_MOD_DIR)/drv
530USR_EXEC_DIR_32		= $(USR_MOD_DIR)/exec
531USR_FS_DIR_32		= $(USR_MOD_DIR)/fs
532USR_SCHED_DIR_32	= $(USR_MOD_DIR)/sched
533USR_STRMOD_DIR_32	= $(USR_MOD_DIR)/strmod
534USR_SYS_DIR_32		= $(USR_MOD_DIR)/sys
535USR_MISC_DIR_32		= $(USR_MOD_DIR)/misc
536USR_DACF_DIR_32		= $(USR_MOD_DIR)/dacf
537USR_PCBE_DIR_32		= $(USR_MOD_DIR)/pcbe
538
539USR_DRV_DIR_64		= $(USR_MOD_DIR)/drv/$(SUBDIR64)
540USR_EXEC_DIR_64		= $(USR_MOD_DIR)/exec/$(SUBDIR64)
541USR_FS_DIR_64		= $(USR_MOD_DIR)/fs/$(SUBDIR64)
542USR_SCHED_DIR_64	= $(USR_MOD_DIR)/sched/$(SUBDIR64)
543USR_STRMOD_DIR_64	= $(USR_MOD_DIR)/strmod/$(SUBDIR64)
544USR_SYS_DIR_64		= $(USR_MOD_DIR)/sys/$(SUBDIR64)
545USR_MISC_DIR_64		= $(USR_MOD_DIR)/misc/$(SUBDIR64)
546USR_DACF_DIR_64		= $(USR_MOD_DIR)/dacf/$(SUBDIR64)
547USR_PCBE_DIR_64		= $(USR_MOD_DIR)/pcbe/$(SUBDIR64)
548
549USR_DRV_DIR		= $(USR_DRV_DIR_$(CLASS))
550USR_EXEC_DIR		= $(USR_EXEC_DIR_$(CLASS))
551USR_FS_DIR		= $(USR_FS_DIR_$(CLASS))
552USR_SCHED_DIR		= $(USR_SCHED_DIR_$(CLASS))
553USR_STRMOD_DIR		= $(USR_STRMOD_DIR_$(CLASS))
554USR_SYS_DIR		= $(USR_SYS_DIR_$(CLASS))
555USR_MISC_DIR		= $(USR_MISC_DIR_$(CLASS))
556USR_DACF_DIR		= $(USR_DACF_DIR_$(CLASS))
557USR_PCBE_DIR		= $(USR_PCBE_DIR_$(CLASS))
558
559USR_MOD_DIRS_32		= $(USR_DRV_DIR_32) $(USR_EXEC_DIR_32)
560USR_MOD_DIRS_32		+= $(USR_FS_DIR_32) $(USR_SCHED_DIR_32)
561USR_MOD_DIRS_32		+= $(USR_STRMOD_DIR_32) $(USR_SYS_DIR_32)
562USR_MOD_DIRS_32		+= $(USR_MISC_DIR_32) $(USR_DACF_DIR_32)
563USR_MOD_DIRS_32		+= $(USR_PCBE_DIR_32)
564
565#
566#
567#
568include $(SRC)/Makefile.psm
569
570#
571#       Set ownership on links.
572#
573CHOWNLINK=
574$(CH)CHOWNLINK= ; $(CHOWN) $(OWNER) $@
575CHGRPLINK=
576$(CH)CHGRPLINK= ; $(CHGRP) $(GROUP) $@
577
578#
579#	The "-r" on the remove may be considered temporary, but is required
580#	while the replacement of the SUNW,SPARCstation-10,SX directory by
581#	a symbolic link is being propagated.
582#
583INS.slink1= $(RM) -r $@; $(SYMLINK) $(PLATFORM) $@ $(CHOWNLINK) $(CHGRPLINK)
584INS.slink2= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/$(@F) $@ $(CHOWNLINK) $(CHGRPLINK)
585INS.slink3= $(RM) -r $@; $(SYMLINK) $(IMPLEMENTED_PLATFORM) $@ $(CHOWNLINK) $(CHGRPLINK)
586INS.slink4= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/include $@ $(CHOWNLINK) $(CHGRPLINK)
587INS.slink5= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/sbin $@ $(CHOWNLINK) $(CHGRPLINK)
588INS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@ $(CHOWNLINK) $(CHGRPLINK)
589
590ROOT_PLAT_LINKS		 = $(PLAT_LINKS:%=$(ROOT_PLAT_DIR)/%)
591ROOT_PLAT_LINKS_2	 = $(PLAT_LINKS_2:%=$(ROOT_PLAT_DIR)/%)
592USR_PLAT_LINKS		 = $(PLAT_LINKS:%=$(USR_PLAT_DIR)/%)
593USR_PLAT_LINKS_2	 = $(PLAT_LINKS_2:%=$(USR_PLAT_DIR)/%)
594
595#
596#	Collection of all relevant, delivered kernel modules.
597#
598KMODS	= $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) $(TOD_KMODS) \
599	  $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) $(NLMISC_KMODS) \
600	  $(MACH_KMODS) $(CPU_KMODS) $(GENUNIX_KMODS) \
601	  $(GSS_KMODS) $(MMU_KMODS) $(DACF_KMODS) $(EXPORT_KMODS) \
602	  $(IPP_KMODS) $(CRYPTO_KMODS) $(CRYPTO_EK_KMODS) $(PCBE_KMODS) \
603	  $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS))
604
605LINT_KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \
606	  $(TOD_KMODS) $(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) \
607	  $(MACH_KMODS) $(GSS_KMODS) $(DACF_KMODS) $(IPP_KMODS) \
608	  $(CRYPTO_KMODS) $(PCBE_KMODS) \
609	  $(DRV_KMODS_$(CLASS)) $(MISC_KMODS_$(CLASS))
610
611THIS_YEAR:sh=	/bin/date +%Y
612$(OBJS_DIR)/logsubr.o	:= CPPFLAGS += -DTHIS_YEAR=$(THIS_YEAR)
613$(OBJS_DIR)/logsubr.ln	:= CPPFLAGS += -DTHIS_YEAR=$(THIS_YEAR)
614
615#
616#	Files to be compiled with -xa, to generate basic block execution
617#	count data.
618#
619#	There are several ways to compile parts of the kernel for kcov:
620#               1)  Add targets to BB_FILES here or in other Makefiles
621#                       (they must in the form of $(OBJS_DIR)/target.o)
622#               2)  setenv BB_FILES '$(XXX_OBJS:%=$(OBJS_DIR)/%)'
623#               3)  setenv BB_FILES '$(OBJECTS)'
624#
625#       Do NOT setenv CFLAGS -xa, as that will cause infinite recursion
626#       in unix_bb.o
627#
628BB_FILES =
629$(BB_FILES)	:= XAOPT = -xa
630
631#
632#	The idea here is for unix_bb.o to be in all kernels except the
633#	kernel which actually gets shipped to customers.  In practice,
634#	$(RELEASE_BUILD) is on for a number of the late beta and fcs builds.
635#
636CODE_COVERAGE=
637$(RELEASE_BUILD)CODE_COVERAGE:sh=	echo \\043
638$(CODE_COVERAGE)$(OBJS_DIR)/unix_bb.o   := CPPFLAGS     += -DKCOV
639$(CODE_COVERAGE)$(OBJS_DIR)/unix_bb.ln  := CPPFLAGS     += -DKCOV
640
641#
642#	Do not let unix_bb.o get compiled with -xa!
643#
644$(OBJS_DIR)/unix_bb.o	:= XAOPT =
645
646#
647#	MPSAS support
648#
649MPSAS_BUILD:sh=		echo \\043
650#
651# Privilege files
652#
653PRIVS_AWK = $(SRC)/uts/common/os/privs.awk
654PRIVS_DEF = $(SRC)/uts/common/os/priv_defs
655