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