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