xref: /illumos-gate/usr/src/cmd/mdb/Makefile.kmdb (revision f94c602698937f2fc025056c894e5a769f39d8fe)
1#
2# CDDL HEADER START
3#
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.
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#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26
27.KEEP_STATE:
28.SUFFIXES:
29
30PROG = kmdbmod
31
32include ../Makefile.kmdb
33include ../../Makefile.kmdb
34include ../../../Makefile.versions
35include ../../../Makefile.tools
36include ../../../Makefile.kmdb.files
37
38OBJS += mdb_lex.o mdb_grammar.o
39
40.NO_PARALLEL:
41.PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln)
42
43SRCINCDIRS	+= . .. ../.. ../../../common ../../../common/libstand
44OSINCDIRS	+= $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR)
45
46INCDIRS	= $(SRCINCDIRS) $(OSINCDIRS)
47
48# We don't want thread-specific errno's in kmdb, as we're single-threaded.
49DTS_ERRNO=
50
51$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
52CPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS)
53
54#
55# kmdb is a kernel module, so we'll use the kernel's build flags.
56CFLAGS += $(STAND_FLAGS_32)
57CFLAGS64 += $(STAND_FLAGS_64)
58
59ASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS)
60
61SUBDIR64_sparc		= sparcv9
62SUBDIR64_i386		= amd64
63SUBDIR64		= $(SUBDIR64_$(MACH))
64
65#
66# Terminal types supported by kmdb
67#
68SUPPORTED_TERMS	= \
69	ansi \
70	at386 \
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
84
85LINTFLAGS += -n -errtags=yes
86
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.
94ALLLINTFLAGS = $(LINTFLAGS) \
95	-xerroff=E_FUNC_DECL_VAR_ARG2 \
96	-xerroff=E_INCONS_ARG_DECL \
97	-xerroff=E_INCONS_ARG_DECL2 \
98	-xerroff=E_INCONS_VAL_TYPE_DECL2
99
100MAPFILE = mapfile
101MAPFILE_INTERMEDIATE = $(MAPFILE).i
102MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
103
104mdb_lex.o mdb_grammar.o := CCVERBOSE =
105
106kmdb_ctf_open.o kmdb_ctf_open.ln	:= CPPFLAGS += -I$(SRC)/common/ctf
107
108PROMTGTS	= $(PROMOBJS) $(PROMOBJS:%.o=%.ln)
109VERSTGTS	= $(VERSOBJS) $(VERSOBJS:%.o=%.ln)
110KCTLTGTS	= $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln)
111
112$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \
113	-Dassfail=kmdb_prom_assfail
114
115$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)'
116
117$(KCTLTGTS) := CPPFLAGS += -D_KERNEL
118$(KCTLTGTS) := ASFLAGS += -D_KERNEL
119
120INS.dir.root.sys=	$(INS) -s -d -m $(DIRMODE) $@
121$(CH)INS.dir.root.sys=	$(INS) -s -d -m $(DIRMODE) -u root -g sys $@
122
123$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755
124
125include ../../../Makefile.kmdb.targ
126