Makefile 4.0 KB
Newer Older
1
#
2
# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# 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.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

BUILDDIR = ../../..
PRODUCT  = java
include $(BUILDDIR)/common/Defs.gmk

ifeq ($(PLATFORM), windows)
  LIB_LOCATION = $(BINDIR)
else ifeq ($(PLATFORM), macosx)
  LIB_LOCATION = $(LIBDIR)
else
  LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
endif

# INCLUDE_SA is false on platforms where SA is not supported.
# On platforms where it is supported, we want to allow it to
# not be present, at least temporarily.  So,
# if the SA files (well, just sa-jdi.jar) do not exist
# in the HOTSPOT_IMPORT_PATH, then we won't build SA.
SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
                          $(ECHO) true; \
                        else \
                          $(ECHO) false; \
                        fi)

ifeq ($(SA_EXISTS), false)
  INCLUDE_SA := false
endif

IMPORT_LIST =
ifeq ($(INCLUDE_SA), true)
  IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
                 $(LIB_LOCATION)/$(SALIB_NAME)
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
      # the import JDK may not contain .diz files
      ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SA_DIZ_NAME)),)
        IMPORT_LIST += $(LIB_LOCATION)/$(SA_DIZ_NAME)
      endif
    else
      ifeq ($(PLATFORM), windows)
        # the import JDK may not contain .pdb files
        ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SAPDB_NAME)),)
          # assume .map file is present if .pdb is present
          IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
                         $(LIB_LOCATION)/$(SAPDB_NAME)
        endif
      else
        # the import JDK may not contain .debuginfo files
        ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SA_DEBUGINFO_NAME)),)
          IMPORT_LIST += $(LIB_LOCATION)/$(SA_DEBUGINFO_NAME)
        endif
      endif
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    endif
  endif
endif # INCLUDE_SA


ifeq ($(INCLUDE_SA), true)
# The Serviceability Agent is built in the Hotspot workspace.
# It contains two files:
#  - sa-jdi.jar:  This goes into the same dir as tools.jar.
#  - a shared library:  sawindbg.dll on windows / libproc.sa on unix
#		        This goes into the same dir as the other
#			shared libs, eg. libjdwp.so.
$(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
	$(install-importonly-file)

$(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
	$(install-import-file)

95 96 97 98 99 100
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(LIB_LOCATION)/$(SA_DIZ_NAME): $(HOTSPOT_SALIB_PATH)/$(SA_DIZ_NAME)
	$(install-import-file)
    else
      ifeq ($(PLATFORM), windows)
101 102 103 104 105
$(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
	$(install-import-file)
106
      else
107 108
$(LIB_LOCATION)/$(SA_DEBUGINFO_NAME): $(HOTSPOT_SALIB_PATH)/$(SA_DEBUGINFO_NAME)
	$(install-import-file)
109 110
      endif
    endif
111 112 113 114 115 116
  endif
endif # INCLUDE_SA

all: $(IMPORT_LIST)

clean clobber::