xref: /titanic_41/usr/src/cmd/mdb/sun4u/v9/kmdb/Makefile (revision 06e46062ef4f5f4b687cbafb4518fb123fe23920)
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/sun4u/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
55#
56# Uncomment the following line to enable trap accounting.  A DTLB translation
57# will be added for the trap table, and each handler installed by KMDB will use
58# its padding to keep a trap count.  See kaif_handlers.s.
59#
60#TRAPCOUNT = -DKMDB_TRAPCOUNT
61
62CPPFLAGS += -I../../../sparc/mdb -I.. -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4u $(TRAPCOUNT)
63CPPFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
64CPPFLAGS += -I$(SRC)/cmd/mdb/sparc
65ASFLAGS += -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4u $(TRAPCOUNT)
66ASFLAGS += -I$(SRC)/cmd/mdb/sparc
67ASFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
68
69install: all $(ROOTMISC64) kaif.fth
70
71#
72# lint rules
73#
74
75.PARALLEL: lintkmdb lintprom lintkctl
76
77lint: lintkmdb lintprom lintkctl
78	$(LINT) $(ALLLINTFLAGS) $(KMDBOBJS:%.o=%.ln) $(PROMOBJS:%.o=%.ln)
79
80lintkmdb: $(KMDBOBJS:%.o=%.ln)
81	$(LINT) $(LINTFLAGS) $(KMDBOBJS:%.o=%.ln)
82
83lintprom: $(PROMOBJS:%.o=%.ln)
84	$(LINT) $(LINTFLAGS) $(PROMOBJS:%.o=%.ln)
85
86lintkctl: $(KCTLOBJS:%.o=%.ln)
87	$(LINT) $(ALLLINTFLAGS) $(KCTLOBJS:%.o=%.ln)
88
89kaif_off.h: ../../../sparc/kmdb/kaif_off.in
90	$(OFFSETS_CREATE) <../../../sparc/kmdb/kaif_off.in >$@
91
92kmdb_context_off.h: ../../../sparc/kmdb/kmdb_context_off.in
93	$(OFFSETS_CREATE) <../../../sparc/kmdb/kmdb_context_off.in >$@
94
95#
96# Dynamic rules for object construction
97#
98%.o: ../../../common/kmdb/%.c
99	$(COMPILE.c) -o $@ $<
100	$(CTFCONVERT_O)
101
102%.o: ../../../common/kmdb/kctl/%.c
103	$(COMPILE.c) -o $@ $<
104	$(CTFCONVERT_O)
105
106%.o: ../../../common/kmdb/kctl/%.s
107	$(COMPILE.s) -o $@ $<
108
109%.o: ../../../common/mdb/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
113%.o: ../../../sparc/kmdb/%.c
114	$(COMPILE.c) -o $@ $<
115	$(CTFCONVERT_O)
116
117%.o: ../../../sparc/kmdb/%.s
118	$(COMPILE.s) -o $@ $<
119
120%.o: ../../../sparc/kmdb/kctl/%.c
121	$(COMPILE.c) -o $@ $<
122	$(CTFCONVERT_O)
123
124%.o: ../../../sparc/kmdb/kctl/%.s
125	$(COMPILE.s) -o $@ $<
126
127%.o: ../../../sparc/mdb/%.c
128	$(COMPILE.c) -o $@ $<
129	$(CTFCONVERT_O)
130
131%.o: ../../../sparc/v9/kmdb/%.c
132	$(COMPILE.c) -o $@ $<
133	$(CTFCONVERT_O)
134
135%.o: ../../../sparc/v9/kmdb/%.s
136	$(COMPILE.s) -o $@ $<
137
138%.o: ../../../sparc/v9/kmdb/kctl/%.s
139	$(COMPILE.s) -o $@ $<
140
141%.o: $(SRC)/common/net/util/%.c
142	$(COMPILE.c) $<
143	$(CTFCONVERT_O)
144
145#
146# Lint
147#
148
149%.ln: ../../../common/kmdb/%.c
150	$(LINT.c) -c $<
151
152%.ln: ../../../common/kmdb/kctl/%.c
153	$(LINT.c) -c $<
154
155%.ln: ../../../common/kmdb/kctl/%.s
156	$(LINT.s) -c $<
157
158%.ln: ../../../common/mdb/%.c
159	$(LINT.c) -c $<
160
161%.ln: ../../../sparc/kmdb/%.c
162	$(LINT.c) -c $<
163
164%.ln: ../../../sparc/kmdb/%.s
165	$(LINT.s) -c $<
166
167%.ln: ../../../sparc/kmdb/kctl/%.c
168	$(LINT.c) -c $<
169
170%.ln: ../../../sparc/kmdb/kctl/%.s
171	$(LINT.s) -c $<
172
173%.ln: ../../../sparc/mdb/%.c
174	$(LINT.c) -c $<
175
176%.ln: ../../../sparc/v9/kmdb/%.c
177	$(LINT.c) -c $<
178
179%.ln: ../../../sparc/v9/kmdb/%.s
180	$(LINT.s) -c $<
181
182%.ln: ../../../sparc/v9/kmdb/kctl/%.s
183	$(LINT.s) -c $<
184
185%.ln: $(SRC)/common/net/util/%.c
186	$(LINT.c) -c $<
187
188#
189# Installation targets
190#
191
192$(ROOT_MISC_DIR) $(ROOT_MISC_DIR_64):
193	-$(INS.dir.root.sys)
194
195$(ROOT_MISC_DIR)/%: 	% $(ROOT_MISC_DIR)
196	$(INS.file)
197
198$(ROOT_MISC_DIR_64)/%:	% $(ROOT_MISC_DIR_64)
199	$(INS.file)
200