xref: /titanic_44/usr/src/cmd/dtrace/test/cmd/jdtrace/Makefile (revision 4eaa471005973e11a6110b69fe990530b3b95a38)
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#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27
28PROG = jdtrace
29SRCS = jdtrace.c
30
31include $(SRC)/cmd/Makefile.cmd
32
33ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
34ROOTBIN = $(ROOTOPTPKG)/bin
35ROOTLIB = $(ROOTOPTPKG)/lib
36ROOTLIBJAVA = $(ROOTLIB)/java
37
38# Use the proto dtrace.jar if it exists, otherwise use whatever is
39# installed on the system. It should be possible to build
40# usr/src/cmd/dtrace/test independently, even if only on systems that
41# have a compatible dtrace.jar installed.
42DTRACE_JAR=usr/share/lib/java/dtrace.jar
43PROTO_DTRACE_JAR=$(ROOT)/$(DTRACE_JAR)
44INSTALLED_DTRACE_JAR=/$(DTRACE_JAR)
45CLASSPATH=$(PROTO_DTRACE_JAR):$(INSTALLED_DTRACE_JAR)
46DTEST_DIR=$(SRC)/cmd/dtrace/test
47CLASSDIR=classes
48LIBDIR=lib
49MANIFESTDIR=manifest
50MANIFEST=$(MANIFESTDIR)/jdtrace.jar-manifest
51JDTRACE_JAR=$(LIBDIR)/jdtrace.jar
52
53PROTO_JDTRACE_JAR=$(ROOTLIBJAVA)/jdtrace.jar
54CMD = $(ROOTBIN)/jdtrace
55XLIST = $(ROOTBIN)/exception.lst
56
57$(PROTO_JDTRACE_JAR) := FILEMODE = 0644
58$(CMD) := FILEMODE = 0555
59$(XLIST) := FILEMODE = 0444
60
61all: $(JDTRACE_JAR) $(PROG)
62
63clean:
64	-$(RM) $(CLASSDIR)/*.class
65
66clobber: clean
67	-$(RM) $(JDTRACE_JAR)
68	-$(RM) $(PROG)
69
70lint:
71
72install: all $(PROTO_JDTRACE_JAR) $(CMD) $(XLIST)
73
74$(PROG): $(SRCS)
75	$(LINK.c) -o $@ $(SRCS) $(LDLIBS)
76	$(POST_PROCESS) ; $(STRIP_STABS)
77
78JFLAGS= -g -cp $(CLASSPATH) -d $(CLASSDIR) -deprecation
79JFLAGS += -target 1.5
80JFLAGS += -Xlint
81COMPILE.java=$(JAVAC) $(JFLAGS)
82JAVASRC= JDTrace.java Getopt.java
83
84$(JDTRACE_JAR): $(JAVASRC)
85	@mkdir -p $(CLASSDIR)
86	@mkdir -p $(LIBDIR)
87	$(COMPILE.java) $(JAVASRC)
88	$(JAR) -cmf $(MANIFEST) $(JDTRACE_JAR) -C $(CLASSDIR) .
89
90$(PROTO_JDTRACE_JAR): $(ROOTLIBJAVA)
91
92$(CMD): $(ROOTBIN)
93
94$(XLIST): $(ROOTBIN)
95
96$(ROOTBIN):
97	$(INS.dir)
98
99$(ROOTLIB):
100	$(INS.dir)
101
102$(ROOTLIBJAVA): $(ROOTLIB)
103	$(INS.dir)
104
105$(ROOTLIBJAVA)/%.jar: $(LIBDIR)/%.jar
106	$(INS.file)
107
108$(ROOTBIN)/%: %
109	$(INS.file)
110