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