xref: /titanic_50/usr/src/cmd/mdb/sun4u/v9/kmdb/Makefile (revision b56bf881a9655cb27b53cba1468312f7c6dfb0a2)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26
27all: $(PROG)
28
29%.o: ../../../sparc/mdb/%.c
30	$(COMPILE.c) $<
31	$(CTFCONVERT_O)
32
33%.ln: ../../../sparc/mdb/%.c
34	$(LINT.c) -c $<
35
36kaif.fth: ../../../sparc/v9/kmdb/kaif_regs.h
37
38ROOT_MISC_DIR		= $(ROOT)/platform/sun4u/kernel/misc
39ROOT_MISC_DIR_64	= $(ROOT_MISC_DIR)/$(SUBDIR64)
40
41ROOTMISC		= $(ROOT_MISC_DIR)/$(PROG)
42ROOTMISC64		= $(ROOT_MISC_DIR_64)/$(PROG)
43
44include ../../../../Makefile.cmd
45include ../../../../Makefile.cmd.64
46include ../../../sparc/Makefile.sparcv9
47include ../../../sparc/Makefile.kmdb.64
48include ../../../Makefile.kmdb
49
50STANDLIBS += $(ROOT)/usr/lib/sparcv9/libstanddisasm.so
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)
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