Merge commit 'f864f99efe57685e1762590c1a880dd16bca6da9' into merges
[unleashed.git] / usr / src / cmd / mdb / Makefile.kmdb
blobc1d46b90eb940d160eb2ca3a543837d33067635c
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 $(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 CFLAGS64 += $(STAND_FLAGS_64)
58 ASFLAGS += -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS)
60 SUBDIR64_i386           = amd64
61 SUBDIR64                = $(SUBDIR64_$(MACH))
64 # Terminal types supported by kmdb
66 SUPPORTED_TERMS = \
67         ansi \
68         at386 \
69         dtterm \
70         h19 \
71         sun \
72         sun-cmd \
73         sun-color \
74         vt100 \
75         vt52 \
76         wyse30 \
77         wyse50 \
78         wyse60 \
79         xterm \
80         xterms
82 # The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which
83 # teaches them about the kernel version of the synchronization functions, while
84 # the core of kmdb, which is compiled without -D_KERNEL, knows about the
85 # userland versions. The same thing applies to the driver, parts of which
86 # are executed directly by the kernel, and other parts which are called by
87 # kmdb via the auxv.
89 CERRWARN += -Wno-uninitialized
90 CERRWARN += -Wno-unused-label
91 CERRWARN += -Wno-char-subscripts
92 CERRWARN += -Wno-clobbered
93 CERRWARN += -Wno-unused-variable
94 CERRWARN += -Wno-parentheses
96 MAPFILE = mapfile
97 MAPFILE_INTERMEDIATE = $(MAPFILE).i
98 MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
99 MAPFILE_SOURCES_COMMON = \
100         ../../../common/kmdb/kmdb_dpi.h \
101         ../../../common/kmdb/kmdb_kctl.h \
102         ../../../common/kmdb/kmdb_kdi.h \
103         ../../../common/kmdb/kmdb_wr.h \
104         ../../../common/mdb/mdb_ctf.h \
105         ../../../common/mdb/mdb_ks.h \
106         ../../../common/mdb/mdb_modapi.h \
107         ../../../common/mdb/mdb_param.h \
108         ../../../common/mdb/mdb_whatis.h
110 kmdb_ctf_open.o kmdb_ctf_open.ln        := CPPFLAGS += -I$(SRC)/common/ctf
112 PROMTGTS        = $(PROMOBJS) $(PROMOBJS:%.o=%.ln)
113 VERSTGTS        = $(VERSOBJS) $(VERSOBJS:%.o=%.ln)
114 KCTLTGTS        = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln)
116 $(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \
117         -Dassfail=kmdb_prom_assfail
119 $(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)'
121 $(KCTLTGTS) := CPPFLAGS += -D_KERNEL
122 $(KCTLTGTS) := ASFLAGS += -D_KERNEL
124 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
126 $(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755
128 include ../../../Makefile.kmdb.targ