jdk/make/Import.gmk
changeset 41411 31882abda8b5
parent 41410 ef26c8e40f1e
parent 41378 62969f0fb9c5
child 41412 4d1d88a4f815
equal deleted inserted replaced
41410:ef26c8e40f1e 41411:31882abda8b5
     1 #
       
     2 # Copyright (c) 2012, 2016, 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 default: all
       
    27 
       
    28 include $(SPEC)
       
    29 include MakeBase.gmk
       
    30 
       
    31 ################################################################################
       
    32 
       
    33 # Put the libraries here. Different locations for different target OS types.
       
    34 ifneq ($(OPENJDK_TARGET_OS), windows)
       
    35   HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
       
    36   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
       
    37 else
       
    38   HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/bin
       
    39   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
       
    40 endif
       
    41 
       
    42 ################################################################################
       
    43 #
       
    44 # Import hotspot
       
    45 #
       
    46 
       
    47 # Don't import jsig library for static builds
       
    48 ifneq ($(STATIC_BUILD), true)
       
    49   JSIG_IMPORT = jsig.*
       
    50 else
       
    51   JSIG_IMPORT =
       
    52 endif
       
    53 
       
    54 HOTSPOT_BASE_IMPORT_FILES := \
       
    55     $(addprefix $(LIBRARY_PREFIX), jvm.* $(JSIG_IMPORT) jvm_db.* jvm_dtrace.*) \
       
    56     Xusage.txt \
       
    57     #
       
    58 
       
    59 $(eval $(call SetupCopyFiles,COPY_HOTSPOT_BASE, \
       
    60     SRC := $(HOTSPOT_LIB_DIR), \
       
    61     DEST := $(BASE_INSTALL_LIBRARIES_HERE), \
       
    62     FILES := $(shell $(FIND) $(HOTSPOT_LIB_DIR) -type f  \
       
    63         -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE), $(HOTSPOT_BASE_IMPORT_FILES)) \) )))
       
    64 
       
    65 ifeq ($(OPENJDK_TARGET_OS), windows)
       
    66   $(eval $(call SetupCopyFiles,COPY_HOTSPOT_BASE_JVMLIB, \
       
    67       SRC := $(HOTSPOT_DIST)/lib, \
       
    68       DEST := $(BASE_INSTALL_LIBRARIES_HERE), \
       
    69       FILES := $(wildcard $(HOTSPOT_DIST)/lib/*.lib)))
       
    70 endif
       
    71 
       
    72 BASE_TARGETS := $(COPY_HOTSPOT_BASE) $(COPY_HOTSPOT_BASE_JVMLIB)
       
    73 
       
    74 ################################################################################
       
    75 
       
    76 ifneq ($(STATIC_BUILD), true)
       
    77   ifeq ($(OPENJDK_TARGET_OS), macosx)
       
    78     JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
       
    79         $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
       
    80   else
       
    81     JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
       
    82         $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
       
    83   endif
       
    84 
       
    85   ifneq ($(OPENJDK_TARGET_OS), windows)
       
    86     ifeq ($(call check-jvm-variant, server), true)
       
    87       BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
       
    88       ifneq (, $(JSIG_DEBUGINFO))
       
    89         BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
       
    90       endif
       
    91     endif
       
    92     ifeq ($(call check-jvm-variant, client), true)
       
    93       BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
       
    94       ifneq (, $(JSIG_DEBUGINFO))
       
    95         BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
       
    96       endif
       
    97     endif
       
    98     ifneq ($(OPENJDK_TARGET_OS), macosx)
       
    99       ifeq ($(call check-jvm-variant, minimal), true)
       
   100         BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
       
   101         ifneq (,$(JSIG_DEBUGINFO))
       
   102           BASE_TARGETS += $(BASE_INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
       
   103         endif
       
   104       endif
       
   105     endif
       
   106   endif
       
   107 endif
       
   108 
       
   109 $(BASE_INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
       
   110 	$(MKDIR) -p $(@D)
       
   111 	$(RM) $@
       
   112 	$(LN) -s ../$(@F) $@
       
   113 
       
   114 ifeq ($(OPENJDK_TARGET_OS), macosx)
       
   115   $(BASE_INSTALL_LIBRARIES_HERE)/server/%.dSYM:
       
   116 	$(MKDIR) -p $(@D)
       
   117 	$(RM) $@
       
   118 	$(LN) -s ../$(@F) $@
       
   119 
       
   120   $(BASE_INSTALL_LIBRARIES_HERE)/server/%.diz : $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
       
   121 	$(MKDIR) -p $(@D)
       
   122 	$(RM) $@
       
   123 	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   124 	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   125 	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
       
   126 	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   127 	$(MV) $@.tmp $@
       
   128 else
       
   129   $(BASE_INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
       
   130 	$(MKDIR) -p $(@D)
       
   131 	$(RM) $@
       
   132 	$(LN) -s ../$(@F) $@
       
   133 
       
   134   $(BASE_INSTALL_LIBRARIES_HERE)/server/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
       
   135 	$(MKDIR) -p $(@D)
       
   136 	$(RM) $@
       
   137 	$(RM) $@.tmp $(basename $@).debuginfo
       
   138 	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
       
   139 	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
       
   140 	$(RM) $(basename $@).debuginfo
       
   141 	$(MV) $@.tmp $@
       
   142 endif
       
   143 
       
   144 $(BASE_INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
       
   145 	$(MKDIR) -p $(@D)
       
   146 	$(RM) $@
       
   147 	$(LN) -s ../$(@F) $@
       
   148 
       
   149 ifeq ($(OPENJDK_TARGET_OS), macosx)
       
   150   $(BASE_INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(BASE_INSTALL_LIBRARIES_HERE)/%.dSYM
       
   151 	$(MKDIR) -p $(@D)
       
   152 	$(RM) $@
       
   153 	$(LN) -s ../$(@F) $@
       
   154 
       
   155   $(BASE_INSTALL_LIBRARIES_HERE)/client/%.diz : $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
       
   156 	$(MKDIR) -p $(@D)
       
   157 	$(RM) $@
       
   158 	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   159 	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   160 	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
       
   161 	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
       
   162 	$(MV) $@.tmp $@
       
   163 else
       
   164   $(BASE_INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
       
   165 	$(MKDIR) -p $(@D)
       
   166 	$(RM) $@
       
   167 	$(LN) -s ../$(@F) $@
       
   168 
       
   169   $(BASE_INSTALL_LIBRARIES_HERE)/client/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
       
   170 	$(MKDIR) -p $(@D)
       
   171 	$(RM) $@
       
   172 	$(RM) $@.tmp $(basename $@).debuginfo
       
   173 	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
       
   174 	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
       
   175 	$(RM) $(basename $@).debuginfo
       
   176 	$(MV) $@.tmp $@
       
   177 endif
       
   178 
       
   179 $(BASE_INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
       
   180 	$(MKDIR) -p $(@D)
       
   181 	$(RM) $@
       
   182 	$(LN) -s ../$(@F) $@
       
   183 
       
   184 ifneq ($(OPENJDK_TARGET_OS), macosx)
       
   185   $(BASE_INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(BASE_INSTALL_LIBRARIES_HERE)/%.debuginfo
       
   186 	$(MKDIR) -p $(@D)
       
   187 	$(RM) $@
       
   188 	$(LN) -s ../$(@F) $@
       
   189 
       
   190   $(BASE_INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(BASE_INSTALL_LIBRARIES_HERE)/%.diz
       
   191 	$(MKDIR) -p $(@D)
       
   192 	$(RM) $@
       
   193 	$(RM) $@.tmp $(basename $@).debuginfo
       
   194 	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
       
   195 	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
       
   196 	$(RM) $(basename $@).debuginfo
       
   197 	$(MV) $@.tmp $@
       
   198 endif
       
   199 
       
   200 ################################################################################
       
   201 
       
   202 ifeq ($(OPENJDK_TARGET_OS), windows)
       
   203   $(eval $(call SetupCopyFiles,BASE_COPY_LIBS_BIN, \
       
   204       SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
       
   205       DEST := $(JDK_OUTPUTDIR)/bin, \
       
   206       FILES := $(filter-out %.lib, $(BASE_TARGETS))))
       
   207 
       
   208   $(eval $(call SetupCopyFiles,BASE_COPY_LIBS_LIB, \
       
   209       SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
       
   210       DEST := $(JDK_OUTPUTDIR)/lib, \
       
   211       FILES := $(filter %.lib, $(BASE_TARGETS))))
       
   212 
       
   213 else
       
   214   $(eval $(call SetupCopyFiles,BASE_COPY_LIBS, \
       
   215       SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
       
   216       DEST := $(JDK_OUTPUTDIR)/lib, \
       
   217       FILES := $(BASE_TARGETS)))
       
   218 endif
       
   219 
       
   220 ################################################################################
       
   221 
       
   222 all: $(BASE_TARGETS) $(BASE_COPY_LIBS_BIN) $(BASE_COPY_LIBS_LIB) \
       
   223     $(BASE_COPY_LIBS)
       
   224 
       
   225 .PHONY: default all