xref: /titanic_41/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile (revision e802abbda8c322f24d47835734f4a793ef15ddc8)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26
27#
28# Build and link kmdb
29#
30all: $(PROG) kmdb_modlinktest.o
31
32%.o: ../../kmdb/%.c
33	$(COMPILE.c) $<
34	$(CTFCONVERT_O)
35
36%.o: ../../mdb/%.c
37	$(COMPILE.c) $<
38	$(CTFCONVERT_O)
39
40%.o: $(SRC)/common/dis/i386/%.c
41	$(COMPILE.c) $<
42	$(CTFCONVERT_O)
43
44%.ln: ../../kmdb/%.c
45	$(LINT.c) -c $<
46
47%.ln: ../../mdb/%.c
48	$(LINT.c) -c $<
49
50%.ln: $(SRC)/common/dis/i386/%.c
51	$(LINT.c) -c $<
52
53ROOT_MISC_DIR		= $(ROOT)/kernel/misc
54ROOT_MISC_DIR_64	= $(ROOT_MISC_DIR)/$(SUBDIR64)
55
56ROOTMISC		= $(ROOT_MISC_DIR)/$(PROG)
57ROOTMISC64		= $(ROOT_MISC_DIR_64)/$(PROG)
58
59include ../../../../Makefile.cmd
60include ../../../../Makefile.cmd.64
61
62include ../../Makefile.amd64
63include ../../../Makefile.kmdb
64
65STANDLIBS += $(ROOT)/usr/lib/amd64/libstanddisasm.so
66
67INCDIRS += $(SRC)/uts/i86pc $(SRC)/common/dis/i386
68
69CPPFLAGS += -DDIS_TEXT
70
71install: all $(ROOTMISC64)
72
73#
74# lint rules
75#
76
77.PARALLEL: lintkmdb lintprom lintkctl
78
79lint: lintkmdb lintprom lintkctl
80	$(LINT) $(ALLLINTFLAGS) $(KMDBOBJS:%.o=%.ln) $(PROMOBJS:%.o=%.ln)
81
82lintkmdb: $(KMDBOBJS:%.o=%.ln)
83	$(LINT) $(LINTFLAGS) $(KMDBOBJS:%.o=%.ln)
84
85lintprom: $(PROMOBJS:%.o=%.ln)
86	$(LINT) $(LINTFLAGS) $(PROMOBJS:%.o=%.ln)
87
88lintkctl: $(KCTLOBJS:%.o=%.ln)
89	$(LINT) $(ALLLINTFLAGS) $(KCTLOBJS:%.o=%.ln)
90
91kmdb_context_off.h: ../../kmdb/kmdb_context_off.in
92	$(OFFSETS_CREATE) <../../kmdb/kmdb_context_off.in >$@
93
94#
95# Installation targets
96#
97
98$(ROOT_MISC_DIR) $(ROOT_MISC_DIR_64):
99	-$(INS.dir.root.sys)
100
101$(ROOT_MISC_DIR)/%: 	% $(ROOT_MISC_DIR)
102	$(INS.file)
103
104$(ROOT_MISC_DIR_64)/%:	% $(ROOT_MISC_DIR_64)
105	$(INS.file)
106