Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/linux/makefiles/sa.make
32285 views
#1# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# This makefile (sa.make) is included from the sa.make in the25# build directories.2627# This makefile is used to build Serviceability Agent java code28# and generate JNI header file for native methods.2930include $(GAMMADIR)/make/linux/makefiles/rules.make3132include $(GAMMADIR)/make/defs.make33include $(GAMMADIR)/make/altsrc.make3435AGENT_DIR = $(GAMMADIR)/agent3637include $(GAMMADIR)/make/sa.files3839-include $(HS_ALT_MAKE)/linux/makefiles/sa.make404142TOPDIR = $(shell echo `pwd`)43GENERATED = $(TOPDIR)/../generated4445# tools.jar is needed by the JDI - SA binding46SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar4748# TODO: if it's a modules image, check if SA module is installed.49MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules5051AGENT_FILES_LIST := $(GENERATED)/agent.classes.list5253SA_CLASSDIR = $(GENERATED)/saclasses5455SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"5657SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties5859# if $(AGENT_DIR) does not exist, we don't build SA60# also, we don't build SA on Itanium or zero.6162all:63if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \64-a "$(SRCARCH)" != "zero" ] ; then \65$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \66fi6768$(GENERATED)/sa-jdi.jar:: $(AGENT_FILES)69$(QUIETLY) echo "Making $@"70$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \71echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \72exit 1; \73fi74$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \75echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\76echo ""; \77exit 1; \78fi79$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \80mkdir -p $(SA_CLASSDIR); \81fi82# Note: When indented, make tries to execute the '$(shell' comment.83# In some environments, cmd processors have limited line length.84# To prevent the javac invocation in the next block from using85# a very long cmd line, we use javac's @file-list option. We86# generate the file lists using make's built-in 'foreach' control87# flow which also avoids cmd processor line length issues. Since88# the 'foreach' is done as part of make's macro expansion phase,89# the initialization of the lists is also done in the same phase90# using '$(shell rm ...' instead of using the more traditional91# 'rm ...' rule.92$(shell rm -rf $(AGENT_FILES_LIST))93# gnumake 3.78.1 does not accept the *'s that94# are in AGENT_FILES, so use the shell to expand them.95# Be extra carefull to not produce too long command lines in the shell!96$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))97$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)98$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer99$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)100$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js101$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql102$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources103$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*104$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/105$(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/106$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .107$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector108$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext109$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext110$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext111$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext112$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler113114clean:115rm -rf $(SA_CLASSDIR)116rm -rf $(GENERATED)/sa-jdi.jar117rm -rf $(AGENT_FILES_LIST)118119-include $(HS_ALT_MAKE)/linux/makefiles/sa-rules.make120121122