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# 2224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate.KEEP_STATE: 277c478bd9Sstevel@tonic-gate.SUFFIXES: 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gatePROG = kmdbmod 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gateinclude ../Makefile.kmdb 327c478bd9Sstevel@tonic-gateinclude ../../Makefile.kmdb 337c478bd9Sstevel@tonic-gateinclude ../../../Makefile.versions 347c478bd9Sstevel@tonic-gateinclude ../../../Makefile.tools 357c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.files 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gateOBJS += mdb_lex.o mdb_grammar.o 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate.NO_PARALLEL: 407c478bd9Sstevel@tonic-gate.PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln) 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gateSRCINCDIRS += . .. ../.. ../../../common ../../../common/libstand 437c478bd9Sstevel@tonic-gateOSINCDIRS += $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR) 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gateINCDIRS = $(SRCINCDIRS) $(OSINCDIRS) 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate# We don't want thread-specific errno's in kmdb, as we're single-threaded. 487c478bd9Sstevel@tonic-gateDTS_ERRNO= 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG 517c478bd9Sstevel@tonic-gateCPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS) 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate# 547c478bd9Sstevel@tonic-gate# kmdb is a kernel module, so we'll use the kernel's build flags. 557c478bd9Sstevel@tonic-gateCFLAGS += $(STAND_FLAGS_32) 567c478bd9Sstevel@tonic-gateCFLAGS64 += $(STAND_FLAGS_64) 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gateASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS) 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gateSUBDIR64_sparc = sparcv9 617c478bd9Sstevel@tonic-gateSUBDIR64_i386 = amd64 627c478bd9Sstevel@tonic-gateSUBDIR64 = $(SUBDIR64_$(MACH)) 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate# 657c478bd9Sstevel@tonic-gate# Terminal types supported by kmdb 667c478bd9Sstevel@tonic-gate# 677c478bd9Sstevel@tonic-gateSUPPORTED_TERMS = \ 687c478bd9Sstevel@tonic-gate ansi \ 697c478bd9Sstevel@tonic-gate at386 \ 707c478bd9Sstevel@tonic-gate AT386 \ 717c478bd9Sstevel@tonic-gate dtterm \ 727c478bd9Sstevel@tonic-gate h19 \ 737c478bd9Sstevel@tonic-gate sun \ 747c478bd9Sstevel@tonic-gate sun-cmd \ 757c478bd9Sstevel@tonic-gate sun-color \ 767c478bd9Sstevel@tonic-gate vt100 \ 777c478bd9Sstevel@tonic-gate vt52 \ 787c478bd9Sstevel@tonic-gate wyse30 \ 797c478bd9Sstevel@tonic-gate wyse50 \ 807c478bd9Sstevel@tonic-gate wyse60 \ 817c478bd9Sstevel@tonic-gate xterm \ 827c478bd9Sstevel@tonic-gate xterms 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gateLINTFLAGS += -n -errtags=yes 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate# The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which 877c478bd9Sstevel@tonic-gate# teaches them about the kernel version of the synchronization functions, while 887c478bd9Sstevel@tonic-gate# the core of kmdb, which is compiled without -D_KERNEL, knows about the 897c478bd9Sstevel@tonic-gate# userland versions. Even though nobody actually uses either one, lint 907c478bd9Sstevel@tonic-gate# complains that both know about different versions. The same thing applies 917c478bd9Sstevel@tonic-gate# to the driver, parts of which are executed directly by the kernel, and other 927c478bd9Sstevel@tonic-gate# parts which are called by kmdb via the auxv. 937c478bd9Sstevel@tonic-gateALLLINTFLAGS = $(LINTFLAGS) \ 947c478bd9Sstevel@tonic-gate -xerroff=E_FUNC_DECL_VAR_ARG2 \ 957c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL \ 967c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL2 \ 97e8ed0869SJohn Beck -xerroff=E_INCONS_ARG_USED2 \ 98e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_DECL2 \ 99e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_USED2 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gateMAPFILE = mapfile 102b272bda5SpetedeMAPFILE_INTERMEDIATE = $(MAPFILE).i 1037c478bd9Sstevel@tonic-gateMAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel 104*4a1c2431SJonathan AdamsMAPFILE_SOURCES_COMMON = \ 105*4a1c2431SJonathan Adams ../../../common/kmdb/kmdb_dpi.h \ 106*4a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kctl.h \ 107*4a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kdi.h \ 108*4a1c2431SJonathan Adams ../../../common/kmdb/kmdb_wr.h \ 109*4a1c2431SJonathan Adams ../../../common/mdb/mdb_ctf.h \ 110*4a1c2431SJonathan Adams ../../../common/mdb/mdb_ks.h \ 111*4a1c2431SJonathan Adams ../../../common/mdb/mdb_modapi.h \ 112*4a1c2431SJonathan Adams ../../../common/mdb/mdb_param.h \ 113*4a1c2431SJonathan Adams ../../../common/mdb/mdb_whatis.h 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gatemdb_lex.o mdb_grammar.o := CCVERBOSE = 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gatekmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gatePROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln) 1207c478bd9Sstevel@tonic-gateVERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln) 1217c478bd9Sstevel@tonic-gateKCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln) 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \ 1247c478bd9Sstevel@tonic-gate -Dassfail=kmdb_prom_assfail 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)' 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate$(KCTLTGTS) := CPPFLAGS += -D_KERNEL 1297c478bd9Sstevel@tonic-gate$(KCTLTGTS) := ASFLAGS += -D_KERNEL 1307c478bd9Sstevel@tonic-gate 13169bb4bb4Scarlsonjffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs 13269bb4bb4Scarlsonj 1337c478bd9Sstevel@tonic-gateINS.dir.root.sys= $(INS) -s -d -m $(DIRMODE) $@ 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.targ 138