Makefile 18.5 KB
Newer Older
1 2 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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
#
# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
# 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.
#

#
# Imports files exported by a hotspot build or provided from an external
#   location into the OUTPUTDIR, and also primes the OUTPUTDIR with files
#   that are provided inside this workspace.
#
# IMPORT_LIST contains the list of destination files that are copied 
#     from external places (outside this workspace).
#
# INTERNAL_IMPORT_LIST is the list of destination files from BUILDDIR.
# 

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

$(info ENTERING redist)

SERVER_LOCATION = server
CLIENT_LOCATION = client
KERNEL_LOCATION = kernel

DB_SUFFIX = _db
DTRACE_SUFFIX = _dtrace

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

JVM_NAME               = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX)
JVMLIB_NAME            = $(LIB_PREFIX)jvm.$(LIB_SUFFIX)
JVMMAP_NAME            = $(LIB_PREFIX)jvm.map
JVMPDB_NAME            = $(LIB_PREFIX)jvm.pdb
LIBJSIG_NAME           = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX)
JVMDB_NAME             = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)
JVMDTRACE_NAME         = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX)

JVM_DEBUGINFO_NAME       = $(LIB_PREFIX)jvm.debuginfo
LIBJSIG_DEBUGINFO_NAME   = $(LIB_PREFIX)jsig.debuginfo
JVMDB_DEBUGINFO_NAME     = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo
JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo

CLASSSHARINGDATA_DIR   = $(BUILDDIR)/../make/tools/sharing

# Needed to do file copy
ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))

SUBDIRS_desktop = fonts
SUBDIRS_tools   = sajdi
include $(BUILDDIR)/common/Subdirs.gmk

all clean clobber::
	$(SUBDIRS-loop)

all:: build

# List of files created here or coming from BUILDDIR area (this workspace)
INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist

# List of files coming from outside this workspace
ifeq ($(JVM_VARIANT_SERVER),true)
    IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
                  $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
    ifneq ($(OBJCOPY),)
        # the import JDK may not contain .debuginfo files
        ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)),)
           IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME)
        endif
    endif
endif
ifeq ($(JVM_VARIANT_CLIENT),true)
    IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
                   $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
    ifneq ($(OBJCOPY),)
        # the import JDK may not contain .debuginfo files
        ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)),)
            IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME)
        endif
    endif
endif

$(info ENTERING redist 2)
ifeq ($(PLATFORM), windows)
    IMPORT_LIST += $(BINDIR)/$(notdir $(MSVCR100DLL))

    $(BINDIR)/$(notdir $(MSVCR100DLL)): $(MSVCR100DLL)
	$(install-import-file)
	$(call chmod-file, a+x)

    # Get the hotspot .map and .pdb files for client and server
    ifeq ($(JVM_VARIANT_SERVER),true)
        IMPORT_LIST += \
		$(LIBDIR)/$(JVMLIB_NAME) \
		$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
		$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
    endif

    # Add .map and .pdb files to the import path for client and kernel VMs. 
    ifeq ($(JVM_VARIANT_CLIENT),true)
        IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
                       $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
    endif
    ifeq ($(JVM_VARIANT_KERNEL),true)
        IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME) \
                       $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME)
    endif

    $(info XXXX $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME))
    $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
	$(install-import-file)

    # it is OK for the .map and .pdb files to not exist, so do not force a 
    # dependency on them from the bootstrap location, and allow the copy to fail.
    $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@

    $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME)  $@

    $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@

    $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@

    $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
	@$(prep-target)
	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME)  $@

    $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
	@$(prep-target)
	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@

else
    # Posix like systems
    IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_NAME)
    ifneq ($(OBJCOPY),)
        # the import JDK may not contain .debuginfo files
        ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
            IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
        endif
    endif
    ifeq ($(JVM_VARIANT_CLIENT),true)
        IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
        ifneq ($(OBJCOPY),)
            # the import JDK may not contain the target of the symlink
            ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
            endif
        endif
    endif
    ifeq ($(JVM_VARIANT_SERVER),true)
        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
        ifneq ($(OBJCOPY),)
            # the import JDK may not contain the target of the symlink
            ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
            endif
        endif
    endif

    ifeq ($(PLATFORM), solaris)

        ifeq ($(JVM_VARIANT_CLIENT),true)
            IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)

            # The conditional can be removed when import JDKs contain these files.
            ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME)
                IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
                IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME)
                ifneq ($(OBJCOPY),)
                    # the import JDK may not contain .debuginfo files
                    ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
                        IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
                        IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
                        IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
                    endif
                endif
            else
                $(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!)
            endif

            $(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
			@$(prep-target)
        endif 

        ifeq ($(JVM_VARIANT_SERVER),true)
            IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
            ifneq ($(OBJCOPY),)
                # the import JDK may not contain .debuginfo files
                ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)),)
                    IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME)
                endif
            endif
            # The conditional can be removed when import JDKs contain these files.
            ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
                ifneq ($(OBJCOPY),)
                    # the import JDK may not contain .debuginfo files
                    ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
                        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
                    endif
                endif
            else
                $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
            endif 

            # The conditional can be removed when import JDKs contain these files.
            ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
                ifneq ($(OBJCOPY),)
                    # the import JDK may not contain .debuginfo files
                    ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)),)
                        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
                    endif
                endif
            else
                $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
            endif

            # The conditional can be removed when import JDKs contain these files.
            ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
                IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
                ifneq ($(OBJCOPY),)
                    # the import JDK may not contain .debuginfo files
                    ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)),)
                        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
                    endif
                endif
            else
                $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
            endif
        endif
    endif 
