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