make/linux/makefiles/sa.make

changeset 526
a294fd0c4b38
parent 435
a61af66fc99e
child 631
d1605aabd0a1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/make/linux/makefiles/sa.make	Wed Apr 09 14:22:48 2008 -0400
     1.3 @@ -0,0 +1,87 @@
     1.4 +#
     1.5 +# Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.
    1.11 +#
    1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 +# version 2 for more details (a copy is included in the LICENSE file that
    1.16 +# accompanied this code).
    1.17 +#
    1.18 +# You should have received a copy of the GNU General Public License version
    1.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 +#
    1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or
    1.24 +# have any questions.
    1.25 +#  
    1.26 +#
    1.27 +
    1.28 +# This makefile (sa.make) is included from the sa.make in the
    1.29 +# build directories.
    1.30 +
    1.31 +# This makefile is used to build Serviceability Agent java code
    1.32 +# and generate JNI header file for native methods.
    1.33 +
    1.34 +include $(GAMMADIR)/make/linux/makefiles/rules.make
    1.35 +
    1.36 +AGENT_DIR = $(GAMMADIR)/agent
    1.37 +
    1.38 +include $(GAMMADIR)/make/sa.files
    1.39 +
    1.40 +TOPDIR    = $(shell echo `pwd`)
    1.41 +GENERATED = $(TOPDIR)/../generated
    1.42 +
    1.43 +# tools.jar is needed by the JDI - SA binding
    1.44 +SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
    1.45 +
    1.46 +# gnumake 3.78.1 does not accept the *s that
    1.47 +# are in AGENT_ALLFILES, so use the shell to expand them
    1.48 +AGENT_ALLFILES := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES))
    1.49 +
    1.50 +SA_CLASSDIR = $(GENERATED)/saclasses
    1.51 +
    1.52 +SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
    1.53 +
    1.54 +SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
    1.55 +
    1.56 +# if $(AGENT_DIR) does not exist, we don't build SA
    1.57 +# also, we don't build SA on Itanium.
    1.58 +
    1.59 +all: 
    1.60 +	if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \
    1.61 +	   $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
    1.62 +	fi
    1.63 +
    1.64 +$(GENERATED)/sa-jdi.jar: $(AGENT_ALLFILES)
    1.65 +	$(QUIETLY) echo "Making $@"
    1.66 +	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
    1.67 +	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
    1.68 +	  exit 1; \
    1.69 +	fi
    1.70 +	$(QUIETLY) if [ ! -f $(SA_CLASSPATH) ] ; then \
    1.71 +	  echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
    1.72 +	  echo ""; \
    1.73 +	  exit 1; \
    1.74 +	fi
    1.75 +	$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
    1.76 +	  mkdir -p $(SA_CLASSDIR);        \
    1.77 +	fi
    1.78 +	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES)
    1.79 +	$(QUIETLY) $(REMOTE) $(COMPILE.RMIC)  -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
    1.80 +	$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
    1.81 +	$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
    1.82 +	$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
    1.83 +	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
    1.84 +	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
    1.85 +	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
    1.86 +	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
    1.87 +
    1.88 +clean:
    1.89 +	rm -rf $(SA_CLASSDIR)
    1.90 +	rm -rf $(GENERATED)/sa-jdi.jar

mercurial