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-gateCFLAGS64 += $(STAND_FLAGS_64) 587c478bd9Sstevel@tonic-gate 59*5d9d9091SRichard LoweASFLAGS += -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS) 60*5d9d9091SRichard LoweASFLAGS64 += -D_ASM $(INCDIRS:%=-I%) $(ARCHOPTS) 617c478bd9Sstevel@tonic-gate 625a0af816SRobert Mustacchi# 635a0af816SRobert Mustacchi# kmdb has bootstrapping challenges with the stack protector. 645a0af816SRobert Mustacchi# 655a0af816SRobert MustacchiSTACKPROTECT = none 665a0af816SRobert Mustacchi 677c478bd9Sstevel@tonic-gateSUBDIR64_i386 = amd64 687c478bd9Sstevel@tonic-gateSUBDIR64 = $(SUBDIR64_$(MACH)) 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate# 717c478bd9Sstevel@tonic-gate# Terminal types supported by kmdb 727c478bd9Sstevel@tonic-gate# 737c478bd9Sstevel@tonic-gateSUPPORTED_TERMS = \ 747c478bd9Sstevel@tonic-gate ansi \ 757c478bd9Sstevel@tonic-gate at386 \ 767c478bd9Sstevel@tonic-gate dtterm \ 777c478bd9Sstevel@tonic-gate h19 \ 787c478bd9Sstevel@tonic-gate sun \ 797c478bd9Sstevel@tonic-gate sun-cmd \ 807c478bd9Sstevel@tonic-gate sun-color \ 817c478bd9Sstevel@tonic-gate vt100 \ 827c478bd9Sstevel@tonic-gate vt52 \ 837c478bd9Sstevel@tonic-gate wyse30 \ 847c478bd9Sstevel@tonic-gate wyse50 \ 857c478bd9Sstevel@tonic-gate wyse60 \ 867c478bd9Sstevel@tonic-gate xterm \ 877c478bd9Sstevel@tonic-gate xterms 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gateLINTFLAGS += -n -errtags=yes 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate# The prom interfaces (the prom_* files) are compiled with -D_KERNEL, which 927c478bd9Sstevel@tonic-gate# teaches them about the kernel version of the synchronization functions, while 937c478bd9Sstevel@tonic-gate# the core of kmdb, which is compiled without -D_KERNEL, knows about the 947c478bd9Sstevel@tonic-gate# userland versions. Even though nobody actually uses either one, lint 957c478bd9Sstevel@tonic-gate# complains that both know about different versions. The same thing applies 967c478bd9Sstevel@tonic-gate# to the driver, parts of which are executed directly by the kernel, and other 977c478bd9Sstevel@tonic-gate# parts which are called by kmdb via the auxv. 987c478bd9Sstevel@tonic-gateALLLINTFLAGS = $(LINTFLAGS) \ 997c478bd9Sstevel@tonic-gate -xerroff=E_FUNC_DECL_VAR_ARG2 \ 1007c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL \ 1017c478bd9Sstevel@tonic-gate -xerroff=E_INCONS_ARG_DECL2 \ 102e8ed0869SJohn Beck -xerroff=E_INCONS_ARG_USED2 \ 103e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_DECL2 \ 104e8ed0869SJohn Beck -xerroff=E_INCONS_VAL_TYPE_USED2 1057c478bd9Sstevel@tonic-gate 106d3b5f563SJohn LevonCERRWARN += $(CNOWARN_UNINIT) 1077014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 1087014882cSRichard LoweCERRWARN += -_gcc=-Wno-char-subscripts 1097014882cSRichard LoweCERRWARN += -_gcc=-Wno-clobbered 1107014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 1117014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 1127014882cSRichard Lowe 1137c478bd9Sstevel@tonic-gateMAPFILE = mapfile 114b272bda5SpetedeMAPFILE_INTERMEDIATE = $(MAPFILE).i 1157c478bd9Sstevel@tonic-gateMAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel 1164a1c2431SJonathan AdamsMAPFILE_SOURCES_COMMON = \ 1174a1c2431SJonathan Adams ../../../common/kmdb/kmdb_dpi.h \ 1184a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kctl.h \ 1194a1c2431SJonathan Adams ../../../common/kmdb/kmdb_kdi.h \ 1204a1c2431SJonathan Adams ../../../common/kmdb/kmdb_wr.h \ 1214a1c2431SJonathan Adams ../../../common/mdb/mdb_ctf.h \ 1224a1c2431SJonathan Adams ../../../common/mdb/mdb_ks.h \ 1234a1c2431SJonathan Adams ../../../common/mdb/mdb_modapi.h \ 1244a1c2431SJonathan Adams ../../../common/mdb/mdb_param.h \ 1254a1c2431SJonathan Adams ../../../common/mdb/mdb_whatis.h 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gatemdb_lex.o mdb_grammar.o := CCVERBOSE = 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gatekmdb_ctf_open.o kmdb_ctf_open.ln := CPPFLAGS += -I$(SRC)/common/ctf 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gatePROMTGTS = $(PROMOBJS) $(PROMOBJS:%.o=%.ln) 1327c478bd9Sstevel@tonic-gateVERSTGTS = $(VERSOBJS) $(VERSOBJS:%.o=%.ln) 1337c478bd9Sstevel@tonic-gateKCTLTGTS = $(KCTLOBJS) $(KCTLOBJS:%.o=%.ln) 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate$(PROMTGTS) := CPPFLAGS += -D_BOOT -D_KERNEL -D_MACHDEP $(PROMINCDIRS:%=-I%) \ 1367c478bd9Sstevel@tonic-gate -Dassfail=kmdb_prom_assfail 1377c478bd9Sstevel@tonic-gate 1387c478bd9Sstevel@tonic-gate$(VERSTGTS) := CPPFLAGS += -DKMDB_VERSION='$(KMDB_VERSION)' 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate$(KCTLTGTS) := CPPFLAGS += -D_KERNEL 1417c478bd9Sstevel@tonic-gate$(KCTLTGTS) := ASFLAGS += -D_KERNEL 1427c478bd9Sstevel@tonic-gate 14369bb4bb4Scarlsonjffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs 14469bb4bb4Scarlsonj 1457c478bd9Sstevel@tonic-gate$(ROOTMISC) $(ROOTMISC64) := FILEMODE = 0755 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gateinclude ../../../Makefile.kmdb.targ 148