1 # 2 # Copyright (c) 1997, 2009, 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 51 LIB_LOCATION = $(LIBDIR)/$(LIBARCH) 52 endif 53 54 JVM_NAME = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) 55 JVMLIB_NAME = $(LIB_PREFIX)jvm.$(LIB_SUFFIX) 56 JVMMAP_NAME = $(LIB_PREFIX)jvm.map 57 JVMPDB_NAME = $(LIB_PREFIX)jvm.pdb 58 LIBJSIG_NAME = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX) 59 JVMDB_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX) 60 JVMDTRACE_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX) 61 62 CLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing 63 64 # Needed to do file copy 65 ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR)) 66 67 SUBDIRS_desktop = fonts 68 SUBDIRS_tools = sajdi 69 include $(BUILDDIR)/common/Subdirs.gmk 70 71 all clean clobber:: 72 $(SUBDIRS-loop) 73 74 all:: build 75 76 # List of files created here or coming from BUILDDIR area (this workspace) 77 INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist 78 79 # List of files coming from outside this workspace 80 IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \ 81 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt 82 83 # Hotspot client is only available on 32-bit non-Zero builds 84 ifneq ($(ZERO_BUILD), true) 85 ifeq ($(ARCH_DATA_MODEL), 32) 86 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \ 87 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt 88 endif 89 endif 90 91 ifeq ($(PLATFORM), windows) 92 # Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Windows 93 94 IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%) 95 96 # NOTE: These might actually come from BUILDDIR, depends on the settings. 97 $(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll 98 $(install-import-file) 99 $(call chmod-file, a+x) 100 $(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL) 101 $(install-import-file) 102 $(call chmod-file, a+x) 103 104 # Get the hotspot .map and .pdb files for client and server 105 IMPORT_LIST += \ 106 $(LIBDIR)/$(JVMLIB_NAME) \ 107 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \ 108 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME) 109 110 # Add .map and .pdb files to the import path for client and kernel VMs. 111 # These are only available on 32-bit windows builds. 112 ifeq ($(ARCH_DATA_MODEL), 32) 113 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \ 114 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME) 115 ifeq ($(DO_KERNEL), true) 116 IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME) \ 117 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME) 118 endif 119 endif 120 121 $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME) 122 $(install-import-file) 123 124 # it is OK for the .map and .pdb files to not exist, so do not force a 125 # dependency on them from the bootstrap location, and allow the copy to fail. 126 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME): 127 @$(prep-target) 128 -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@ 129 @$(install-module-file) 130 131 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME): 132 @$(prep-target) 133 -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@ 134 @$(install-module-file) 135 136 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME): 137 @$(prep-target) 138 -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@ 139 @$(install-module-file) 140 141 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME): 142 @$(prep-target) 143 -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@ 144 @$(install-module-file) 145 146 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME): 147 @$(prep-target) 148 -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@ 149 @$(install-module-file) 150 151 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 152 @$(prep-target) 153 -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@ 154 @$(install-module-file) 155 156 # Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows 157 else # PLATFORM 158 # NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv NOT Windows 159 160 IMPORT_LIST += \ 161 $(LIB_LOCATION)/$(LIBJSIG_NAME) \ 162 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME) 163 164 ifeq ($(PLATFORM), solaris) 165 IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME) 166 # The conditional can be removed when import JDKs contain these files. 167 ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),) 168 IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME) 169 else 170 $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!) 171 endif 172 endif 173 174 ifneq ($(ZERO_BUILD), true) 175 ifeq ($(ARCH_DATA_MODEL), 32) 176 177 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) 178 179 ifeq ($(PLATFORM), solaris) 180 # solaris vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv solaris 181 182 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME) 183 184 # The conditional can be removed when import JDKs contain these files. 185 ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)),) 186 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME) 187 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME) 188 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME) 189 else 190 $(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!) 191 endif 192 193 # The conditional can be removed when import JDKs contain these files. 194 ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),) 195 IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME) 196 else 197 $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!) 198 endif 199 200 # The conditional can be removed when import JDKs contain these files. 201 ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),) 202 IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME) 203 else 204 $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!) 205 endif 206 207 # For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR) 208 IMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME) 209 210 $(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) 211 @$(prep-target) 212 213 # solaris ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris 214 endif # 32bit solaris 215 216 endif # 32bit 217 218 endif # ZERO_BUILD 219 220 # NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows 221 222 endif # PLATFORM 223 224 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME) 225 $(install-import-file) 226 227 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME) 228 $(install-file) 229 230 $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_NAME) 231 $(install-import-file) 232 233 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \ 234 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME): 235 @$(prep-target) 236 $(call install-sym-link, ../$(LIBJSIG_NAME)) 237 238 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME) 239 $(install-import-file) 240 241 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME) 242 $(install-import-file) 243 244 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) 245 $(install-import-file) 246 247 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) 248 $(install-import-file) 249 250 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) 251 $(install-import-file) 252 253 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_NAME) 254 $(install-import-file) 255 256 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME) 257 $(install-import-file) 258 259 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) 260 $(install-import-file) 261 262 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME) 263 $(install-import-file) 264 265 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt 266 $(install-import-file) 267 268 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt 269 $(install-import-file) 270 271 $(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt 272 $(install-file) 273 274 # 275 # Specific to OpenJDK building 276 # 277 ifdef OPENJDK 278 279 ifeq ($(IMPORT_BINARY_PLUGS),true) 280 include $(BUILDDIR)/common/internal/BinaryPlugs.gmk 281 282 build: import-binary-plugs 283 endif 284 285 else # !OPENJDK 286 287 INTERNAL_IMPORT_LIST += \ 288 $(LIBDIR)/security/US_export_policy.jar \ 289 $(LIBDIR)/security/local_policy.jar \ 290 $(LIBDIR)/jce.jar 291 292 $(LIBDIR)/jce.jar: \ 293 $(BUILDDIR)/closed/tools/crypto/jce/jce.jar 294 $(install-non-module-file) 295 $(LIBDIR)/security/US_export_policy.jar: \ 296 $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar 297 $(install-file) 298 $(LIBDIR)/security/local_policy.jar: \ 299 $(BUILDDIR)/closed/tools/crypto/jce/local_policy.jar 300 $(install-file) 301 302 endif # OPENJDK 303 304 ADDJSUM_JARFILE = $(BUILDTOOLJARDIR)/addjsum.jar 305 306 # Construct classlist file 307 $(LIBDIR)/classlist: \ 308 $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) \ 309 $(ADDJSUM_JARFILE) 310 @$(prep-target) 311 @$(RM) -f $@.temp 312 $(BOOT_JAVA_CMD) -jar $(ADDJSUM_JARFILE) \ 313 $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp 314 $(MV) $@.temp $@ 315 316 # Import internal files (ones that are stashed in this source tree) 317 import_internal_files : $(INTERNAL_IMPORT_LIST) 318 319 # Import files from the JDK that we are not building 320 import_files: $(IMPORT_LIST) 321 322 # Get component information variables and rules 323 include $(BUILDDIR)/common/internal/ImportComponents.gmk 324 325 # Security files we need to import 326 SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip 327 SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip 328 JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip 329 JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip 330 331 # Unzip zip file $2 into directory $1 (if $2 exists) 332 # Warning: $2 must be absolute path not relative 333 define SecUnzipper 334 if [ -f $2 ] ; then \ 335 $(MKDIR) -p $1; \ 336 $(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \ 337 ( $(CD) $1 && $(UNZIP) -o $2 ); \ 338 fi 339 endef 340 341 # If sec-bin exists, unpack it into the build directory 342 # Also, the library recompile build indirectly depends on two SSL classes, 343 # so copy those as well FIXUP 344 # if sec-windows-bin exists, unpack it into the build directory 345 # if JGSS files exists, unpack it into the build directory 346 $(TEMPDIR)/security_imported: 347 @$(prep-target) 348 @$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_ZIP)) 349 ifeq ($(PLATFORM), windows) 350 @$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_WIN_ZIP)) 351 endif 352 ifeq ($(PLATFORM), windows) 353 ifeq ($(ARCH_DATA_MODEL), 32) 354 @$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN32_FILES_ZIP)) 355 else 356 @$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN64_FILES_ZIP)) 357 endif 358 endif 359 @$(ECHO) "Imported on `$(DATE)`" > $@ 360 361 # Import all files from other components 362 $(TEMPDIR)/components_imported: 363 @$(prep-target) 364 $(call import-component-binaries,$(ABS_OUTPUTDIR)) 365 $(call import-component-sources,$(IMPORTSRCDIR)) 366 $(call import-component-docs,$(IMPORTDOCDIR)) 367 $(call import-component-classes,$(CLASSDESTDIR)) 368 @$(ECHO) "Imported on `$(DATE)`" > $@ 369 370 # Do pretty much everything 371 build : import_files \ 372 import_internal_files \ 373 $(TEMPDIR)/components_imported \ 374 $(TEMPDIR)/security_imported 375 376 # Clean up what we imported (except for component files) 377 clean clobber:: 378 $(RM) $(IMPORT_LIST) 379 $(RM) $(INTERNAL_IMPORT_LIST) 380 $(call import-component-sources-clean,$(IMPORTSRCDIR)) 381 $(call import-component-docs-clean,$(IMPORTDOCDIR)) 382 $(call import-component-classes-clean,$(CLASSDESTDIR)) 383 $(RM) $(TEMPDIR)/components_imported 384 $(RM) $(TEMPDIR)/security_imported 385 386 .PHONY: import_files import_internal_files 387