make/windows/makefiles/sa.make

Print this page

        

@@ -1,7 +1,7 @@
 #
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 only, as
 # published by the Free Software Foundation.

@@ -92,17 +92,23 @@
 # On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line, 
 # otherwise we get missing __security_check_cookie externals at link time. 
 SA_LD_FLAGS = bufferoverflowU.lib
 !endif
 !else
-SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+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
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_CFLAGS = $(SA_CFLAGS) /ZI
 !endif
+!endif
 !if "$(MT)" != ""
 SA_LD_FLAGS = /manifest $(SA_LD_FLAGS)
 !endif
 SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp
-SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /map /debug /machine:$(MACHINE)
+SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /machine:$(MACHINE)
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_LFLAGS = $(SA_LFLAGS) /map /debug
+!endif
 
 # Note that we do not keep sawindbj.obj around as it would then
 # get included in the dumpbin command in build_vm_def.sh
 
 # In VS2005 or VS2008 the link command creates a .manifest file that we want

@@ -112,18 +118,24 @@
         set INCLUDE=$(SA_INCLUDE)$(INCLUDE)
         $(CXX) @<<
           /I"$(BootStrapDir)/include" /I"$(BootStrapDir)/include/win32" 
           /I"$(GENERATED)" $(SA_CFLAGS)
           $(SASRCFILE)
-          /out:sawindbg.obj
+          /out:$*.obj
 <<
         set LIB=$(SA_LIB)$(LIB)
-        $(LD) /out:$@ /DLL sawindbg.obj dbgeng.lib $(SA_LFLAGS)
+        $(LD) /out:$@ /DLL $*.obj dbgeng.lib $(SA_LFLAGS)
 !if "$(MT)" != ""
         $(MT) /manifest $(@F).manifest /outputresource:$(@F);#2
 !endif
-        -@rm -f sawindbg.obj
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+        $(ZIPEXE) -q $*.diz $*.map $*.pdb
+        $(RM) $*.map $*.pdb
+!endif
+!endif
+        -@rm -f $*.obj
 
 cleanall :
         rm -rf $(GENERATED:\=/)/saclasses
         rm -rf $(GENERATED:\=/)/sa-jdi.jar
 !endif