1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/aix/makefiles/sa.make Fri Sep 06 20:08:29 2013 +0200 1.3 @@ -0,0 +1,116 @@ 1.4 +# 1.5 +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 +# Copyright 2012, 2013 SAP AG. All rights reserved. 1.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 +# 1.9 +# This code is free software; you can redistribute it and/or modify it 1.10 +# under the terms of the GNU General Public License version 2 only, as 1.11 +# published by the Free Software Foundation. 1.12 +# 1.13 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.15 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.16 +# version 2 for more details (a copy is included in the LICENSE file that 1.17 +# accompanied this code). 1.18 +# 1.19 +# You should have received a copy of the GNU General Public License version 1.20 +# 2 along with this work; if not, write to the Free Software Foundation, 1.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.22 +# 1.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.24 +# or visit www.oracle.com if you need additional information or have any 1.25 +# questions. 1.26 +# 1.27 +# 1.28 + 1.29 +# This makefile (sa.make) is included from the sa.make in the 1.30 +# build directories. 1.31 + 1.32 +# This makefile is used to build Serviceability Agent java code 1.33 +# and generate JNI header file for native methods. 1.34 + 1.35 +include $(GAMMADIR)/make/aix/makefiles/rules.make 1.36 + 1.37 +include $(GAMMADIR)/make/defs.make 1.38 + 1.39 +AGENT_DIR = $(GAMMADIR)/agent 1.40 + 1.41 +include $(GAMMADIR)/make/sa.files 1.42 + 1.43 +TOPDIR = $(shell echo `pwd`) 1.44 +GENERATED = $(TOPDIR)/../generated 1.45 + 1.46 +# tools.jar is needed by the JDI - SA binding 1.47 +SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar 1.48 + 1.49 +# TODO: if it's a modules image, check if SA module is installed. 1.50 +MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules 1.51 + 1.52 +AGENT_FILES_LIST := $(GENERATED)/agent.classes.list 1.53 + 1.54 +SA_CLASSDIR = $(GENERATED)/saclasses 1.55 + 1.56 +SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" 1.57 + 1.58 +SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties 1.59 + 1.60 +# if $(AGENT_DIR) does not exist, we don't build SA 1.61 +# also, we don't build SA on Itanium, PowerPC, ARM or zero. 1.62 + 1.63 +all: 1.64 + if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \ 1.65 + -a "$(SRCARCH)" != "arm" \ 1.66 + -a "$(SRCARCH)" != "ppc" \ 1.67 + -a "$(SRCARCH)" != "zero" ] ; then \ 1.68 + $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ 1.69 + fi 1.70 + 1.71 +$(GENERATED)/sa-jdi.jar: $(AGENT_FILES) 1.72 + $(QUIETLY) echo "Making $@" 1.73 + $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ 1.74 + echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ 1.75 + exit 1; \ 1.76 + fi 1.77 + $(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \ 1.78 + echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\ 1.79 + echo ""; \ 1.80 + exit 1; \ 1.81 + fi 1.82 + $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \ 1.83 + mkdir -p $(SA_CLASSDIR); \ 1.84 + fi 1.85 +# Note: When indented, make tries to execute the '$(shell' comment. 1.86 +# In some environments, cmd processors have limited line length. 1.87 +# To prevent the javac invocation in the next block from using 1.88 +# a very long cmd line, we use javac's @file-list option. We 1.89 +# generate the file lists using make's built-in 'foreach' control 1.90 +# flow which also avoids cmd processor line length issues. Since 1.91 +# the 'foreach' is done as part of make's macro expansion phase, 1.92 +# the initialization of the lists is also done in the same phase 1.93 +# using '$(shell rm ...' instead of using the more traditional 1.94 +# 'rm ...' rule. 1.95 + $(shell rm -rf $(AGENT_FILES_LIST)) 1.96 +# gnumake 3.78.1 does not accept the *'s that 1.97 +# are in AGENT_FILES, so use the shell to expand them. 1.98 +# Be extra carefull to not produce too long command lines in the shell! 1.99 + $(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST))) 1.100 + $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST) 1.101 + $(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer 1.102 + $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) 1.103 + $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js 1.104 + $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql 1.105 + $(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources 1.106 + $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/* 1.107 + $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/ 1.108 + $(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/ 1.109 + $(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ . 1.110 + $(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector 1.111 + $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext 1.112 + $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext 1.113 + $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext 1.114 + $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext 1.115 + 1.116 +clean: 1.117 + rm -rf $(SA_CLASSDIR) 1.118 + rm -rf $(GENERATED)/sa-jdi.jar 1.119 + rm -rf $(AGENT_FILES_LIST)