sa.make revision 91
2796N/A#
2796N/A# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
2796N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2796N/A#
2796N/A# This code is free software; you can redistribute it and/or modify it
2796N/A# under the terms of the GNU General Public License version 2 only, as
2796N/A# published by the Free Software Foundation.
2796N/A#
2796N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2796N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2796N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2796N/A# version 2 for more details (a copy is included in the LICENSE file that
2796N/A# accompanied this code).
2796N/A#
2796N/A# You should have received a copy of the GNU General Public License version
2796N/A# 2 along with this work; if not, write to the Free Software Foundation,
2796N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2796N/A#
2796N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2796N/A# CA 95054 USA or visit www.sun.com if you need additional information or
2796N/A# have any questions.
2796N/A#
2796N/A#
2796N/A
2796N/A# This makefile (sa.make) is included from the sa.make in the
2796N/A# build directories.
2796N/A
2796N/A# This makefile is used to build Serviceability Agent java code
2796N/A# and generate JNI header file for native methods.
2796N/A
2796N/Ainclude $(GAMMADIR)/make/linux/makefiles/rules.make
2796N/A
2796N/AAGENT_DIR = $(GAMMADIR)/agent
2796N/A
2796N/Ainclude $(GAMMADIR)/make/sa.files
2796N/A
2796N/ATOPDIR = $(shell echo `pwd`)
2796N/AGENERATED = $(TOPDIR)/../generated
2796N/A
2796N/A# tools.jar is needed by the JDI - SA binding
2796N/ASA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
2796N/A
2796N/A# gnumake 3.78.1 does not accept the *s that
2796N/A# are in AGENT_ALLFILES, so use the shell to expand them
2796N/AAGENT_ALLFILES := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES))
2796N/A
2796N/ASA_CLASSDIR = $(GENERATED)/saclasses
2796N/A
2796N/ASA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
2972N/A
2972N/ASA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
2796N/A
2972N/A# if $(AGENT_DIR) does not exist, we don't build SA
2796N/A# also, we don't build SA on Itanium.
2796N/A
2796N/Aall:
2796N/A if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \
2796N/A $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
2796N/A fi
2796N/A
2796N/A$(GENERATED)/sa-jdi.jar: $(AGENT_ALLFILES)
2796N/A $(QUIETLY) echo "Making $@"
2796N/A $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
2796N/A echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
2796N/A exit 1; \
2796N/A fi
2796N/A $(QUIETLY) if [ ! -f $(SA_CLASSPATH) ] ; then \
2796N/A echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
2796N/A echo ""; \
2796N/A exit 1; \
2796N/A fi
2796N/A $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
2796N/A mkdir -p $(SA_CLASSDIR); \
2796N/A fi
2796N/A $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES)
2796N/A $(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
2796N/A $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
2796N/A $(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
2796N/A $(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
2796N/A $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
2796N/A $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
2796N/A $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
2842N/A $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
2796N/A
2796N/Aclean:
2796N/A rm -rf $(SA_CLASSDIR)
2796N/A rm -rf $(GENERATED)/sa-jdi.jar
2796N/A