1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
#
.KEEP_STATE:
.SUFFIXES:
PROG = kmdbmod
include ../Makefile.kmdb
include ../../Makefile.kmdb
include ../../../Makefile.versions
include ../../../Makefile.tools
include ../../../Makefile.kmdb.files
OBJS += mdb_lex.o mdb_grammar.o
.NO_PARALLEL:
.PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln)
SRCINCDIRS += . .. ../.. ../../../common ../../../common/libstand
OSINCDIRS += $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR)
INCDIRS = $(SRCINCDIRS) $(OSINCDIRS)
# We don't want thread-specific errno's in kmdb, as we're single-threaded.
DTS_ERRNO=
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
CPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS)
#
# kmdb is a kernel module, so we'll use the kernel's build flags.
CFLAGS += $(STAND_FLAGS_32)
CFLAGS64 += $(STAND_FLAGS_64)
ASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS)
SUBDIR64_sparc = sparcv9
SUBDIR64_i386 = amd64
SUBDIR64 = $(SUBDIR64_$(MACH))
#
# Terminal types supported by kmdb
#
SUPPORTED_TERMS = \
ansi \
at386 \
dtterm \
h19 \
sun \
sun-cmd \
sun-color \
vt100 \
vt52 \
wyse30 \
wyse50 \
wyse60 \
xterm \
xterms
LINTFLAGS += -n -errtags=yes
# The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which
# teaches them about the kernel version of the synchronization functions, while
# the core of kmdb, which is compiled without -D_KERNEL, knows about the
# userland versions. Even though nobody actually uses either one, lint
# complains that both know about different versions. The same thing applies
# to the driver, parts of which are executed directly by the kernel, and other
# parts which are called by kmdb via the auxv.
ALLLINTFLAGS = $(LINTFLAGS) \
-xerroff=E_FUNC_DECL_VAR_ARG2 \
-xerroff=E_INCONS_ARG_DECL \
-xerroff=E_INCONS_ARG_DECL2 \
-xerroff=E_INCONS_ARG_USED2 \
-xerroff=E_INCONS_VAL_TYPE_DECL2 \
-xerroff=E_INCONS_VAL_TYPE_USED2
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += -_gcc=-Wno-char-subscripts
CERRWARN += -_gcc=-Wno-clobbered
CERRWARN += -_gcc=-Wno-unused-variable
CERRWARN += -_gcc=-Wno-parentheses
MAPFILE = mapfile
MAPFILE_INTERMEDIATE = $(MAPFILE).i
MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
MAPFILE_SOURCES_COMMON = \
../../../common/kmdb/kmdb_dpi.h \
../../../common/kmdb/kmdb_kctl.h \
../../../common/kmdb/kmdb_kdi.h \
../../../common/kmdb/kmdb_wr.h \
../../../common/mdb/mdb_ctf.h \
../../../common/mdb/mdb_ks.h \
../../../common/mdb/mdb_modapi.h \
../../../common/mdb/mdb_param.h \
../../../common/mdb/mdb_whatis.h
mdb_lex.o mdb_grammar.o := CCVERBOSE =
kmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf
PROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln)
VERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln)
KCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln)
$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \
-Dassfail=kmdb_prom_assfail
$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)'
$(KCTLTGTS) := CPPFLAGS += -D_KERNEL
$(KCTLTGTS) := ASFLAGS += -D_KERNEL
ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755
include ../../../Makefile.kmdb.targ
|