17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5b272bda5Spetede# Common Development and Distribution License (the "License"). 6b272bda5Spetede# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# 22b272bda5Spetede# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate.KEEP_STATE: 287c478bd9Sstevel@tonic-gate.SUFFIXES: 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gatePROG = kmdbmod 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateinclude ../Makefile.kmdb 337c478bd9Sstevel@tonic-gateinclude ../../Makefile.kmdb 347c478bd9Sstevel@tonic-gateinclude ../../../Makefile.versions 357c478bd9Sstevel@tonic-gateinclude ../../../Makefile.tools 367c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.files 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gateOBJS += mdb_lex.o mdb_grammar.o 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate.NO_PARALLEL: 417c478bd9Sstevel@tonic-gate.PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln) 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gateSRCINCDIRS += . .. ../.. ../../../common ../../../common/libstand 447c478bd9Sstevel@tonic-gateOSINCDIRS += $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR) 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gateINCDIRS = $(SRCINCDIRS) $(OSINCDIRS) 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate# We don't want thread-specific errno's in kmdb, as we're single-threaded. 497c478bd9Sstevel@tonic-gateDTS_ERRNO= 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG 527c478bd9Sstevel@tonic-gateCPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate# 557c478bd9Sstevel@tonic-gate# kmdb is a kernel module, so we'll use the kernel's build flags. 567c478bd9Sstevel@tonic-gateCFLAGS += $(STAND_FLAGS_32) 577c478bd9Sstevel@tonic-gateCFLAGS64 += $(STAND_FLAGS_64) 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gateASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS) 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gateSUBDIR64_sparc = sparcv9 627c478bd9Sstevel@tonic-gateSUBDIR64_i386 = amd64 637c478bd9Sstevel@tonic-gateSUBDIR64 = $(SUBDIR64_$(MACH)) 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate# 667c478bd9Sstevel@tonic-gate# Terminal types supported by kmdb 677c478bd9Sstevel@tonic-gate# 687c478bd9Sstevel@tonic-gateSUPPORTED_TERMS = \ 697c478bd9Sstevel@tonic-gate ansi \ 707c478bd9Sstevel@tonic-gate at386 \ 717c478bd9Sstevel@tonic-gate AT386 \ 727c478bd9Sstevel@tonic-gate dtterm \ 737c478bd9Sstevel@tonic-gate h19 \ 747c478bd9Sstevel@tonic-gate sun \ 757c478bd9Sstevel@tonic-gate sun-cmd \ 767c478bd9Sstevel@tonic-gate sun-color \ 777c478bd9Sstevel@tonic-gate vt100 \ 787c478bd9Sstevel@tonic-gate vt52 \ 797c478bd9Sstevel@tonic-gate wyse30 \ 807c478bd9Sstevel@tonic-gate wyse50 \ 817c478bd9Sstevel@tonic-gate wyse60 \ 827c478bd9Sstevel@tonic-gate xterm \ 837c478bd9Sstevel@tonic-gate xterms 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gateLINTFLAGS += -n -errtags=yes 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate# The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which 887c478bd9Sstevel@tonic-gate# teaches them about the kernel version of the synchronization functions, while 897c478bd9Sstevel@tonic-gate# the core of kmdb, which is compiled without -D_KERNEL, knows about the 907c478bd9Sstevel@tonic-gate# userland versions. Even though nobody actually uses either one, lint 917c478bd9Sstevel@tonic-gate# complains that both know about different versions. The same thing applies 927c478bd9Sstevel@tonic-gate# to the driver, parts of which are executed directly by the kernel, and other 937c478bd9Sstevel@tonic-gate# parts which are called by kmdb via the auxv. 947c478bd9Sstevel@tonic-gateALLLINTFLAGS = $(LINTFLAGS) \ 957c478bd9Sstevel@tonic-gate -xerroff=E_FUNC_DECL_VAR_ARG2 \ 967c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL \ 977c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL2 \ 987c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_VAL_TYPE_DECL2 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gateMAPFILE = mapfile 101b272bda5SpetedeMAPFILE_INTERMEDIATE = $(MAPFILE).i 1027c478bd9Sstevel@tonic-gateMAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gatemdb_lex.o mdb_grammar.o := CCVERBOSE = 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gatekmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gatePROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln) 1097c478bd9Sstevel@tonic-gateVERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln) 1107c478bd9Sstevel@tonic-gateKCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln) 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \ 1137c478bd9Sstevel@tonic-gate -Dassfail=kmdb_prom_assfail 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)' 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate$(KCTLTGTS) := CPPFLAGS += -D_KERNEL 1187c478bd9Sstevel@tonic-gate$(KCTLTGTS) := ASFLAGS += -D_KERNEL 1197c478bd9Sstevel@tonic-gate 120*69bb4bb4Scarlsonjffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs 121*69bb4bb4Scarlsonj 1227c478bd9Sstevel@tonic-gateINS.dir.root.sys= $(INS) -s -d -m $(DIRMODE) $@ 1237c478bd9Sstevel@tonic-gate$(CH)INS.dir.root.sys= $(INS) -s -d -m $(DIRMODE) -u root -g sys $@ 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.targ 128