4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
27 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
28 # Copyright (c) 2012 by Delphix. All rights reserved.
29 # Copyright (c) 2012 Joyent, Inc. All rights reserved.
94 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
95 CPPFLAGS += -D_MDB -I. -I../.. -I../../../common
97 C99MODE= $(C99_ENABLE)
99 LDLIBS += -lncurses -lkvm -lproc -lrtld_db -lctf -lumem -ldisasm -lscf
101 CERRWARN += -Wno-uninitialized
102 CERRWARN += -Wno-char-subscripts
103 CERRWARN += -Wno-clobbered
104 CERRWARN += -Wno-parentheses
105 CERRWARN += -Wno-unused-label
106 CERRWARN += -Wno-unused-variable
107 CERRWARN += -Wno-implicit-function-declaration
110 OBJS = $(SRCS:%.c=%.o) mdb_demangle.o mdb_lex.o mdb_grammar.o
113 ROOTLINK = $(ROOTBIN)/$(LINK)
114 ROOTLINK32 = $(LINK:%=$(ROOTBIN32)/%)
115 ROOTLINK64 = $(LINK:%=$(ROOTBIN64)/%)
123 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
124 $(CTFMERGE) -L VERSION -o $@ $(OBJS)
127 $(ROOTLINK32): $(ROOTPROG32)
129 $(LN) $(ROOTPROG32) $@
131 $(ROOTLINK64): $(ROOTPROG64)
133 $(LN) $(ROOTPROG64) $@
135 mdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
136 $(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
138 mdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
139 $(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
140 @$(MV) y.tab.h mdb_grammar.h
141 @$(MV) y.tab.c mdb_grammar.c
143 mdb_conf.o := CPPFLAGS += -DMDB_VERSION='$(MDB_VERSION)'
145 inet_ntop.o := CPPFLAGS += -Dsnprintf=mdb_snprintf
147 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
149 %.o: ../../../common/mdb/%.c
153 # cxxabi.h is easiest to get into header search path by just using c++ for the
154 # one object that needs it (mdb_demangle.o), but we need to make sure to avoid
155 # a libstdc++ link-time dependency
156 %.o: ../../../common/mdb/%.cc
157 $(COMPILE.cc) -fno-rtti -fno-exceptions $<
168 %.o: $(SRC)/common/net/util/%.c
172 %.o: $(SRC)/common/util/%.c
178 $(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output