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]
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.
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
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 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
50 CPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS)
52 C99MODE= $(C99_ENABLE)
55 # kmdb is a kernel module, so we'll use the kernel's build flags.
56 CFLAGS += $(STAND_FLAGS_32)
57 CFLAGS64 += $(STAND_FLAGS_64)
59 ASFLAGS += -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS)
62 SUBDIR64 = $(SUBDIR64_$(MACH))
65 # Terminal types supported by kmdb
83 # The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which
84 # teaches them about the kernel version of the synchronization functions, while
85 # the core of kmdb, which is compiled without -D_KERNEL, knows about the
86 # userland versions. The same thing applies to the driver, parts of which
87 # are executed directly by the kernel, and other parts which are called by
90 CERRWARN += -Wno-uninitialized
91 CERRWARN += -Wno-unused-label
92 CERRWARN += -Wno-char-subscripts
93 CERRWARN += -Wno-clobbered
94 CERRWARN += -Wno-unused-variable
95 CERRWARN += -Wno-parentheses
98 MAPFILE_INTERMEDIATE = $(MAPFILE).i
99 MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
100 MAPFILE_SOURCES_COMMON = \
101 ../../../common/kmdb/kmdb_dpi.h \
102 ../../../common/kmdb/kmdb_kctl.h \
103 ../../../common/kmdb/kmdb_kdi.h \
104 ../../../common/kmdb/kmdb_wr.h \
105 ../../../common/mdb/mdb_ctf.h \
106 ../../../common/mdb/mdb_ks.h \
107 ../../../common/mdb/mdb_modapi.h \
108 ../../../common/mdb/mdb_param.h \
109 ../../../common/mdb/mdb_whatis.h
111 kmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf
113 PROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln)
114 VERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln)
115 KCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln)
117 $(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \
118 -Dassfail=kmdb_prom_assfail
120 $(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)'
122 $(KCTLTGTS) := CPPFLAGS += -D_KERNEL
123 $(KCTLTGTS) := ASFLAGS += -D_KERNEL
125 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
127 $(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755
129 include ../../../Makefile.kmdb.targ