Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/windows/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 is used to build Serviceability Agent code25# and generate JNI header file for native methods.2627AGENT_DIR = $(WorkSpace)/agent28checkAndBuildSA::2930!if "$(BUILD_WIN_SA)" != "1"31# Already warned about this in build.make32!else3334# This first part is used to build sa-jdi.jar35!include $(WorkSpace)/make/windows/makefiles/rules.make36!include $(WorkSpace)/make/sa.files3738GENERATED = ../generated3940HS_COMMON_SRC_REL = src4142!if "$(OPENJDK)" != "true"43HS_ALT_SRC_REL=src/closed44HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)45!ifndef HS_ALT_MAKE46!if exist($(WorkSpace)/make/closed)47HS_ALT_MAKE=$(WorkSpace)/make/closed48!endif49!endif50!endif5152HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)5354!ifdef HS_ALT_MAKE55!include $(HS_ALT_MAKE)/windows/makefiles/sa.make56!endif5758# tools.jar is needed by the JDI - SA binding59SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar6061SA_CLASSDIR = $(GENERATED)/saclasses6263SA_BUILD_VERSION_PROP = sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)6465SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties6667default:: $(GENERATED)/sa-jdi.jar6869# Remove the space between $(SA_BUILD_VERSION_PROP) and > below as it adds a white space70# at the end of SA version string and causes a version mismatch with the target VM version.7172$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)73$(QUIETLY) mkdir -p $(SA_CLASSDIR)74@echo ...Building sa-jdi.jar into $(SA_CLASSDIR)75@echo ...$(COMPILE_JAVAC) -classpath $(SA_CLASSPATH) -d $(SA_CLASSDIR) ....76@$(COMPILE_JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) $(AGENT_FILES)77$(COMPILE_RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer78$(QUIETLY) echo $(SA_BUILD_VERSION_PROP)> $(SA_PROPERTIES)79$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js80$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql81$(QUIETLY) rm -rf $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources82$(QUIETLY) mkdir $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources83$(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources84$(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)85$(RUN_JAR) cf $@ -C $(SA_CLASSDIR) .86$(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector87$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal88$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext89$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext90$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.asm.Disassembler91929394# This second part is used to build sawindbg.dll95# We currently build it the same way for product, debug, and fastdebug.9697SAWINDBG=sawindbg.dll9899checkAndBuildSA:: $(SAWINDBG)100101!if "$(BUILD_FLAVOR)" == "debug"102SA_EXTRA_CFLAGS = -Od -D "_DEBUG"103!if "$(BUILDARCH)" == "i486"104SA_EXTRA_CFLAGS = $(SA_EXTRA_CFLAGS) -RTC1105!endif106!elseif "$(BUILD_FLAVOR)" == "fastdebug"107SA_EXTRA_CFLAGS = -O2 -D "_DEBUG"108!else109SA_EXTRA_CFLAGS = -O2110!endif111112!if "$(BUILDARCH)" == "ia64"113SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_CONSOLE" -D "_MBCS" -YX -FD -c114!elseif "$(BUILDARCH)" == "amd64"115SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_CONSOLE" -D "_MBCS" -YX -FD -c116!if "$(COMPILER_NAME)" == "VS2005"117# On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line,118# otherwise we get missing __security_check_cookie externals at link time.119SA_LD_FLAGS = bufferoverflowU.lib120!endif121!else122SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -D "WIN32" -D "_WINDOWS" -D "_CONSOLE" -D "_MBCS" -YX -FD -c123!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"124# -ZI is incompatible with -O2 used for release/fastdebug builds.125# Using -Zi instead.126SA_CFLAGS = $(SA_CFLAGS) -Zi127!endif128!endif129!if "$(MT)" != ""130SA_LD_FLAGS = -manifest $(SA_LD_FLAGS)131!endif132SA_CFLAGS = $(SA_CFLAGS) $(SA_EXTRA_CFLAGS)133134SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \135$(AGENT_DIR)/src/share/native/sadis.c136137SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE)138!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"139SA_LFLAGS = $(SA_LFLAGS) -map -debug140!endif141!if "$(BUILDARCH)" == "i486"142SA_LFLAGS = /SAFESEH $(SA_LFLAGS)143!endif144145SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG)146147# Note that we do not keep sawindbj.obj around as it would then148# get included in the dumpbin command in build_vm_def.sh149150# In VS2005 or VS2008 the link command creates a .manifest file that we want151# to insert into the linked artifact so we do not need to track it separately.152# Use ";#2" for .dll and ";#1" for .exe in the MT command below:153$(SAWINDBG): $(SASRCFILES)154set INCLUDE=$(SA_INCLUDE)$(INCLUDE)155$(CXX) @<<156-I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32"157-I"$(GENERATED)" $(SA_CFLAGS)158$(SASRCFILES)159-out:$*.obj160<<161set LIB=$(SA_LIB)$(LIB)162$(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS)163!if "$(MT)" != ""164$(MT) -manifest $(@F).manifest -outputresource:$(@F);#2165!endif166!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"167!if "$(ZIP_DEBUGINFO_FILES)" == "1"168$(ZIPEXE) -q $*.diz $*.map $*.pdb169$(RM) $*.map $*.pdb170!endif171!endif172-@rm -f $*.obj173174cleanall :175rm -rf $(GENERATED)/saclasses176rm -rf $(GENERATED)/sa-jdi.jar177!endif178179180