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