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.
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.
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]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 include $(SRC
)/Makefile.master
29 # The Java DTrace API package
31 PKGPATH
=org
/opensolaris
/os
/dtrace
32 PKGNAME
=org.opensolaris.os.dtrace
34 # The Java DTrace API directories
36 APIDIR
=$(SRC
)/lib
/libdtrace_jni
/java
37 CLASSES
=$(APIDIR
)/classes
42 DOCEXAMPLES
=$(DOCS
)/examples
44 DOCIMAGES
=$(DOCS
)/images
45 MANIFEST
=$(APIDIR
)/manifest
46 APIJAVASRC
=$(APIDIR
)/src
48 # Java DTrace API jar file, its ultimate destination, and packaging details
50 JARDESTDIR
=$(ROOT
)/usr
/share
/lib
/java
51 INSJARS
=$(JARDESTDIR
)/$(APIJAR
)
53 DOCDESTDIR
=$(ROOT
)/usr
/share
/lib
/java
/javadoc
/dtrace
54 DOCAPIDESTDIR
=$(DOCDESTDIR
)/api
55 DOCEXAMPLESDESTDIR
=$(DOCDESTDIR
)/examples
56 DOCHTMLDESTDIR
=$(DOCDESTDIR
)/html
57 DOCIMAGESDESTDIR
=$(DOCDESTDIR
)/images
58 $(BLD_JAVA_8
)XDOCLINT_OPTION
=-Xdoclint
:none
60 $(JARDESTDIR
)/%: $(JARS
)/%
63 $(DOCEXAMPLESDESTDIR
)/%: $(DOCEXAMPLES
)/%
66 $(DOCHTMLDESTDIR
)/%: $(DOCHTML
)/%
69 $(DOCIMAGESDESTDIR
)/%: $(DOCIMAGES
)/%
73 APIMANI
= $(MANIFEST
)/dtrace.mf
76 # Controlled CLASSPATH for making
77 APICLASSPATH
=$(CLASSES
):$(APIJAVASRC
)
80 JFLAGS
= -g
-d
$(CLASSES
) -sourcepath
$(APICLASSPATH
)
81 JFLAGS
+= -source
1.5 -target
1.6
82 JFLAGS
+= -Xlint
:all,-rawtypes
,-options
84 # The default make rule for Java files
85 COMPILE.java
=$(JAVAC
) $(JFLAGS
)
87 $(CLASSES
)/$(PKGPATH
)/%.class
: $(APIJAVASRC
)/$(PKGPATH
)/%.java
90 # javah generated headers
91 APIHDR
= LocalConsumer.h
92 JNIHDRS
=$(JNI
)/$(APIHDR
)
94 # API classes with native methods
98 JNI_CLASSES
=${JNI_CLASSNAMES
:%=%.class
}
99 DTRACE_JNI_CLASSES
=${JNI_CLASSES
:%=$(CLASSES
)/$(PKGPATH
)/%}
100 JNI_FULL_CLASSNAMES
=${JNI_CLASSNAMES
:%=$(PKGNAME
).
%}
104 AbstractAggregationValue \
127 InterfaceAttributes \
133 LogLinearDistribution \
149 ResourceLimitException \
162 API_CLASSES
=${API_CLASSNAMES
:%=%.class
}
163 DTRACE_API_CLASSES
=${API_CLASSES
:%=$(CLASSES
)/$(PKGPATH
)/%}
166 all: $(CLASSES
) $(DTRACE_API_CLASSES
) $(JNI
)/$(APIHDR
)
169 -$(RM
) $(CLASSES
)/$(PKGPATH
)/*.class
176 # Make the class dir, if it doesn't exist
180 # Make the directory for javah-generated headers, if it doesn't exist
184 $(JNI
)/$(APIHDR
): $(JNI
) $(DTRACE_JNI_CLASSES
)
185 $(JAVAH
) -o
$@
-classpath
$(CLASSES
) $(JNI_FULL_CLASSNAMES
)
188 # Rule for installing API javadoc.
189 $(DOCAPIDESTDIR
)/index.html
: $(DTRACE_API_CLASSES
)
190 -@mkdir
-p
$(DOCAPIDESTDIR
)
191 -$(RM
) -r
$(DOCAPIDESTDIR
)/*
192 cd
$(APIJAVASRC
); umask
022; \
193 $(JAVADOC
) -protected
-use
-notimestamp
$(XDOCLINT_OPTION
) \
194 -classpath
$(APICLASSPATH
) -d
$(DOCAPIDESTDIR
) \
197 $(CLASSES
)/$(PKGPATH
):
200 $(JARS
)/$(APIJAR
): $(DTRACE_API_CLASSES
) $(APIMANI
)
202 $(JAR
) cfm
$@
$(APIMANI
) -C
$(CLASSES
) .
213 $(DOCEXAMPLESDESTDIR
):
222 install: all $(JARDESTDIR
) $(INSJARS
) $(DOCDESTDIR
) \
224 $(DOCAPIDESTDIR
)/index.html \
225 $(DOCEXAMPLESDESTDIR
) \
226 $(DOCEXAMPLESDESTDIR
)/TestAPI.java \
227 $(DOCEXAMPLESDESTDIR
)/TestAPI2.java \
228 $(DOCEXAMPLESDESTDIR
)/TestTarget.java \
229 $(DOCEXAMPLESDESTDIR
)/hello.d \
230 $(DOCEXAMPLESDESTDIR
)/intrstat.d \
231 $(DOCEXAMPLESDESTDIR
)/syscall.d \
232 $(DOCEXAMPLESDESTDIR
)/target.d \
234 $(DOCHTMLDESTDIR
)/JavaDTraceAPI.html \
235 $(DOCHTMLDESTDIR
)/fast.html \
236 $(DOCIMAGESDESTDIR
) \
237 $(DOCIMAGESDESTDIR
)/JavaDTraceAPI.gif
239 # empty targets for top-level building compatability
247 cd
$(APIJAVASRC
); umask
022; \
248 $(JAVADOC
) -protected
-use
-notimestamp \
249 -classpath
$(APICLASSPATH
) -d
$(DOCAPI
) \