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.
95 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
96 CPPFLAGS += -D_MDB -I. -I../.. -I../../../common
101 LDLIBS += -lcurses -lkvm -lproc -lrtld_db -lctf -lumem -ldisasm -lscf
103 CERRWARN += -_gcc=-Wno-uninitialized
104 CERRWARN += -_gcc=-Wno-char-subscripts
105 CERRWARN += -_gcc=-Wno-clobbered
106 CERRWARN += -_gcc=-Wno-parentheses
107 CERRWARN += -_gcc=-Wno-unused-label
108 CERRWARN += -_gcc=-Wno-unused-variable
111 # -erroff=E_INCONS_ARG_DECL2 works around a problem where lint gets confused
112 # about how struct mdb_tgt_gregset is used in mdb_tgt_stack_f() and
113 # mdb_tgt_stack_iter_f(). Will be resolved as part of fix for CR 6749868.
115 LINTFLAGS += -n -errtags=yes -erroff=E_INCONS_ARG_DECL2
116 LINTFILES = $(SRCS:%.c=%.ln)
119 OBJS = $(SRCS:%.c=%.o) mdb_lex.o mdb_grammar.o
122 ROOTLINK = $(ROOTBIN)/$(LINK)
123 ROOTLINK32 = $(LINK:%=$(ROOTBIN32)/%)
124 ROOTLINK64 = $(LINK:%=$(ROOTBIN64)/%)
127 .PARALLEL: $(OBJS) $(LINTFILES)
132 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
133 $(CTFMERGE) -L VERSION -o $@ $(OBJS)
136 $(ROOTLINK32): $(ROOTPROG32)
138 $(LN) $(ROOTPROG32) $@
140 $(ROOTLINK64): $(ROOTPROG64)
142 $(LN) $(ROOTPROG64) $@
144 mdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
145 $(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
147 mdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
148 $(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
149 @$(MV) y.tab.h mdb_grammar.h
150 @$(MV) y.tab.c mdb_grammar.c
152 mdb_lex.o mdb_grammar.o := CCVERBOSE =
154 mdb_conf.o := CPPFLAGS += -DMDB_VERSION='$(MDB_VERSION)'
156 inet_ntop.o := CPPFLAGS += -Dsnprintf=mdb_snprintf
158 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
160 %.o: ../../../common/mdb/%.c
172 %.o: $(SRC)/common/net/util/%.c
176 %.o: $(SRC)/common/util/%.c
185 $(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
187 clobber: clean clean.lint
190 %.ln: ../../../common/mdb/%.c
199 %.ln: $(SRC)/common/net/util/%.c
202 %.ln: $(SRC)/common/util/%.c
206 $(LINT) $(LINTFLAGS) $(LINTFILES)