1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/solaris/makefiles/sa.make Wed Apr 09 14:22:48 2008 -0400 1.3 @@ -0,0 +1,78 @@ 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/solaris/makefiles/rules.make 1.35 +AGENT_DIR = $(GAMMADIR)/agent 1.36 +include $(GAMMADIR)/make/sa.files 1.37 +GENERATED = ../generated 1.38 + 1.39 +# tools.jar is needed by the JDI - SA binding 1.40 +SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar 1.41 + 1.42 +# gnumake 3.78.1 does not accept the *s that 1.43 +# are in AGENT_ALLFILES, so use the shell to expand them 1.44 +AGENT_ALLFILES := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES)) 1.45 + 1.46 +SA_CLASSDIR = $(GENERATED)/saclasses 1.47 + 1.48 +SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" 1.49 + 1.50 +SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties 1.51 + 1.52 +# if $(AGENT_DIR) does not exist, we don't build SA. 1.53 +all: 1.54 + $(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \ 1.55 + $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ 1.56 + fi 1.57 + 1.58 +$(GENERATED)/sa-jdi.jar: $(AGENT_ALLFILES) 1.59 + $(QUIETLY) echo "Making $@"; 1.60 + $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ 1.61 + echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ 1.62 + exit 1; \ 1.63 + fi 1.64 + $(QUIETLY) if [ ! -f $(SA_CLASSPATH) ] ; then \ 1.65 + echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\ 1.66 + echo ""; \ 1.67 + exit 1; \ 1.68 + fi 1.69 + $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \ 1.70 + mkdir -p $(SA_CLASSDIR); \ 1.71 + fi 1.72 + $(QUIETLY) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES) 1.73 + $(QUIETLY) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer 1.74 + $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) 1.75 + $(QUIETLY) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ . 1.76 + $(QUIETLY) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector 1.77 + $(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal 1.78 + 1.79 +clean: 1.80 + rm -rf $(SA_CLASSDIR) 1.81 + rm -rf $(GENERATED)/sa-jdi.jar