1 #
   2 # Copyright (c) 1997, 2010, 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
  33   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
  34 endif
  35 
  36 # INCLUDE_SA is false on platforms where SA is not supported.
  37 # On platforms where it is supported, we want to allow it to
  38 # not be present, at least temporarily.  So,
  39 # if the SA files (well, just sa-jdi.jar) do not exist
  40 # in the HOTSPOT_IMPORT_PATH, then we won't build SA.
  41 SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
  42                           $(ECHO) true; \
  43                         else \
  44                           $(ECHO) false; \
  45                         fi)
  46 
  47 ifeq ($(SA_EXISTS), false)
  48   INCLUDE_SA := false
  49 endif
  50 
  51 IMPORT_LIST =
  52 ifeq ($(INCLUDE_SA), true)
  53   IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
  54                  $(LIB_LOCATION)/$(SALIB_NAME)
  55   ifeq ($(PLATFORM), windows)
  56     IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
  57                    $(LIB_LOCATION)/$(SAPDB_NAME)
  58   endif
  59 endif # INCLUDE_SA
  60 
  61 
  62 ifeq ($(INCLUDE_SA), true)
  63 # The Serviceability Agent is built in the Hotspot workspace.
  64 # It contains two files:
  65 #  - sa-jdi.jar:  This goes into the same dir as tools.jar.
  66 #  - a shared library:  sawindbg.dll on windows / libproc.sa on unix
  67 #                       This goes into the same dir as the other
  68 #                       shared libs, eg. libjdwp.so.
  69 $(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
  70         $(install-importonly-file)
  71 
  72 $(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
  73         $(install-import-file)
  74 
  75 ifeq ($(PLATFORM), windows)
  76 $(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
  77         $(install-import-file)
  78 
  79 $(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
  80         $(install-import-file)
  81 endif # windows
  82 endif # INCLUDE_SA
  83 
  84 all: $(IMPORT_LIST)
  85 
  86 clean clobber::