Makefile revision 2109
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This code is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# under the terms of the GNU General Public License version 2 only, as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# published by the Free Software Foundation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# version 2 for more details (a copy is included in the LICENSE file that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# accompanied this code).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You should have received a copy of the GNU General Public License version
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2 along with this work; if not, write to the Free Software Foundation,
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or visit www.oracle.com if you need additional information or have any
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Top level gnumake file for hotspot builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Default is to build the both product images and construct an export dir.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The default export directory name is `pwd`/export-$(PLATFORM).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use: 'gnumake help' for more information.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This makefile uses the default settings for where to find compilers and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# tools, and obeys the ALT_* variable settings used by the other JDK
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# workspaces.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Expected/optional make variables defined on make command line:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# LP64=1 or ARCH_DATA_MODEL=64 for 64bit build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Expected/optional make variables or environment variables:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ALT_SLASH_JAVA Location of /java or J:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ALT_BOOTDIR Previous JDK home directory for javac compiler
5fa6a064b8301e4f274bd132fd577def59e4fb4cTinderbox User# ALT_OUTPUTDIR Output directory to use for hotspot build
5fa6a064b8301e4f274bd132fd577def59e4fb4cTinderbox User# ALT_EXPORT_PATH Directory to export hotspot build to
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules)
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# ALT_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Set ALT_BUILD_WIN_SA=1 to enable building SA on
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Version strings and numbers:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDK_VERSION Current JDK version (e.g. 1.6.0)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# PREVIOUS_JDK_VERSION Previous (bootdir) JDK version (e.g. 1.5.0)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FULL_VERSION Full version string to use (e.g. "1.6.0-ea-b42")
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Version strings and numbers especially needed on Windows:
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# COOKED_JDK_UPDATE_VERSION Just the update release number (e.g. 02)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# COOKED_BUILD_NUMBER Just the build number (e.g. 42)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# JDK_MKTG_VERSION Marketing JDK version (e.g. 6.0)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDK_MAJOR_VERSION Major number for version (e.g. 1) always 1?
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# JDK_MINOR_VERSION Minor number for version (e.g. 6)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# JDK_MICRO_VERSION Micro number for version (e.g. 0)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Default is build both product fastdebug and create export area
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Allow to build HotSpot in local directory from sources specified by GAMMADIR.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# After make/defs.make GAMMADIR is defined.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Typical C1/C2 targets made available with this Makefile
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserC1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox UserC2_VM_TARGETS=product fastdebug optimized jvmg
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinKERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JDK directory list
5d564da348e890e42f63eebf2dced9a05b41f4fbTinderbox Userall_product: product product1 productkernel docs export_product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinall_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinall_debug: jvmg jvmg1 jvmgkernel docs export_debug
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userall_fastdebug: fastdebug1 docs export_fastdebug
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox Userall_optimized: optimized optimized1 optimizedkernel docs export_optimized
5d564da348e890e42f63eebf2dced9a05b41f4fbTinderbox Userall_productzero: productzero docs export_product
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinall_fastdebugzero: fastdebugzero docs export_fastdebug
5d564da348e890e42f63eebf2dced9a05b41f4fbTinderbox Userall_optimizedzero: optimizedzero docs export_optimized
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updaterall_productshark: productshark docs export_product
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic Updaterall_fastdebugshark: fastdebugshark docs export_fastdebug
6f64d4ab8e68f9b2333bcbfc755396d29a4a9d7cAutomatic Updaterall_debugshark: jvmgshark docs export_debug
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox Userall_optimizedshark: optimizedshark docs export_optimized
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User# Do everything
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User# Build or export docs
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User @$(ECHO) "No docs ($(VM_TARGET)) for windows"
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater# Build variation of hotspot
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox User $(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User $(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User $(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
44d0f0256fbdce130a18655023c3b06bacacbd61Automatic Updater $(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User $(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Build compiler1 (client) rule, different for platforms
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
d9184858dd5d7677050a813d444c281c56f697aaTinderbox User# Build compiler2 (server) rule, different for platforms
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Export file rule
5091a6fed939d70cc5ae90a8ddecf2a829cdbabaTinderbox User $(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug generic_export
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox User $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox User $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox User# Export file copy rules
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox UserC1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox UserC2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox UserKERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
aa6c5a3e331958d3c92c2facdbd2b8daa55b5959Tinderbox UserZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserSHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Misc files and generated files need to come from C1 or C2 area
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Bin files (windows)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Other libraries (like SA)
e108f2ec640e1acb54999c0ade58af606149956dTinderbox User$(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
6d382c9fcec316a84a237779fb64bb471b6f9d43Tinderbox User$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User$(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User# Client files always come from C1 area
922312472e2e05ebc64993d465999c5351b83036Automatic Updater$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater# Server files always come from C2 area
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updater$(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater# Kernel files always come from kernel area
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater$(EXPORT_KERNEL_DIR)/%.dll: $(KERNEL_DIR)/%.dll
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater$(EXPORT_KERNEL_DIR)/%.pdb: $(KERNEL_DIR)/%.pdb
c3dc968140ab7f04795acc7835e4e89ccb0c0a27Tinderbox User# Shared Library
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater$(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater$(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater$(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
fdd80e9a55c70b36a3bf3e409b86897301c44ff8Automatic Updater$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinHS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Xusage file
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Clean rules
@$(ECHO) \
@$(ECHO) \
BOOTDIR \
BOOTDIR \
%.printval:
%.checkdir:
%.checkfil:
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
@$(ECHO) \
$(KERNEL_VM_TARGETS) \