xref: /titanic_41/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile (revision 4051d170f2f092f2a9f75c975307adfddfed4a67)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28all: $(PROG)
29
30%.o: ../../../sparc/mdb/%.c
31	$(COMPILE.c) $<
32	$(CTFCONVERT_O)
33
34%.ln: ../../../sparc/mdb/%.c
35	$(LINT.c) -c $<
36
37kaif.fth: ../../../sparc/v9/kmdb/kaif_regs.h
38
39ROOT_MISC_DIR		= $(ROOT)/platform/sun4v/kernel/misc
40ROOT_MISC_DIR_64	= $(ROOT_MISC_DIR)/$(SUBDIR64)
41
42ROOTMISC		= $(ROOT_MISC_DIR)/$(PROG)
43ROOTMISC64		= $(ROOT_MISC_DIR_64)/$(PROG)
44
45include ../../../../Makefile.cmd
46include ../../../../Makefile.cmd.64
47include ../../../sparc/Makefile.sparcv9
48include ../../../sparc/Makefile.kmdb.64
49include ../../../Makefile.kmdb
50
51STANDLIBS += $(ROOT)/usr/lib/sparcv9/libstanddisasm.so
52
53KMDB_FPTEST = \
54	$(FINDFP) -x kaif_resume -x kaif_trap_common $@
55
56#
57# Uncomment the following line to enable trap accounting.  A DTLB translation
58# will be added for the trap table, and each handler installed by KMDB will use
59# its padding to keep a trap count.  See kaif_handlers.s.
60#
61#TRAPCOUNT = -DKMDB_TRAPCOUNT
62
63CPPFLAGS += -I../../../sparc/mdb -I.. -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v
64CPPFLAGS += $(TRAPCOUNT)
65CPPFLAGS += -Dsun4v
66CPPFLAGS += -I$(SRC)/cmd/mdb/sparc
67CPPFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
68ASFLAGS += -xarch=v9v -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v $(TRAPCOUNT)
69ASFLAGS += -Dsun4v
70ASFLAGS += -I$(SRC)/cmd/mdb/sparc
71ASFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
72
73install: all $(ROOTMISC64) kaif.fth
74
75#
76# lint rules
77#
78
79.PARALLEL: lintkmdb lintprom lintkctl
80
81lint: lintkmdb lintprom lintkctl
82	$(LINT) $(ALLLINTFLAGS) $(KMDBOBJS:%.o=%.ln) $(PROMOBJS:%.o=%.ln)
83
84lintkmdb: $(KMDBOBJS:%.o=%.ln)
85	$(LINT) $(LINTFLAGS) $(KMDBOBJS:%.o=%.ln)
86
87lintprom: $(PROMOBJS:%.o=%.ln)
88	$(LINT) $(LINTFLAGS) $(PROMOBJS:%.o=%.ln)
89
90lintkctl: $(KCTLOBJS:%.o=%.ln)
91	$(LINT) $(ALLLINTFLAGS) $(KCTLOBJS:%.o=%.ln)
92
93kaif_off.h: ../../../sparc/kmdb/kaif_off.in
94	$(OFFSETS_CREATE) <../../../sparc/kmdb/kaif_off.in >$@
95
96kmdb_context_off.h: ../../../sparc/kmdb/kmdb_context_off.in
97	$(OFFSETS_CREATE) <../../../sparc/kmdb/kmdb_context_off.in >$@
98
99#
100# Dynamic rules for object construction
101#
102%.o: ../../../common/kmdb/%.c
103	$(COMPILE.c) -o $@ $<
104	$(CTFCONVERT_O)
105
106%.o: ../../../common/kmdb/kctl/%.c
107	$(COMPILE.c) -o $@ $<
108	$(CTFCONVERT_O)
109
110%.o: ../../../common/kmdb/kctl/%.s
111	$(COMPILE.s) -o $@ $<
112
113%.o: ../../../common/mdb/%.c
114	$(COMPILE.c) -o $@ $<
115	$(CTFCONVERT_O)
116
117%.o: ../../../sparc/kmdb/%.c
118	$(COMPILE.c) -o $@ $<
119	$(CTFCONVERT_O)
120
121%.o: ../../../sparc/kmdb/%.s
122	$(COMPILE.s) -o $@ $<
123
124%.o: ../../../sparc/kmdb/kctl/%.c
125	$(COMPILE.c) -o $@ $<
126	$(CTFCONVERT_O)
127
128%.o: ../../../sparc/kmdb/kctl/%.s
129	$(COMPILE.s) -o $@ $<
130
131%.o: ../../../sparc/mdb/%.c
132	$(COMPILE.c) -o $@ $<
133	$(CTFCONVERT_O)
134
135%.o: ../../../sparc/v9/kmdb/%.c
136	$(COMPILE.c) -o $@ $<
137	$(CTFCONVERT_O)
138
139%.o: ../../../sparc/v9/kmdb/%.s
140	$(COMPILE.s) -o $@ $<
141
142%.o: ../../../sparc/v9/kmdb/kctl/%.s
143	$(COMPILE.s) -o $@ $<
144
145%.o: $(SRC)/common/net/util/%.c
146	$(COMPILE.c) $<
147	$(CTFCONVERT_O)
148
149#
150# Lint
151#
152
153%.ln: ../../../common/kmdb/%.c
154	$(LINT.c) -c $<
155
156%.ln: ../../../common/kmdb/kctl/%.c
157	$(LINT.c) -c $<
158
159%.ln: ../../../common/kmdb/kctl/%.s
160	$(LINT.s) -c $<
161
162%.ln: ../../../common/mdb/%.c
163	$(LINT.c) -c $<
164
165%.ln: ../../../sparc/kmdb/%.c
166	$(LINT.c) -c $<
167
168%.ln: ../../../sparc/kmdb/%.s
169	$(LINT.s) -c $<
170
171%.ln: ../../../sparc/kmdb/kctl/%.c
172	$(LINT.c) -c $<
173
174%.ln: ../../../sparc/kmdb/kctl/%.s
175	$(LINT.s) -c $<
176
177%.ln: ../../../sparc/mdb/%.c
178	$(LINT.c) -c $<
179
180%.ln: ../../../sparc/v9/kmdb/%.c
181	$(LINT.c) -c $<
182
183%.ln: ../../../sparc/v9/kmdb/%.s
184	$(LINT.s) -c $<
185
186%.ln: ../../../sparc/v9/kmdb/kctl/%.s
187	$(LINT.s) -c $<
188
189%.ln: $(SRC)/common/net/util/%.c
190	$(LINT.c) -c $<
191
192#
193# Installation targets
194#
195
196$(ROOT_MISC_DIR) $(ROOT_MISC_DIR_64):
197	-$(INS.dir.root.sys)
198
199$(ROOT_MISC_DIR)/%: 	% $(ROOT_MISC_DIR)
200	$(INS.file)
201
202$(ROOT_MISC_DIR_64)/%:	% $(ROOT_MISC_DIR_64)
203	$(INS.file)
204