remove xvm/ipagent
[unleashed.git] / usr / src / cmd / mdb / Makefile.mdb
blobac7d36e3601f219bf4ab94ad0df5737a02f3b238
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
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.
32 .KEEP_STATE:
33 .SUFFIXES:
35 SRCS += \
36         ffs.c \
37         mdb.c \
38         mdb_addrvec.c \
39         mdb_argvec.c \
40         mdb_callb.c \
41         mdb_cmdbuf.c \
42         mdb_cmds.c \
43         mdb_conf.c \
44         mdb_context.c \
45         mdb_create.c \
46         mdb_ctf.c \
47         mdb_ctf_open.c \
48         mdb_debug.c \
49         mdb_disasm.c \
50         mdb_dump.c \
51         mdb_err.c \
52         mdb_evset.c \
53         mdb_fdio.c \
54         mdb_fmt.c \
55         mdb_frame.c \
56         mdb_gelf.c \
57         mdb_help.c \
58         mdb_io.c \
59         mdb_kb_kvm.c \
60         mdb_kproc.c \
61         mdb_kvm.c \
62         mdb_logio.c \
63         mdb_list.c \
64         mdb_macalias.c \
65         mdb_main.c \
66         mdb_memio.c \
67         mdb_modapi.c \
68         mdb_module.c \
69         mdb_module_load.c \
70         mdb_nm.c \
71         mdb_nv.c \
72         mdb_pipeio.c \
73         mdb_print.c \
74         mdb_proc.c \
75         mdb_pservice.c \
76         mdb_rawfile.c \
77         mdb_set.c \
78         mdb_shell.c \
79         mdb_signal.c \
80         mdb_stdlib.c \
81         mdb_string.c \
82         mdb_strio.c \
83         mdb_tab.c \
84         mdb_target.c \
85         mdb_tdb.c \
86         mdb_termio.c \
87         mdb_typedef.c \
88         mdb_umem.c \
89         mdb_value.c \
90         mdb_vcb.c \
91         mdb_wcb.c \
92         mdb_whatis.c
94 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
95 CPPFLAGS += -D_MDB -I. -I../.. -I../../../common
97 C99MODE=        $(C99_ENABLE)
99 LDLIBS += -lcurses -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
108 PROG = mdb
109 OBJS = $(SRCS:%.c=%.o) mdb_demangle.o mdb_lex.o mdb_grammar.o
111 LINK = adb
112 ROOTLINK = $(ROOTBIN)/$(LINK)
113 ROOTLINK32 = $(LINK:%=$(ROOTBIN32)/%)
114 ROOTLINK64 = $(LINK:%=$(ROOTBIN64)/%)
116 .NO_PARALLEL:
117 .PARALLEL: $(OBJS)
119 all: $(PROG)
121 $(PROG): $(OBJS)
122         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
123         $(CTFMERGE) -L VERSION -o $@ $(OBJS)
124         $(POST_PROCESS)
126 $(ROOTLINK32): $(ROOTPROG32)
127         $(RM) $@
128         $(LN) $(ROOTPROG32) $@
130 $(ROOTLINK64): $(ROOTPROG64)
131         $(RM) $@
132         $(LN) $(ROOTPROG64) $@
134 mdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
135         $(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
137 mdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
138         $(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
139         @$(MV) y.tab.h mdb_grammar.h
140         @$(MV) y.tab.c mdb_grammar.c
142 mdb_conf.o := CPPFLAGS += -DMDB_VERSION='$(MDB_VERSION)'
144 inet_ntop.o := CPPFLAGS += -Dsnprintf=mdb_snprintf
146 ffs.o ffs.ln := CPPFLAGS += -Dffs=mdb_ffs
148 %.o: ../../../common/mdb/%.c
149         $(COMPILE.c) $<
150         $(CTFCONVERT_O)
152 # cxxabi.h is easiest to get into header search path by just using c++ for the
153 # one object that needs it (mdb_demangle.o), but we need to make sure to avoid
154 # a libstdc++ link-time dependency
155 %.o: ../../../common/mdb/%.cc
156         $(COMPILE.cc) -fno-rtti -fno-exceptions $<
157         $(CTFCONVERT_O)
159 %.o: ../../mdb/%.c
160         $(COMPILE.c) $<
161         $(CTFCONVERT_O)
163 %.o: %.c
164         $(COMPILE.c) $<
165         $(CTFCONVERT_O)
167 %.o: $(SRC)/common/net/util/%.c
168         $(COMPILE.c) $<
169         $(CTFCONVERT_O)
171 %.o: $(SRC)/common/util/%.c
172         $(COMPILE.c) $<
173         $(CTFCONVERT_O)
175 clean:
176         $(RM) $(OBJS)
177         $(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
179 clobber: clean
180         $(RM) $(PROG)
182 dmods: