123b5c24tomee#
223b5c24tomee# CDDL HEADER START
323b5c24tomee#
423b5c24tomee# The contents of this file are subject to the terms of the
523b5c24tomee# Common Development and Distribution License (the "License").
623b5c24tomee# You may not use this file except in compliance with the License.
723b5c24tomee#
823b5c24tomee# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
923b5c24tomee# or http://www.opensolaris.org/os/licensing.
1023b5c24tomee# See the License for the specific language governing permissions
1123b5c24tomee# and limitations under the License.
1223b5c24tomee#
1323b5c24tomee# When distributing Covered Code, include this CDDL HEADER in each
1423b5c24tomee# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1523b5c24tomee# If applicable, add the following below this CDDL HEADER, with the
1623b5c24tomee# fields enclosed by brackets "[]" replaced with your own identifying
1723b5c24tomee# information: Portions Copyright [yyyy] [name of copyright owner]
1823b5c24tomee#
1923b5c24tomee# CDDL HEADER END
2023b5c24tomee#
2123b5c24tomee
2223b5c24tomee#
23e77b06dtomee# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2423b5c24tomee# Use is subject to license terms.
2523b5c24tomee#
2623b5c24tomee
2773427c5ahlPROG = jdtrace
2873427c5ahlSRCS = jdtrace.c
2973427c5ahl
3073427c5ahlinclude $(SRC)/cmd/Makefile.cmd
3123b5c24tomee
3223b5c24tomeeROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
3323b5c24tomeeROOTBIN = $(ROOTOPTPKG)/bin
3423b5c24tomeeROOTLIB = $(ROOTOPTPKG)/lib
3523b5c24tomeeROOTLIBJAVA = $(ROOTLIB)/java
3623b5c24tomee
3723b5c24tomee# Use the proto dtrace.jar if it exists, otherwise use whatever is
3823b5c24tomee# installed on the system. It should be possible to build
3923b5c24tomee# usr/src/cmd/dtrace/test independently, even if only on systems that
4023b5c24tomee# have a compatible dtrace.jar installed.
4123b5c24tomeeDTRACE_JAR=usr/share/lib/java/dtrace.jar
4223b5c24tomeePROTO_DTRACE_JAR=$(ROOT)/$(DTRACE_JAR)
4323b5c24tomeeINSTALLED_DTRACE_JAR=/$(DTRACE_JAR)
4423b5c24tomeeCLASSPATH=$(PROTO_DTRACE_JAR):$(INSTALLED_DTRACE_JAR)
4523b5c24tomeeDTEST_DIR=$(SRC)/cmd/dtrace/test
4623b5c24tomeeCLASSDIR=classes
4723b5c24tomeeLIBDIR=lib
4823b5c24tomeeMANIFESTDIR=manifest
4923b5c24tomeeMANIFEST=$(MANIFESTDIR)/jdtrace.jar-manifest
5023b5c24tomeeJDTRACE_JAR=$(LIBDIR)/jdtrace.jar
5123b5c24tomee
52e642872qiaoPROTO_JDTRACE_JAR=$(ROOTLIBJAVA)/jdtrace.jar
5323b5c24tomeeCMD = $(ROOTBIN)/jdtrace
5423b5c24tomeeXLIST = $(ROOTBIN)/exception.lst
5523b5c24tomee
5673427c5ahl$(PROTO_JDTRACE_JAR) := FILEMODE = 0644
5723b5c24tomee$(CMD) := FILEMODE = 0555
5873427c5ahl$(XLIST) := FILEMODE = 0444
5923b5c24tomee
6073427c5ahlall: $(JDTRACE_JAR) $(PROG)
6123b5c24tomee
6223b5c24tomeeclean:
6373427c5ahl	-$(RM) $(CLASSDIR)/*.class
6423b5c24tomee
6523b5c24tomeeclobber: clean
6673427c5ahl	-$(RM) $(JDTRACE_JAR)
6773427c5ahl	-$(RM) $(PROG)
6823b5c24tomee
69e642872qiaoinstall: all $(PROTO_JDTRACE_JAR) $(CMD) $(XLIST)
7023b5c24tomee
7173427c5ahl$(PROG): $(SRCS)
7273427c5ahl	$(LINK.c) -o $@ $(SRCS) $(LDLIBS)
7373427c5ahl	$(POST_PROCESS) ; $(STRIP_STABS)
7423b5c24tomee
754d0eb50Richard PALOJFLAGS= -g -cp $(CLASSPATH) -d $(CLASSDIR)
7651396a8Peter TribbleJFLAGS += -source 7 -target 7 -Xlint:all,-options
77e77b06dtomeeCOMPILE.java=$(JAVAC) $(JFLAGS)
78e77b06dtomeeJAVASRC= JDTrace.java Getopt.java
79e77b06dtomee
80e77b06dtomee$(JDTRACE_JAR): $(JAVASRC)
81e642872qiao	@mkdir -p $(CLASSDIR)
82e642872qiao	@mkdir -p $(LIBDIR)
83e77b06dtomee	$(COMPILE.java) $(JAVASRC)
84e642872qiao	$(JAR) -cmf $(MANIFEST) $(JDTRACE_JAR) -C $(CLASSDIR) .
8523b5c24tomee
86e642872qiao$(PROTO_JDTRACE_JAR): $(ROOTLIBJAVA)
8723b5c24tomee
8823b5c24tomee$(CMD): $(ROOTBIN)
8923b5c24tomee
9023b5c24tomee$(XLIST): $(ROOTBIN)
9123b5c24tomee
9223b5c24tomee$(ROOTBIN):
9323b5c24tomee	$(INS.dir)
9423b5c24tomee
9523b5c24tomee$(ROOTLIB):
9623b5c24tomee	$(INS.dir)
9723b5c24tomee
9823b5c24tomee$(ROOTLIBJAVA): $(ROOTLIB)
9923b5c24tomee	$(INS.dir)
10023b5c24tomee
10123b5c24tomee$(ROOTLIBJAVA)/%.jar: $(LIBDIR)/%.jar
10223b5c24tomee	$(INS.file)
10323b5c24tomee
10473427c5ahl$(ROOTBIN)/%: %
10523b5c24tomee	$(INS.file)
106