xref: /titanic_52/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile (revision 1a7c1b724419d3cb5fa6eea75123c6b2060ba31b)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 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
52KMDB_FPTEST = \
53	$(FINDFP) -x kaif_resume -x kaif_trap_common $@
54
55QTOOLS_ROOT=		$(SPRO_ROOT)/sun4v
56sparc_AS=		$(QTOOLS_ROOT)/qas -xregsym=no
57sparcv9_AS=		$(QTOOLS_ROOT)/qas -xregsym=no
58
59#
60# Uncomment the following line to enable trap accounting.  A DTLB translation
61# will be added for the trap table, and each handler installed by KMDB will use
62# its padding to keep a trap count.  See kaif_handlers.s.
63#
64#TRAPCOUNT = -DKMDB_TRAPCOUNT
65
66CPPFLAGS += -I../../../sparc/mdb -I.. -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v
67CPPFLAGS += $(TRAPCOUNT)
68CPPFLAGS += -Dsun4v
69CPPFLAGS += -I$(SRC)/cmd/mdb/sparc
70CPPFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
71ASFLAGS += -xarch=v9d -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v $(TRAPCOUNT)
72ASFLAGS += -Dsun4v
73ASFLAGS += -I$(SRC)/cmd/mdb/sparc
74ASFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
75
76install: all $(ROOTMISC64) kaif.fth
77
78#
79# lint rules
80#
81
82.PARALLEL: lintkmdb lintprom lintkctl
83
84lint: lintkmdb lintprom lintkctl
85	$(LINT) $(ALLLINTFLAGS) $(KMDBOBJS:%.o=%.ln) $(PROMOBJS:%.o=%.ln)
86
87lintkmdb: $(KMDBOBJS:%.o=%.ln)
88	$(LINT) $(LINTFLAGS) $(KMDBOBJS:%.o=%.ln)
89
90lintprom: $(PROMOBJS:%.o=%.ln)
91	$(LINT) $(LINTFLAGS) $(PROMOBJS:%.o=%.ln)
92
93lintkctl: $(KCTLOBJS:%.o=%.ln)
94	$(LINT) $(ALLLINTFLAGS) $(KCTLOBJS:%.o=%.ln)
95
96kaif_off.h: ../../../sparc/kmdb/kaif_off.in
97	$(OFFSETS_CREATE) <../../../sparc/kmdb/kaif_off.in >$@
98
99kmdb_context_off.h: ../../../sparc/kmdb/kmdb_context_off.in
100	$(OFFSETS_CREATE) <../../../sparc/kmdb/kmdb_context_off.in >$@
101
102#
103# Dynamic rules for object construction
104#
105%.o: ../../../common/kmdb/%.c
106	$(COMPILE.c) -o $@ $<
107	$(CTFCONVERT_O)
108
109%.o: ../../../common/kmdb/kctl/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
113%.o: ../../../common/kmdb/kctl/%.s
114	$(COMPILE.s) -o $@ $<
115
116%.o: ../../../common/mdb/%.c
117	$(COMPILE.c) -o $@ $<
118	$(CTFCONVERT_O)
119
120%.o: ../../../sparc/kmdb/%.c
121	$(COMPILE.c) -o $@ $<
122	$(CTFCONVERT_O)
123
124%.o: ../../../sparc/kmdb/%.s
125	$(COMPILE.s) -o $@ $<
126
127%.o: ../../../sparc/kmdb/kctl/%.c
128	$(COMPILE.c) -o $@ $<
129	$(CTFCONVERT_O)
130
131%.o: ../../../sparc/kmdb/kctl/%.s
132	$(COMPILE.s) -o $@ $<
133
134%.o: ../../../sparc/mdb/%.c
135	$(COMPILE.c) -o $@ $<
136	$(CTFCONVERT_O)
137
138%.o: ../../../sparc/v9/kmdb/%.c
139	$(COMPILE.c) -o $@ $<
140	$(CTFCONVERT_O)
141
142%.o: ../../../sparc/v9/kmdb/%.s
143	$(COMPILE.s) -o $@ $<
144
145%.o: ../../../sparc/v9/kmdb/kctl/%.s
146	$(COMPILE.s) -o $@ $<
147
148%.o: $(SRC)/common/net/util/%.c
149	$(COMPILE.c) $<
150	$(CTFCONVERT_O)
151
152#
153# Lint
154#
155
156%.ln: ../../../common/kmdb/%.c
157	$(LINT.c) -c $<
158
159%.ln: ../../../common/kmdb/kctl/%.c
160	$(LINT.c) -c $<
161
162%.ln: ../../../common/kmdb/kctl/%.s
163	$(LINT.s) -c $<
164
165%.ln: ../../../common/mdb/%.c
166	$(LINT.c) -c $<
167
168%.ln: ../../../sparc/kmdb/%.c
169	$(LINT.c) -c $<
170
171%.ln: ../../../sparc/kmdb/%.s
172	$(LINT.s) -c $<
173
174%.ln: ../../../sparc/kmdb/kctl/%.c
175	$(LINT.c) -c $<
176
177%.ln: ../../../sparc/kmdb/kctl/%.s
178	$(LINT.s) -c $<
179
180%.ln: ../../../sparc/mdb/%.c
181	$(LINT.c) -c $<
182
183%.ln: ../../../sparc/v9/kmdb/%.c
184	$(LINT.c) -c $<
185
186%.ln: ../../../sparc/v9/kmdb/%.s
187	$(LINT.s) -c $<
188
189%.ln: ../../../sparc/v9/kmdb/kctl/%.s
190	$(LINT.s) -c $<
191
192%.ln: $(SRC)/common/net/util/%.c
193	$(LINT.c) -c $<
194
195#
196# Installation targets
197#
198
199$(ROOT_MISC_DIR) $(ROOT_MISC_DIR_64):
200	-$(INS.dir.root.sys)
201
202$(ROOT_MISC_DIR)/%: 	% $(ROOT_MISC_DIR)
203	$(INS.file)
204
205$(ROOT_MISC_DIR_64)/%:	% $(ROOT_MISC_DIR_64)
206	$(INS.file)
207