endif 

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
	$(install-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
	@$(prep-target)
	$(call install-sym-link, ../$(LIBJSIG_NAME))

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
	@$(prep-target)
	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
endif
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
	@$(prep-target)
	$(call install-sym-link, ../$(LIBJSIG_NAME))

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
	@$(prep-target)
	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
endif

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
	$(install-import-file)
	@$(call binary_file_verification,$@)

ifneq ($(OBJCOPY),)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
	$(install-import-file)

$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)
	$(install-import-file)
endif

$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
	$(install-import-file)


$(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
	$(install-import-file)

$(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt
	$(install-file)

#
# Specific to non-OpenJDK building
#
ifndef OPENJDK

INTERNAL_IMPORT_LIST += \
            $(LIBDIR)/security/US_export_policy.jar \
            $(LIBDIR)/security/local_policy.jar \
            $(LIBDIR)/jce.jar

$(LIBDIR)/jce.jar: \
	    $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
	$(install-file)
$(LIBDIR)/security/US_export_policy.jar: \
	    $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
	$(install-file)
$(LIBDIR)/security/local_policy.jar: \
	    $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
	$(install-file)

endif # OPENJDK

# Construct classlist file
$(LIBDIR)/classlist: \
    $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) \
    $(ADDJSUM_JARFILE)
	@$(prep-target)
	@$(RM) -f $@.temp
	$(TOOL_ADDJSUM) \
	    $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp
	$(MV) $@.temp $@

# Import internal files (ones that are stashed in this source tree)
import_internal_files : $(INTERNAL_IMPORT_LIST)

# Import files from the JDK that we are not building
import_files: $(IMPORT_LIST)

# Get component information variables and rules
include $(BUILDDIR)/common/internal/ImportComponents.gmk

# Security files we need to import
SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip
SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip
JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip
JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip

# Unzip zip file $2 into directory $1 (if $2 exists)
#   Warning: $2 must be absolute path not relative
define SecUnzipper
if [ -f $2 ] ; then \
  $(MKDIR) -p $1; \
  $(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \
  ( $(CD) $1 && $(UNZIP) -o $2 ); \
fi
endef

# If sec-bin exists, unpack it into the build directory
#   Also, the library recompile build indirectly depends on two SSL classes,
#   so copy those as well   FIXUP
#   if sec-windows-bin exists, unpack it into the build directory
#   if JGSS files exists, unpack it into the build directory
$(TEMPDIR)/security_imported:
	@$(prep-target)
	@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_ZIP))
ifeq ($(PLATFORM), windows)
	@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_WIN_ZIP))
endif
ifeq ($(PLATFORM), windows)
    ifeq ($(ARCH_DATA_MODEL), 32)
	@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN32_FILES_ZIP))
    else
	@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN64_FILES_ZIP))
    endif
endif
	@$(ECHO) "Imported on `$(DATE)`" > $@

# Import all files from other components
$(TEMPDIR)/components_imported:
	@$(prep-target)
	$(call import-component-binaries,$(ABS_OUTPUTDIR))
	$(call import-component-sources,$(IMPORTSRCDIR))
	$(call import-component-docs,$(IMPORTDOCDIR))
	$(call import-component-classes,$(CLASSDESTDIR))
	@$(ECHO) "Imported on `$(DATE)`" > $@

# Do pretty much everything
build : import_files \
	import_internal_files \
	$(TEMPDIR)/components_imported \
	$(TEMPDIR)/security_imported

# Clean up what we imported (except for component files)
clean clobber::
	$(RM) $(IMPORT_LIST)
	$(RM) $(INTERNAL_IMPORT_LIST)
	$(call import-component-sources-clean,$(IMPORTSRCDIR))
	$(call import-component-docs-clean,$(IMPORTDOCDIR))
	$(call import-component-classes-clean,$(CLASSDESTDIR))
	$(RM) $(TEMPDIR)/components_imported
	$(RM) $(TEMPDIR)/security_imported

.PHONY: import_files import_internal_files