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# 2513cfc972SYuri Pankov# Copyright 2011 Nexenta Systems, Inc. All rights reserved. 2613cfc972SYuri Pankov# 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate.KEEP_STATE: 297c478bd9Sstevel@tonic-gate.SUFFIXES: 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gatePROG = kmdbmod 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gateinclude ../Makefile.kmdb 347c478bd9Sstevel@tonic-gateinclude ../../Makefile.kmdb 357c478bd9Sstevel@tonic-gateinclude ../../../Makefile.versions 367c478bd9Sstevel@tonic-gateinclude ../../../Makefile.tools 377c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.files 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gateOBJS += mdb_lex.o mdb_grammar.o 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate.NO_PARALLEL: 427c478bd9Sstevel@tonic-gate.PARALLEL: kmdb_modlinktest.o kmdb_terminfo.c $(ALLOBJS) $(ALLOBJS:%.o=%.ln) 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gateSRCINCDIRS += . .. ../.. ../../../common ../../../common/libstand 457c478bd9Sstevel@tonic-gateOSINCDIRS += $(SRC)/uts/$(MMU) $(SRC)/uts/$(ISADIR) 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gateINCDIRS = $(SRCINCDIRS) $(OSINCDIRS) 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate# We don't want thread-specific errno's in kmdb, as we're single-threaded. 507c478bd9Sstevel@tonic-gateDTS_ERRNO= 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG 537c478bd9Sstevel@tonic-gateCPPFLAGS += -D_MDB -D_KMDB $(INCDIRS:%=-I%) $(ARCHOPTS) 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate# 567c478bd9Sstevel@tonic-gate# kmdb is a kernel module, so we'll use the kernel's build flags. 577c478bd9Sstevel@tonic-gateCFLAGS += $(STAND_FLAGS_32) 587c478bd9Sstevel@tonic-gateCFLAGS64 += $(STAND_FLAGS_64) 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gateASFLAGS += -P -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS) 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gateSUBDIR64_sparc = sparcv9 637c478bd9Sstevel@tonic-gateSUBDIR64_i386 = amd64 647c478bd9Sstevel@tonic-gateSUBDIR64 = $(SUBDIR64_$(MACH)) 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate# 677c478bd9Sstevel@tonic-gate# Terminal types supported by kmdb 687c478bd9Sstevel@tonic-gate# 697c478bd9Sstevel@tonic-gateSUPPORTED_TERMS = \ 707c478bd9Sstevel@tonic-gate ansi \ 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 \ 98e8ed0869SJohn Beck -xerroff=E_INCONS_ARG_USED2 \ 99e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_DECL2 \ 100e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_USED2 1017c478bd9Sstevel@tonic-gate 102*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 103*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 104*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-char-subscripts 105*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-clobbered 106*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 107*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 108*7014882cSRichard Lowe 1097c478bd9Sstevel@tonic-gateMAPFILE = mapfile 110b272bda5SpetedeMAPFILE_INTERMEDIATE = $(MAPFILE).i 1117c478bd9Sstevel@tonic-gateMAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel 1124a1c2431SJonathan AdamsMAPFILE_SOURCES_COMMON = \ 1134a1c2431SJonathan Adams ../../../common/kmdb/kmdb_dpi.h \ 1144a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kctl.h \ 1154a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kdi.h \ 1164a1c2431SJonathan Adams ../../../common/kmdb/kmdb_wr.h \ 1174a1c2431SJonathan Adams ../../../common/mdb/mdb_ctf.h \ 1184a1c2431SJonathan Adams ../../../common/mdb/mdb_ks.h \ 1194a1c2431SJonathan Adams ../../../common/mdb/mdb_modapi.h \ 1204a1c2431SJonathan Adams ../../../common/mdb/mdb_param.h \ 1214a1c2431SJonathan Adams ../../../common/mdb/mdb_whatis.h 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gatemdb_lex.o mdb_grammar.o := CCVERBOSE = 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gatekmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gatePROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln) 1287c478bd9Sstevel@tonic-gateVERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln) 1297c478bd9Sstevel@tonic-gateKCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln) 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gate$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \ 1327c478bd9Sstevel@tonic-gate -Dassfail=kmdb_prom_assfail 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)' 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gate$(KCTLTGTS) := CPPFLAGS += -D_KERNEL 1377c478bd9Sstevel@tonic-gate$(KCTLTGTS) := ASFLAGS += -D_KERNEL 1387c478bd9Sstevel@tonic-gate 13969bb4bb4Scarlsonjffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs 14069bb4bb4Scarlsonj 1417c478bd9Sstevel@tonic-gate$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.targ 144