xref: /titanic_51/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile (revision c090e5dfb10cc96e71e6b0f55bf98c18027b002c)
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
65
66INCDIRS += $(SRC)/uts/i86pc $(SRC)/common/dis/i386
67
68CPPFLAGS += -DDIS_TEXT
69
70install: all $(ROOTMISC64)
71
72#
73# lint rules
74#
75
76.PARALLEL: lintkmdb lintprom lintkctl
77
78lint: lintkmdb lintprom lintkctl
79	$(LINT) $(ALLLINTFLAGS) $(KMDBOBJS:%.o=%.ln) $(PROMOBJS:%.o=%.ln)
80
81lintkmdb: $(KMDBOBJS:%.o=%.ln)
82	$(LINT) $(LINTFLAGS) $(KMDBOBJS:%.o=%.ln)
83
84lintprom: $(PROMOBJS:%.o=%.ln)
85	$(LINT) $(LINTFLAGS) $(PROMOBJS:%.o=%.ln)
86
87lintkctl: $(KCTLOBJS:%.o=%.ln)
88	$(LINT) $(ALLLINTFLAGS) $(KCTLOBJS:%.o=%.ln)
89
90kmdb_context_off.h: ../../kmdb/kmdb_context_off.in
91	$(OFFSETS_CREATE) <../../kmdb/kmdb_context_off.in >$@
92
93#
94# Installation targets
95#
96
97$(ROOT_MISC_DIR) $(ROOT_MISC_DIR_64):
98	-$(INS.dir)
99
100$(ROOT_MISC_DIR)/%: 	% $(ROOT_MISC_DIR)
101	$(INS.file)
102
103$(ROOT_MISC_DIR_64)/%:	% $(ROOT_MISC_DIR_64)
104	$(INS.file)
105