1 | #
|
---|
2 | # Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
|
---|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
---|
4 | #
|
---|
5 | # This code is free software; you can redistribute it and/or modify it
|
---|
6 | # under the terms of the GNU General Public License version 2 only, as
|
---|
7 | # published by the Free Software Foundation.
|
---|
8 | #
|
---|
9 | # This code is distributed in the hope that it will be useful, but WITHOUT
|
---|
10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
---|
12 | # version 2 for more details (a copy is included in the LICENSE file that
|
---|
13 | # accompanied this code).
|
---|
14 | #
|
---|
15 | # You should have received a copy of the GNU General Public License version
|
---|
16 | # 2 along with this work; if not, write to the Free Software Foundation,
|
---|
17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
18 | #
|
---|
19 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
---|
20 | # CA 95054 USA or visit www.sun.com if you need additional information or
|
---|
21 | # have any questions.
|
---|
22 | #
|
---|
23 | #
|
---|
24 |
|
---|
25 | # This makefile is used to build Serviceability Agent code
|
---|
26 | # and generate JNI header file for native methods.
|
---|
27 |
|
---|
28 | AGENT_DIR = $(WorkSpace)/agent
|
---|
29 | checkAndBuildSA::
|
---|
30 |
|
---|
31 | ifneq ($(BUILD_OS2_SA),1)
|
---|
32 | # Already warned about this in build.make
|
---|
33 | else
|
---|
34 |
|
---|
35 | # This first part is used to build sa-jdi.jar
|
---|
36 | include $(WorkSpace)/make/os2/makefiles/rules.make
|
---|
37 | include $(WorkSpace)/make/sa.files
|
---|
38 |
|
---|
39 | GENERATED = ../generated
|
---|
40 |
|
---|
41 | # tools.jar is needed by the JDI - SA binding
|
---|
42 | SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
|
---|
43 |
|
---|
44 | # turn wildcards to individual files
|
---|
45 | AGENT_FILES1 := $(wildcard $(AGENT_FILES1))
|
---|
46 | AGENT_FILES2 := $(wildcard $(AGENT_FILES2))
|
---|
47 |
|
---|
48 | SA_CLASSDIR = $(GENERATED)/saclasses
|
---|
49 |
|
---|
50 | SA_BUILD_VERSION_PROP = sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)
|
---|
51 |
|
---|
52 | SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
|
---|
53 |
|
---|
54 | default:: $(GENERATED)/sa-jdi.jar
|
---|
55 |
|
---|
56 | # Remove the space between $(SA_BUILD_VERSION_PROP) and > below as it adds a white space
|
---|
57 | # at the end of SA version string and causes a version mismatch with the target VM version.
|
---|
58 |
|
---|
59 | $(GENERATED)\sa-jdi.jar: $(AGENT_FILES1) $(AGENT_FILES2)
|
---|
60 | @if [ ! -d $(SA_CLASSDIR) ]; then mkdir -p $(SA_CLASSDIR); fi
|
---|
61 | @echo ...Building sa-jdi.jar
|
---|
62 | @echo ...$(COMPILE_JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -d $(SA_CLASSDIR) ....
|
---|
63 | @$(COMPILE_JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) $(AGENT_FILES1:/=\)
|
---|
64 | @$(COMPILE_JAVAC) -source 1.4 -target 1.4 -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) $(AGENT_FILES2:/=\)
|
---|
65 | $(COMPILE_RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
---|
66 | $(QUIETLY) echo $(SA_BUILD_VERSION_PROP)> $(SA_PROPERTIES)
|
---|
67 | $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
---|
68 | $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
|
---|
69 | $(QUIETLY) rm -rf $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
|
---|
70 | $(QUIETLY) mkdir $(SA_CLASSDIR)\sun\jvm\hotspot\ui\resources
|
---|
71 | $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
|
---|
72 | $(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)
|
---|
73 | $(RUN_JAR) cf $@ -C saclasses .
|
---|
74 | $(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR:/=\) META-INF\services\com.sun.jdi.connect.Connector
|
---|
75 | $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal
|
---|
76 | $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
|
---|
77 | $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
|
---|
78 | $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|
82 | # This second part is used to build saos2dbg.dll
|
---|
83 | # We currently build it the same way for product, debug, and fastdebug.
|
---|
84 |
|
---|
85 | SAOSDBG=saos2dbg.dll
|
---|
86 |
|
---|
87 | checkAndBuildSA:: $(SAOS2DBG)
|
---|
88 |
|
---|
89 | # @todo look at windows/makefiles/sa.make for details on how to build the SA
|
---|
90 | # debug DLL
|
---|
91 |
|
---|
92 |
|
---|
93 | cleanall :
|
---|
94 | rm -rf $(GENERATED:\=/)/saclasses
|
---|
95 | rm -rf $(GENERATED:\=/)/sa-jdi.jar
|
---|
96 |
|
---|
97 | endif # ifneq ($(BUILD_OS2_SA),1)
|
---|