7857 zfs/zpool commands print scary errors after 7741
[unleashed.git] / usr / src / cmd / mdb / Makefile.kmdb
blobe997e5917f74b56c233dd32b2eec0907d39c32e8
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23 # Use is subject to license terms.
25 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
28 .KEEP_STATE:
29 .SUFFIXES:
31 PROG = kmdbmod
33 include ../Makefile.kmdb
34 include ../../Makefile.kmdb
35 include ../../../Makefile.versions
36 include ../../../Makefile.tools
37 include ../../../Makefile.kmdb.files
39 OBJS += mdb_lex.o mdb_grammar.o
41 .NO_PARALLEL:
42 .PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln)
44 SRCINCDIRS      += . .. ../.. ../../../common ../../../common/libstand
45 OSINCDIRS       += $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR)
47 INCDIRS = $(SRCINCDIRS) $(OSINCDIRS)
49 # We don't want thread-specific errno's in kmdb, as we're single-threaded.
50 DTS_ERRNO=
52 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
53 CPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS)
56 # kmdb is a kernel module, so we'll use the kernel's build flags.
57 CFLAGS += $(STAND_FLAGS_32)
58 CFLAGS64 += $(STAND_FLAGS_64)
60 ASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS)
62 SUBDIR64_sparc          = sparcv9
63 SUBDIR64_i386           = amd64
64 SUBDIR64                = $(SUBDIR64_$(MACH))
67 # Terminal types supported by kmdb
69 SUPPORTED_TERMS = \
70         ansi \
71         at386 \
72         dtterm \
73         h19 \
74         sun \
75         sun-cmd \
76         sun-color \
77         vt100 \
78         vt52 \
79         wyse30 \
80         wyse50 \
81         wyse60 \
82         xterm \
83         xterms
85 LINTFLAGS += -n -errtags=yes
87 # The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which
88 # teaches them about the kernel version of the synchronization functions, while
89 # the core of kmdb, which is compiled without -D_KERNEL, knows about the
90 # userland versions.  Even though nobody actually uses either one, lint
91 # complains that both know about different versions.  The same thing applies
92 # to the driver, parts of which are executed directly by the kernel, and other
93 # parts which are called by kmdb via the auxv.
94 ALLLINTFLAGS = $(LINTFLAGS) \
95         -xerroff=E_FUNC_DECL_VAR_ARG2 \
96         -xerroff=E_INCONS_ARG_DECL \
97         -xerroff=E_INCONS_ARG_DECL2 \
98         -xerroff=E_INCONS_ARG_USED2 \
99         -xerroff=E_INCONS_VAL_TYPE_DECL2 \
100         -xerroff=E_INCONS_VAL_TYPE_USED2
102 CERRWARN += -_gcc=-Wno-uninitialized
103 CERRWARN += -_gcc=-Wno-unused-label
104 CERRWARN += -_gcc=-Wno-char-subscripts
105 CERRWARN += -_gcc=-Wno-clobbered
106 CERRWARN += -_gcc=-Wno-unused-variable
107 CERRWARN += -_gcc=-Wno-parentheses
109 MAPFILE = mapfile
110 MAPFILE_INTERMEDIATE = $(MAPFILE).i
111 MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
112 MAPFILE_SOURCES_COMMON = \
113         ../../../common/kmdb/kmdb_dpi.h \
114         ../../../common/kmdb/kmdb_kctl.h \
115         ../../../common/kmdb/kmdb_kdi.h \
116         ../../../common/kmdb/kmdb_wr.h \
117         ../../../common/mdb/mdb_ctf.h \
118         ../../../common/mdb/mdb_ks.h \
119         ../../../common/mdb/mdb_modapi.h \
120         ../../../common/mdb/mdb_param.h \
121         ../../../common/mdb/mdb_whatis.h
123 mdb_lex.o mdb_grammar.o := CCVERBOSE =
125 kmdb_ctf_open.o kmdb_ctf_open.ln        := CPPFLAGS += -I$(SRC)/common/ctf
127 PROMTGTS        = $(PROMOBJS) $(PROMOBJS:%.o=%.ln)
128 VERSTGTS        = $(VERSOBJS) $(VERSOBJS:%.o=%.ln)
129 KCTLTGTS        = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln)
131 $(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \
132         -Dassfail=kmdb_prom_assfail
134 $(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)'
136 $(KCTLTGTS) := CPPFLAGS += -D_KERNEL
137 $(KCTLTGTS) := ASFLAGS += -D_KERNEL
139 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
141 $(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755
143 include ../../../Makefile.kmdb.targ