Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/solaris/makefiles/sa.make
32285 views
#1# Copyright (c) 2003, 2015, 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/solaris/makefiles/rules.make31include $(GAMMADIR)/make/defs.make32AGENT_DIR = $(GAMMADIR)/agent33include $(GAMMADIR)/make/sa.files3435-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make3637GENERATED = ../generated3839# tools.jar is needed by the JDI - SA binding40SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar4142# TODO: if it's a modules image, check if SA module is installed.43MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules4445AGENT_FILES_LIST := $(GENERATED)/agent.classes.list4647SA_CLASSDIR = $(GENERATED)/saclasses4849SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"5051SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties5253# if $(AGENT_DIR) does not exist, we don't build SA.54all:55$(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \56$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \57fi5859$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)60$(QUIETLY) echo "Making $@";61$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \62echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \63exit 1; \64fi65$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \66echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\67echo ""; \68exit 1; \69fi70$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \71mkdir -p $(SA_CLASSDIR); \72fi73# Note: When indented, make tries to execute the '$(shell' comment.74# In some environments, cmd processors have limited line length.75# To prevent the javac invocation in the next block from using76# a very long cmd line, we use javac's @file-list option. We77# generate the file lists using make's built-in 'foreach' control78# flow which also avoids cmd processor line length issues. Since79# the 'foreach' is done as part of make's macro expansion phase,80# the initialization of the lists is also done in the same phase81# using '$(shell rm ...' instead of using the more traditional82# 'rm ...' rule.83$(shell rm -rf $(AGENT_FILES_LIST))84# gnumake 3.78.1 does not accept the *'s that85# are in AGENT_FILES, so use the shell to expand them.86# Be extra carefull to not produce too long command lines in the shell!87$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))88$(QUIETLY) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)89$(QUIETLY) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer90$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)91$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js92$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql93$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources94$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*95$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/96$(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/97$(QUIETLY) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .98$(QUIETLY) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector99$(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal100$(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler101102clean:103rm -rf $(SA_CLASSDIR)104rm -rf $(GENERATED)/sa-jdi.jar105rm -rf $(AGENT_FILES_LIST)106107108