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 #
  27 # Imports files exported by a hotspot build or provided from an external
  28 #   location into the OUTPUTDIR, and also primes the OUTPUTDIR with files
  29 #   that are provided inside this workspace.
  30 #
  31 # IMPORT_LIST contains the list of destination files that are copied 
  32 #     from external places (outside this workspace).
  33 #
  34 # INTERNAL_IMPORT_LIST is the list of destination files from BUILDDIR.
  35 # 
  36 
  37 BUILDDIR = ../..
  38 MODULE   = base
  39 PRODUCT  = java
  40 include $(BUILDDIR)/common/Defs.gmk
  41 
  42 SERVER_LOCATION = server
  43 CLIENT_LOCATION = client
  44 
  45 DB_SUFFIX = _db
  46 DTRACE_SUFFIX = _dtrace
  47 
  48 ifeq ($(PLATFORM), windows)
  49   LIB_LOCATION = $(BINDIR)
  50 else ifeq ($(PLATFORM), macosx)
  51   LIB_LOCATION = $(LIBDIR)
  52 else
  53   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
  54 endif
  55 
  56 JVM_NAME               = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX)
  57 JVMLIB_NAME            = $(LIB_PREFIX)jvm.$(LIB_SUFFIX)
  58 JVMMAP_NAME            = $(LIB_PREFIX)jvm.map
  59 JVMPDB_NAME            = $(LIB_PREFIX)jvm.pdb
  60 LIBJSIG_NAME           = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX)
  61 JVMDB_NAME             = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)
  62 JVMDTRACE_NAME         = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX)
  63 
  64 JVM_DEBUGINFO_NAME       = $(LIB_PREFIX)jvm.debuginfo
  65 JVM_DIZ_NAME             = $(LIB_PREFIX)jvm.diz
  66 LIBJSIG_DEBUGINFO_NAME   = $(LIB_PREFIX)jsig.debuginfo
  67 LIBJSIG_DIZ_NAME         = $(LIB_PREFIX)jsig.diz
  68 JVMDB_DEBUGINFO_NAME     = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo
  69 JVMDB_DIZ_NAME           = $(LIB_PREFIX)jvm$(DB_SUFFIX).diz
  70 JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo
  71 JVMDTRACE_DIZ_NAME       = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).diz
  72 
  73 CLASSSHARINGDATA_DIR   = $(BUILDDIR)/tools/sharing
  74 
  75 # Needed to do file copy
  76 ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))
  77 
  78 SUBDIRS_desktop = fonts
  79 SUBDIRS_tools   = sajdi
  80 include $(BUILDDIR)/common/Subdirs.gmk
  81 
  82 all clean clobber::
  83         $(SUBDIRS-loop)
  84 
  85 all:: build
  86 
  87 # List of files created here or coming from BUILDDIR area (this workspace)
  88 INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
  89 
  90 # List of files coming from outside this workspace
  91 ifndef BUILD_CLIENT_ONLY
  92   IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
  93                 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
  94   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
  95     ifeq ($(ZIP_DEBUGINFO_FILES),1)
  96       # the import JDK may not contain .diz files
  97       ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVM_DIZ_NAME)),)
  98         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME)
  99       endif
 100     else
 101       # the import JDK may not contain .debuginfo files
 102       ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)),)
 103         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME)
 104       endif
 105     endif
 106   endif
 107 else
 108   IMPORT_LIST =
 109 endif
 110 
 111 # Hotspot client is only available on 32-bit non-Zero builds
 112 ifneq ($(ZERO_BUILD), true)
 113 ifeq ($(ARCH_DATA_MODEL), 32)
 114   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
 115                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
 116   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 117     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 118       # the import JDK may not contain .diz files
 119       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVM_DIZ_NAME)),)
 120         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME)
 121       endif
 122     else
 123       # the import JDK may not contain .debuginfo files
 124       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)),)
 125         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME)
 126       endif
 127     endif
 128   endif
 129 endif
 130 endif
 131 
 132 ifeq ($(PLATFORM), windows)
 133 #  Windows     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Windows
 134 
 135 IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%)
 136 
 137 $(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)
 138         $(install-import-file)
 139         $(call chmod-file, a+x)
 140 
 141 # Get the hotspot .map and .pdb files for client and server
 142 ifndef BUILD_CLIENT_ONLY
 143   IMPORT_LIST += $(LIBDIR)/$(JVMLIB_NAME)
 144   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 145     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 146       # the import JDK may not contain .diz files
 147       ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVM_DIZ_NAME)),)
 148         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME)
 149       endif
 150     else
 151       # the import JDK may not contain .pdb files
 152       ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME)),)
 153         # assume .map file is present if .pdb file is preset
 154         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
 155           $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
 156       endif
 157     endif
 158   endif
 159 endif
 160 
 161 # Add .map and .pdb files to the import path for client and kernel VMs. 
 162 # These are only available on 32-bit windows builds. 
 163 ifeq ($(ARCH_DATA_MODEL), 32)
 164   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 165     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 166       # the import JDK may not contain .diz files
 167       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVM_DIZ_NAME)),)
 168         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME)
 169       endif
 170     else
 171       # the import JDK may not contain .pdb files
 172       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)),)
 173         # assume .map file is present if .pdb file is preset
 174         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
 175                        $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
 176       endif
 177     endif
 178     ifeq ($(DO_KERNEL), true)
 179       ifeq ($(ZIP_DEBUGINFO_FILES),1)
 180         # the import JDK may not contain .diz files
 181         ifneq ($(wildcard $(HOTSPOT_KERNEL_PATH)/$(JVM_DIZ_NAME)),)
 182           IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_DIZ_NAME)
 183         endif
 184       else
 185         # the import JDK may not contain .pdb files
 186         ifneq ($(wildcard $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME)),)
 187           # assume .map file is present if .pdb file is preset
 188           IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME) \
 189                          $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME)
 190         endif
 191       endif
 192     endif
 193   endif
 194 endif
 195 
 196 $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
 197         $(install-import-file)
 198 
 199 # it is OK for the .map and .pdb files to not exist, so do not force a 
 200 # dependency on them from the bootstrap location, and allow the copy to fail.
 201 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
 202         @$(prep-target)
 203         -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@
 204         @$(install-module-file)
 205 
 206 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
 207         @$(prep-target)
 208         -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME)  $@
 209         @$(install-module-file)
 210 
 211 ifndef BUILD_CLIENT_ONLY
 212 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
 213         @$(prep-target)
 214         -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
 215         @$(install-module-file)
 216 endif
 217 
 218 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
 219         @$(prep-target)
 220         -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@
 221         @$(install-module-file)
 222 
 223 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
 224         @$(prep-target)
 225         -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME)  $@
 226         @$(install-module-file)
 227 
 228 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME):
 229         @$(prep-target)
 230         -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVM_DIZ_NAME)  $@
 231         @$(install-module-file)
 232 
 233 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_DIZ_NAME):
 234         @$(prep-target)
 235         -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVM_DIZ_NAME)  $@
 236         @$(install-module-file)
 237 
 238 ifndef BUILD_CLIENT_ONLY
 239 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
 240         @$(prep-target)
 241         -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
 242         @$(install-module-file)
 243 
 244 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME):
 245         @$(prep-target)
 246         -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVM_DIZ_NAME) $@
 247         @$(install-module-file)
 248 endif
 249 
 250 #  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
 251 else # PLATFORM
 252 #  NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  NOT Windows
 253 
 254 IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_NAME) 
 255 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 256   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 257     # the import JDK may not contain .diz files
 258     ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)),)
 259       IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_DIZ_NAME)
 260     endif
 261   else
 262     # the import JDK may not contain .debuginfo files
 263     ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
 264       IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
 265     endif
 266   endif
 267 endif
 268 ifndef BUILD_CLIENT_ONLY
 269   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
 270   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 271     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 272       # the import JDK may not contain the target of the symlink
 273       ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)),)
 274         # check for the .diz file, but create the .debuginfo link
 275         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
 276       endif
 277     else
 278       # the import JDK may not contain the target of the symlink
 279       ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
 280         IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
 281       endif
 282     endif
 283   endif
 284 endif
 285 
 286 ifeq ($(PLATFORM), solaris)
 287   ifndef BUILD_CLIENT_ONLY
 288     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
 289     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 290       ifeq ($(ZIP_DEBUGINFO_FILES),1)
 291         # the import JDK may not contain .diz files
 292         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDB_DIZ_NAME)),)
 293           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DIZ_NAME)
 294         endif
 295       else
 296         # the import JDK may not contain .debuginfo files
 297         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)),)
 298           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME)
 299         endif
 300       endif
 301     endif
 302     # The conditional can be removed when import JDKs contain these files.
 303     ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
 304       IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
 305       ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 306         ifeq ($(ZIP_DEBUGINFO_FILES),1)
 307           # the import JDK may not contain .diz files
 308           ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DIZ_NAME)),)
 309             IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DIZ_NAME)
 310           endif
 311         else
 312           # the import JDK may not contain .debuginfo files
 313           ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
 314             IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
 315           endif
 316         endif
 317       endif
 318     else
 319       $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
 320     endif 
 321   endif 
 322 endif
 323 
 324 ifneq ($(ZERO_BUILD), true)
 325 ifeq ($(ARCH_DATA_MODEL), 32)
 326 
 327 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
 328 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 329   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 330     # the import JDK may not contain the target of the symlink
 331     ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)),)
 332       # check for the .diz file, but create the .debuginfo link
 333       IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
 334     endif
 335   else
 336     # the import JDK may not contain the target of the symlink
 337     ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
 338       IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
 339     endif
 340   endif
 341 endif
 342 
 343 ifeq ($(PLATFORM), solaris)
 344 #  solaris   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  solaris
 345 
 346 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)
 347 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 348   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 349     # the import JDK may not contain .diz files
 350     ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DIZ_NAME)),)
 351       IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DIZ_NAME)
 352     endif
 353   else
 354     # the import JDK may not contain .debuginfo files
 355     ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME)),)
 356       IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME)
 357     endif
 358   endif
 359 endif
 360 
 361 # The conditional can be removed when import JDKs contain these files.
 362 ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)),)
 363   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME)
 364   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
 365   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME)
 366   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 367     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 368       # the import JDK may not contain .diz files
 369       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DIZ_NAME)),)
 370         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DIZ_NAME)
 371         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DIZ_NAME)
 372         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DIZ_NAME)
 373       endif
 374     else
 375       # the import JDK may not contain .debuginfo files
 376       ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
 377         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
 378         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
 379         IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
 380       endif
 381     endif
 382   endif
 383 else
 384   $(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!)
 385 endif
 386 
 387 ifndef BUILD_CLIENT_ONLY
 388   # The conditional can be removed when import JDKs contain these files.
 389   ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
 390     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
 391     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 392       ifeq ($(ZIP_DEBUGINFO_FILES),1)
 393         # the import JDK may not contain .diz files
 394         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DIZ_NAME)),)
 395           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DIZ_NAME)
 396         endif
 397       else
 398         # the import JDK may not contain .debuginfo files
 399         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)),)
 400           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
 401         endif
 402       endif
 403     endif
 404   else
 405     $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
 406   endif
 407 
 408   # The conditional can be removed when import JDKs contain these files.
 409   ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
 410     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
 411     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 412       ifeq ($(ZIP_DEBUGINFO_FILES),1)
 413         # the import JDK may not contain .diz files
 414         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DIZ_NAME)),)
 415           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DIZ_NAME)
 416         endif
 417       else
 418         # the import JDK may not contain .debuginfo files
 419         ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)),)
 420           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
 421         endif
 422       endif
 423     endif
 424   else
 425     $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
 426  endif
 427 endif
 428 
 429 # For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
 430 IMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME)
 431 
 432 $(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
 433         @$(prep-target)
 434 
 435 #  solaris   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris
 436 endif # 32bit solaris
 437 
 438 endif # 32bit
 439 
 440 endif # ZERO_BUILD
 441 
 442 #  NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows
 443 
 444 endif # PLATFORM
 445 
 446 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
 447         $(install-import-file)
 448         @$(call binary_file_verification,$@)
 449 
 450 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 451   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 452 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DIZ_NAME)
 453         $(install-import-file)
 454   else
 455 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)
 456         $(install-import-file)
 457   endif
 458 endif
 459 
 460 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
 461         $(install-file)
 462         @$(call binary_file_verification,$@)
 463 
 464 $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_ARCH_VM_SUBDIR)/$(LIBJSIG_NAME)
 465         $(install-import-file)
 466         @$(call binary_file_verification,$@)
 467 
 468 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 469   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 470 $(LIB_LOCATION)/$(LIBJSIG_DIZ_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DIZ_NAME)
 471         $(install-import-file)
 472   else
 473 $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)
 474         $(install-import-file)
 475   endif
 476 endif
 477 
 478 ifndef BUILD_CLIENT_ONLY
 479 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
 480 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
 481         @$(prep-target)
 482         $(call install-sym-link, ../$(LIBJSIG_NAME))
 483 
 484   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 485 # we don't create a symlink to a libjsig.diz file
 486 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME) \
 487 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
 488         @$(prep-target)
 489         $(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
 490   endif
 491 else
 492 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
 493         @$(prep-target)
 494         $(call install-sym-link, ../$(LIBJSIG_NAME))
 495 
 496   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 497 # we don't create a symlink to a libjsig.diz file
 498 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
 499         @$(prep-target)
 500         $(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
 501   endif
 502 endif
 503 
 504 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
 505         $(install-import-file)
 506         @$(call binary_file_verification,$@)
 507 
 508 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
 509         $(install-import-file)
 510         @$(call binary_file_verification,$@)
 511 
 512 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 513   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 514 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DIZ_NAME)
 515         $(install-import-file)
 516 
 517 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DIZ_NAME)
 518         $(install-import-file)
 519   else
 520 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME)
 521         $(install-import-file)
 522 
 523 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
 524         $(install-import-file)
 525   endif
 526 endif
 527 
 528 ifndef BUILD_CLIENT_ONLY
 529 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
 530         $(install-import-file)
 531         @$(call binary_file_verification,$@)
 532 
 533 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
 534         $(install-import-file)
 535         @$(call binary_file_verification,$@)
 536 
 537   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 538     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 539 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DIZ_NAME)
 540         $(install-import-file)
 541 
 542 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DIZ_NAME)
 543         $(install-import-file)
 544     else
 545 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)
 546         $(install-import-file)
 547 
 548 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
 549         $(install-import-file)
 550     endif
 551   endif
 552 endif
 553 
 554 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)
 555         $(install-import-file)
 556         @$(call binary_file_verification,$@)
 557 
 558 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_NAME)
 559         $(install-import-file)
 560         @$(call binary_file_verification,$@)
 561 
 562 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 563   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 564 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DIZ_NAME)
 565         $(install-import-file)
 566 
 567 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DIZ_NAME)
 568         $(install-import-file)
 569   else
 570 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
 571         $(install-import-file)
 572 
 573 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
 574         $(install-import-file)
 575   endif
 576 endif
 577 
 578 ifndef BUILD_CLIENT_ONLY
 579 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)
 580         $(install-import-file)
 581         @$(call binary_file_verification,$@)
 582 
 583 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)
 584         $(install-import-file)
 585         @$(call binary_file_verification,$@)
 586 
 587 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
 588         $(install-import-file)
 589         @$(call binary_file_verification,$@)
 590 
 591 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 592   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 593 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DIZ_NAME)
 594         $(install-import-file)
 595 
 596 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DIZ_NAME)
 597         $(install-import-file)
 598 
 599 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DIZ_NAME)
 600         $(install-import-file)
 601   else
 602 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
 603         $(install-import-file)
 604 
 605 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
 606         $(install-import-file)
 607 
 608 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)
 609         $(install-import-file)
 610   endif
 611 endif
 612 
 613 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
 614         $(install-import-file)
 615 endif
 616 
 617 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
 618         $(install-import-file)
 619 
 620 $(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt
 621         $(install-file)
 622 
 623 #
 624 # Specific to non-OpenJDK building
 625 #
 626 ifndef OPENJDK
 627 
 628 INTERNAL_IMPORT_LIST += \
 629             $(LIBDIR)/security/US_export_policy.jar \
 630             $(LIBDIR)/security/local_policy.jar \
 631             $(LIBDIR)/jce.jar
 632 
 633 $(LIBDIR)/jce.jar: \
 634             $(BUILDDIR)/closed/tools/crypto/jce/jce.jar
 635         $(install-non-module-file)
 636 $(LIBDIR)/security/US_export_policy.jar: \
 637             $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
 638         $(install-file)
 639 $(LIBDIR)/security/local_policy.jar: \
 640             $(BUILDDIR)/closed/tools/crypto/jce/local_policy.jar
 641         $(install-file)
 642 
 643 endif # OPENJDK
 644 
 645 ADDJSUM_JARFILE = $(BUILDTOOLJARDIR)/addjsum.jar
 646 
 647 # Construct classlist file
 648 $(LIBDIR)/classlist: \
 649     $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) \
 650     $(ADDJSUM_JARFILE)
 651         @$(prep-target)
 652         @$(RM) -f $@.temp
 653         $(BOOT_JAVA_CMD) -jar $(ADDJSUM_JARFILE) \
 654             $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp
 655         $(MV) $@.temp $@
 656 
 657 # Import internal files (ones that are stashed in this source tree)
 658 import_internal_files : $(INTERNAL_IMPORT_LIST)
 659 
 660 # Import files from the JDK that we are not building
 661 import_files: $(IMPORT_LIST)
 662 
 663 # Get component information variables and rules
 664 include $(BUILDDIR)/common/internal/ImportComponents.gmk
 665 
 666 # Security files we need to import
 667 SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip
 668 SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip
 669 JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip
 670 JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip
 671 
 672 # Unzip zip file $2 into directory $1 (if $2 exists)
 673 #   Warning: $2 must be absolute path not relative
 674 define SecUnzipper
 675 if [ -f $2 ] ; then \
 676   $(MKDIR) -p $1; \
 677   $(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \
 678   ( $(CD) $1 && $(UNZIP) -o $2 ); \
 679 fi
 680 endef
 681 
 682 # If sec-bin exists, unpack it into the build directory
 683 #   Also, the library recompile build indirectly depends on two SSL classes,
 684 #   so copy those as well   FIXUP
 685 #   if sec-windows-bin exists, unpack it into the build directory
 686 #   if JGSS files exists, unpack it into the build directory
 687 $(TEMPDIR)/security_imported:
 688         @$(prep-target)
 689         @$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_ZIP))
 690 ifeq ($(PLATFORM), windows)
 691         @$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_WIN_ZIP))
 692 endif
 693 ifeq ($(PLATFORM), windows)
 694     ifeq ($(ARCH_DATA_MODEL), 32)
 695         @$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN32_FILES_ZIP))
 696     else
 697         @$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN64_FILES_ZIP))
 698     endif
 699 endif
 700         @$(ECHO) "Imported on `$(DATE)`" > $@
 701 
 702 # Import all files from other components
 703 $(TEMPDIR)/components_imported:
 704         @$(prep-target)
 705         $(call import-component-binaries,$(ABS_OUTPUTDIR))
 706         $(call import-component-sources,$(IMPORTSRCDIR))
 707         $(call import-component-docs,$(IMPORTDOCDIR))
 708         $(call import-component-classes,$(CLASSDESTDIR))
 709         @$(ECHO) "Imported on `$(DATE)`" > $@
 710 
 711 # Do pretty much everything
 712 build : import_files \
 713         import_internal_files \
 714         $(TEMPDIR)/components_imported \
 715         $(TEMPDIR)/security_imported
 716 
 717 # Clean up what we imported (except for component files)
 718 clean clobber::
 719         $(RM) $(IMPORT_LIST)
 720         $(RM) $(INTERNAL_IMPORT_LIST)
 721         $(call import-component-sources-clean,$(IMPORTSRCDIR))
 722         $(call import-component-docs-clean,$(IMPORTDOCDIR))
 723         $(call import-component-classes-clean,$(CLASSDESTDIR))
 724         $(RM) $(TEMPDIR)/components_imported
 725         $(RM) $(TEMPDIR)/security_imported
 726 
 727 .PHONY: import_files import_internal_files
 728