1 #
   2 # Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 BUILDDIR = ../../..
  27 PRODUCT  = java
  28 include $(BUILDDIR)/common/Defs.gmk
  29 
  30 ifeq ($(PLATFORM), windows)
  31   LIB_LOCATION = $(BINDIR)
  32 else ifeq ($(PLATFORM), macosx)
  33   LIB_LOCATION = $(LIBDIR)
  34 else
  35   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
  36 endif
  37 
  38 # INCLUDE_SA is false on platforms where SA is not supported.
  39 # On platforms where it is supported, we want to allow it to
  40 # not be present, at least temporarily.  So,
  41 # if the SA files (well, just sa-jdi.jar) do not exist
  42 # in the HOTSPOT_IMPORT_PATH, then we won't build SA.
  43 SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
  44                           $(ECHO) true; \
  45                         else \
  46                           $(ECHO) false; \
  47                         fi)
  48 
  49 ifeq ($(SA_EXISTS), false)
  50   INCLUDE_SA := false
  51 endif
  52 
  53 IMPORT_LIST =
  54 ifeq ($(INCLUDE_SA), true)
  55   IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
  56                  $(LIB_LOCATION)/$(SALIB_NAME)
  57   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
  58     ifeq ($(ZIP_DEBUGINFO_FILES),1)
  59       # the import JDK may not contain .diz files
  60       ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SA_DIZ_NAME)),)
  61         IMPORT_LIST += $(LIB_LOCATION)/$(SA_DIZ_NAME)
  62       endif
  63     else
  64       ifeq ($(PLATFORM), windows)
  65         # the import JDK may not contain .pdb files
  66         ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SAPDB_NAME)),)
  67           # assume .map file is present if .pdb is present
  68           IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
  69                          $(LIB_LOCATION)/$(SAPDB_NAME)
  70         endif
  71       else
  72         # the import JDK may not contain .debuginfo files
  73         ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SA_DEBUGINFO_NAME)),)
  74           IMPORT_LIST += $(LIB_LOCATION)/$(SA_DEBUGINFO_NAME)
  75         endif
  76       endif
  77     endif
  78   endif
  79 endif # INCLUDE_SA
  80 
  81 
  82 ifeq ($(INCLUDE_SA), true)
  83 # The Serviceability Agent is built in the Hotspot workspace.
  84 # It contains two files:
  85 #  - sa-jdi.jar:  This goes into the same dir as tools.jar.
  86 #  - a shared library:  sawindbg.dll on windows / libproc.sa on unix
  87 #                       This goes into the same dir as the other
  88 #                       shared libs, eg. libjdwp.so.
  89 $(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
  90         $(install-importonly-file)
  91 
  92 $(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
  93         $(install-import-file)
  94 
  95   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
  96     ifeq ($(ZIP_DEBUGINFO_FILES),1)
  97 $(LIB_LOCATION)/$(SA_DIZ_NAME): $(HOTSPOT_SALIB_PATH)/$(SA_DIZ_NAME)
  98         $(install-import-file)
  99     else
 100       ifeq ($(PLATFORM), windows)
 101 $(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
 102         $(install-import-file)
 103 
 104 $(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
 105         $(install-import-file)
 106       else
 107 $(LIB_LOCATION)/$(SA_DEBUGINFO_NAME): $(HOTSPOT_SALIB_PATH)/$(SA_DEBUGINFO_NAME)
 108         $(install-import-file)
 109       endif
 110     endif
 111   endif
 112 endif # INCLUDE_SA
 113 
 114 all: $(IMPORT_LIST)
 115 
 116 clean clobber::