make/windows/makefiles/sa.make

Tue, 26 Jul 2016 11:15:09 +0800

author
fujie
date
Tue, 26 Jul 2016 11:15:09 +0800
changeset 38
f0e26f502a50
parent 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Instruction decoding support: add movn and movz in MIPS disassembler.

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # This makefile is used to build Serviceability Agent code
aoqi@0 26 # and generate JNI header file for native methods.
aoqi@0 27
aoqi@0 28 AGENT_DIR = $(WorkSpace)/agent
aoqi@0 29 checkAndBuildSA::
aoqi@0 30
aoqi@0 31 !if "$(BUILD_WIN_SA)" != "1"
aoqi@0 32 # Already warned about this in build.make
aoqi@0 33 !else
aoqi@0 34
aoqi@0 35 # This first part is used to build sa-jdi.jar
aoqi@0 36 !include $(WorkSpace)/make/windows/makefiles/rules.make
aoqi@0 37 !include $(WorkSpace)/make/sa.files
aoqi@0 38
aoqi@0 39 GENERATED = ../generated
aoqi@0 40
aoqi@0 41 # tools.jar is needed by the JDI - SA binding
aoqi@0 42 SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
aoqi@0 43
aoqi@0 44 SA_CLASSDIR = $(GENERATED)/saclasses
aoqi@0 45
aoqi@0 46 SA_BUILD_VERSION_PROP = sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)
aoqi@0 47
aoqi@0 48 SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
aoqi@0 49
aoqi@0 50 default:: $(GENERATED)/sa-jdi.jar
aoqi@0 51
aoqi@0 52 # Remove the space between $(SA_BUILD_VERSION_PROP) and > below as it adds a white space
aoqi@0 53 # at the end of SA version string and causes a version mismatch with the target VM version.
aoqi@0 54
aoqi@0 55 $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
aoqi@0 56 $(QUIETLY) mkdir -p $(SA_CLASSDIR)
aoqi@0 57 @echo ...Building sa-jdi.jar into $(SA_CLASSDIR)
aoqi@0 58 @echo ...$(COMPILE_JAVAC) -classpath $(SA_CLASSPATH) -d $(SA_CLASSDIR) ....
aoqi@0 59 @$(COMPILE_JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) $(AGENT_FILES)
aoqi@0 60 $(COMPILE_RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
aoqi@0 61 $(QUIETLY) echo $(SA_BUILD_VERSION_PROP)> $(SA_PROPERTIES)
aoqi@0 62 $(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
aoqi@0 63 $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
aoqi@0 64 $(QUIETLY) rm -rf $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
aoqi@0 65 $(QUIETLY) mkdir $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
aoqi@0 66 $(QUIETLY) cp $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
aoqi@0 67 $(QUIETLY) cp -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)
aoqi@0 68 $(RUN_JAR) cf $@ -C $(SA_CLASSDIR) .
aoqi@0 69 $(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
aoqi@0 70 $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal
aoqi@0 71 $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
aoqi@0 72 $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
aoqi@0 73 $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.asm.Disassembler
aoqi@0 74
aoqi@0 75
aoqi@0 76
aoqi@0 77 # This second part is used to build sawindbg.dll
aoqi@0 78 # We currently build it the same way for product, debug, and fastdebug.
aoqi@0 79
aoqi@0 80 SAWINDBG=sawindbg.dll
aoqi@0 81
aoqi@0 82 checkAndBuildSA:: $(SAWINDBG)
aoqi@0 83
aoqi@0 84 # These do not need to be optimized (don't run a lot of code) and it
aoqi@0 85 # will be useful to have the assertion checks in place
aoqi@0 86
aoqi@0 87 !if "$(BUILDARCH)" == "ia64"
aoqi@0 88 SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
aoqi@0 89 !elseif "$(BUILDARCH)" == "amd64"
aoqi@0 90 SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
aoqi@0 91 !if "$(COMPILER_NAME)" == "VS2005"
aoqi@0 92 # On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line,
aoqi@0 93 # otherwise we get missing __security_check_cookie externals at link time.
aoqi@0 94 SA_LD_FLAGS = bufferoverflowU.lib
aoqi@0 95 !endif
aoqi@0 96 !else
aoqi@0 97 SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c
aoqi@0 98 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
aoqi@0 99 SA_CFLAGS = $(SA_CFLAGS) -ZI
aoqi@0 100 !endif
aoqi@0 101 !endif
aoqi@0 102 !if "$(MT)" != ""
aoqi@0 103 SA_LD_FLAGS = -manifest $(SA_LD_FLAGS)
aoqi@0 104 !endif
aoqi@0 105
aoqi@0 106 SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \
aoqi@0 107 $(AGENT_DIR)/src/share/native/sadis.c
aoqi@0 108
aoqi@0 109 SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE)
aoqi@0 110 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
aoqi@0 111 SA_LFLAGS = $(SA_LFLAGS) -map -debug
aoqi@0 112 !endif
aoqi@0 113 !if "$(BUILDARCH)" == "i486"
aoqi@0 114 SA_LFLAGS = $(SAFESEH_FLAG) $(SA_LFLAGS)
aoqi@0 115 !endif
aoqi@0 116
aoqi@0 117 SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG)
aoqi@0 118
aoqi@0 119 # Note that we do not keep sawindbj.obj around as it would then
aoqi@0 120 # get included in the dumpbin command in build_vm_def.sh
aoqi@0 121
aoqi@0 122 # In VS2005 or VS2008 the link command creates a .manifest file that we want
aoqi@0 123 # to insert into the linked artifact so we do not need to track it separately.
aoqi@0 124 # Use ";#2" for .dll and ";#1" for .exe in the MT command below:
aoqi@0 125 $(SAWINDBG): $(SASRCFILES)
aoqi@0 126 set INCLUDE=$(SA_INCLUDE)$(INCLUDE)
aoqi@0 127 $(CXX) @<<
aoqi@0 128 -I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32"
aoqi@0 129 -I"$(GENERATED)" $(SA_CFLAGS)
aoqi@0 130 $(SASRCFILES)
aoqi@0 131 -out:$*.obj
aoqi@0 132 <<
aoqi@0 133 set LIB=$(SA_LIB)$(LIB)
aoqi@0 134 $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS)
aoqi@0 135 !if "$(MT)" != ""
aoqi@0 136 $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2
aoqi@0 137 !endif
aoqi@0 138 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
aoqi@0 139 !if "$(ZIP_DEBUGINFO_FILES)" == "1"
aoqi@0 140 $(ZIPEXE) -q $*.diz $*.map $*.pdb
aoqi@0 141 $(RM) $*.map $*.pdb
aoqi@0 142 !endif
aoqi@0 143 !endif
aoqi@0 144 -@rm -f $*.obj
aoqi@0 145
aoqi@0 146 cleanall :
aoqi@0 147 rm -rf $(GENERATED)/saclasses
aoqi@0 148 rm -rf $(GENERATED)/sa-jdi.jar
aoqi@0 149 !endif

mercurial