xref: /illumos-gate/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile (revision 856f710c9dc323b39da5935194d7928ffb99b67f)
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#
27# Build and link kmdb
28#
29all: $(PROG) kmdb_modlinktest.o
30
31%.o: ../../kmdb/%.c
32	$(COMPILE.c) $<
33	$(CTFCONVERT_O)
34
35%.o: ../../mdb/%.c
36	$(COMPILE.c) $<
37	$(CTFCONVERT_O)
38
39%.o: $(SRC)/common/dis/i386/%.c
40	$(COMPILE.c) $<
41	$(CTFCONVERT_O)
42
43%.ln: ../../kmdb/%.c
44	$(LINT.c) -c $<
45
46%.ln: ../../mdb/%.c
47	$(LINT.c) -c $<
48
49%.ln: $(SRC)/common/dis/i386/%.c
50	$(LINT.c) -c $<
51
52ROOT_MISC_DIR		= $(ROOT)/kernel/misc
53ROOT_MISC_DIR_64	= $(ROOT_MISC_DIR)/$(SUBDIR64)
54
55ROOTMISC		= $(ROOT_MISC_DIR)/$(PROG)
56ROOTMISC64		= $(ROOT_MISC_DIR_64)/$(PROG)
57
58include ../../../../Makefile.cmd
59include ../../../../Makefile.cmd.64
60
61include ../../Makefile.amd64
62include ../../../Makefile.kmdb
63
64STANDLIBS += $(ROOT)/usr/lib/amd64/libstanddisasm.so
65STANDLIBS += $(ROOT)/usr/lib/amd64/libstandsaveargs.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)
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