0N/A#
239N/A# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
157N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
157N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
157N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157N/A# or visit www.oracle.com if you need additional information or have any
157N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Defnitions for all platforms.
0N/A#
0N/A# Normally the convention is that these alternate definitions of
0N/A# primary make variables are never defined inside the Makefiles anywhere
0N/A# but are defined via environment variables or set on the make command
0N/A# line. So you should never see an ALT_* variable defined in any
0N/A# makefiles, just used. This is the convention and there are some
0N/A# exceptions, either mistakes or unusual circumstances.
0N/A#
0N/A# The naming convention for the default value of one of these variables
0N/A# that has an ALT_* override capability is to name the default value with a
0N/A# leading underscore (_). So for XXX you would have:
0N/A# _XXX default value
0N/A# ALT_XXX any override the user is providing if any
0N/A# XXX the final value, either the default _XXX or the ALT_XXX value.
0N/A#
0N/A
0N/A# On Directory names. In very rare cases should the Windows directory
0N/A# names use the backslash, please use the C:/ style of windows paths.
0N/A# Avoid duplicating the // characters in paths, this has known to cause
0N/A# strange problems with jar and other utilities, e.g. /a//b/ != /a/b/.
0N/A# Some of these variables have an explicit trailing / character, but in
0N/A# general, they should NOT have the trailing / character.
0N/A
0N/A# Get shared system utilities macros defined
0N/Ainclude $(BUILDDIR)/common/shared/Defs-utils.gmk
0N/A
193N/A# Assumes ARCH, PLATFORM, etc. have been defined.
0N/A
0N/A# Simple pwd path
0N/Adefine PwdPath
0N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
0N/Aendef
0N/A
0N/A# Checks an ALT value for spaces (should be one word),
0N/A# warns and returns Check_ALT_$1 if spaces
0N/Adefine AltCheckSpaces
0N/A$(if $(word 2,$($1)),$(warning "WARNING: Value of $1 contains a space: '$($1)', check or set ALT_$1")Check_ALT_$1,$($1))
0N/Aendef
0N/A
0N/A# Checks an ALT value for empty, warns and returns Check_ALT_$1 if empty
0N/Adefine AltCheckValue
0N/A$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, check or set ALT_$1")Check_ALT_$1)
0N/Aendef
0N/A
0N/A# Checks any value for empty, warns and returns $2 if empty
0N/Adefine CheckValue
0N/A$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, will use '$2'")$2)
0N/Aendef
0N/A
0N/A# Prefix for a utility prefix path, if empty leave alone, otherwise end with a /
0N/Adefine PrefixPath
0N/A$(if $1,$(subst //,/,$1/),)
0N/Aendef
0N/A
0N/A# Select a directory if it exists, or the alternate 2 or the alternate 3
0N/Adefine DirExists
0N/A$(shell \
0N/A if [ -d "$1" ]; then \
0N/A echo "$1"; \
0N/A elif [ -d "$2" ]; then \
0N/A echo "$2"; \
0N/A else \
0N/A echo "$3"; \
0N/A fi)
0N/Aendef
0N/A
0N/A# Select a writable directory if it exists and is writable, or the alternate
0N/Adefine WriteDirExists
0N/A$(shell \
0N/A if [ -d "$1" -a -w "$1" ]; then \
0N/A echo "$1"; \
0N/A else \
0N/A echo "$2"; \
0N/A fi)
0N/Aendef
0N/A
0N/A# Select a file if it exists, or the alternate 1, or the alternate 2
0N/Adefine FileExists
0N/A$(shell \
0N/A if [ -r "$1" ]; then \
0N/A echo "$1"; \
0N/A elif [ -r "$2" ]; then \
0N/A echo "$2"; \
0N/A else \
0N/A echo "NO_FILE_EXISTS"; \
0N/A fi)
0N/Aendef
0N/A
0N/A# Given a line of text, get the major.minor version number from it
0N/Adefine GetVersion
0N/A$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
0N/Aendef
0N/A
0N/A# Given a major.minor.micro version, return the major, minor, or micro number
0N/Adefine MajorVersion
0N/A$(if $(word 1, $(subst ., ,$1)),$(word 1, $(subst ., ,$1)),0)
0N/Aendef
0N/Adefine MinorVersion
0N/A$(if $(word 2, $(subst ., ,$1)),$(word 2, $(subst ., ,$1)),0)
0N/Aendef
0N/Adefine MicroVersion
0N/A$(if $(word 3, $(subst ., ,$1)),$(word 3, $(subst ., ,$1)),0)
0N/Aendef
0N/A
0N/A# Macro that returns missing, same, newer, or older $1=version $2=required
0N/A# (currently does not check the micro number)
0N/Adefine CheckVersions
0N/A$(shell \
0N/A if [ "$1" = "" -o "$2" = "" ]; then \
0N/A echo missing; \
0N/A else \
0N/A if [ "$1" = "$2" ]; then \
0N/A echo same; \
0N/A else \
0N/A if [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
0N/A echo older; \
0N/A else \
0N/A if [ $(call MajorVersion,$1) -eq $(call MajorVersion,$2) -a \
0N/A $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
0N/A echo older; \
0N/A else \
0N/A echo newer; \
0N/A fi; \
0N/A fi; \
0N/A fi; \
0N/A fi)
0N/Aendef
0N/A
0N/A# Make sure certain variables are non-empty at this point
0N/A_check_values:=\
0N/A$(call CheckValue,ARCH,),\
0N/A$(call CheckValue,ARCH_DATA_MODEL,),\
0N/A$(call CheckValue,VARIANT,),\
0N/A$(call CheckValue,PLATFORM,)
0N/A
0N/A# Misc common settings for all workspaces
0N/A# This determines the version of the product, and the previous version or boot
0N/Aifndef JDK_MAJOR_VERSION
0N/A JDK_MAJOR_VERSION = 1
0N/A PREVIOUS_MAJOR_VERSION = 1
0N/Aendif
0N/A
0N/Aifndef JDK_MINOR_VERSION
0N/A JDK_MINOR_VERSION = 7
0N/A PREVIOUS_MINOR_VERSION = 6
0N/Aendif
0N/A
0N/Aifndef JDK_MICRO_VERSION
0N/A JDK_MICRO_VERSION = 0
0N/A PREVIOUS_MICRO_VERSION = 0
0N/Aendif
0N/A
0N/Aifndef MILESTONE
0N/A MILESTONE = internal
0N/Aendif
0N/A
0N/Aifndef BUILD_NUMBER
0N/A JDK_BUILD_NUMBER = b00
0N/Aelse
0N/A ifndef JDK_BUILD_NUMBER
0N/A JDK_BUILD_NUMBER = $(BUILD_NUMBER)
0N/A endif
0N/Aendif
0N/A
0N/A# Default variant is the optimized version of everything
0N/A# can be OPT or DBG, default is OPT
0N/A# Determine the extra pattern to add to the release name for debug/fastdebug.
0N/A# Determine the JDK_IMPORT_VARIANT, so we get the right VM files copied over.
0N/A#
0N/Aifeq ($(VARIANT), DBG)
0N/A BUILD_VARIANT_RELEASE=-debug
0N/Aelse
0N/A BUILD_VARIANT_RELEASE=
0N/Aendif
0N/Aifeq ($(FASTDEBUG), true)
0N/A VARIANT=DBG
0N/A BUILD_VARIANT_RELEASE=-fastdebug
0N/A _JDK_IMPORT_VARIANT=/fastdebug
0N/Aendif
0N/A
0N/A# Depending on the flavor of the build, add a -debug or -fastdebug to the name
0N/Aifdef DEBUG_NAME
0N/A BUILD_VARIANT_RELEASE=-$(DEBUG_NAME)
0N/Aendif
0N/A
0N/AJDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
0N/AJDK_UNDERSCORE_VERSION = $(subst .,_,$(JDK_VERSION))
0N/A
0N/A# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
0N/Aifneq ($(MILESTONE),fcs)
0N/A RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
0N/Aelse
0N/A RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
0N/Aendif
0N/A
0N/A# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
113N/Aifndef FULL_VERSION
113N/A ifdef BUILD_NUMBER
113N/A FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
113N/A else
113N/A BUILD_NUMBER = b00
113N/A USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
113N/A FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
113N/A endif
113N/A export FULL_VERSION
0N/Aendif
0N/A
0N/A# Promoted build location
0N/APROMOTED_RE_AREA = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted
0N/APROMOTED_BUILD_LATEST = latest
0N/APROMOTED_BUILD_BASEDIR = $(PROMOTED_RE_AREA)/$(PROMOTED_BUILD_LATEST)
0N/APROMOTED_BUILD_BINARIES = $(PROMOTED_BUILD_BASEDIR)/binaries
0N/A
0N/A# OPT: Changes what the optimizations settings (in _OPT)
0N/APOPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
0N/A
0N/A# PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel.
0N/A# If the user sets ALT_PARALLEL_COMPILE_JOBS, then COMPILE_APPROACH is set
0N/A# to parallel.
0N/A#
0N/A# Recommended setting: 2 seems to be ideal for single cpu machines,
0N/A# 2 times the number of CPU's is a basic formula,
0N/A# but probably not more than 4 if the machine is
0N/A# being shared by others, or the machine is limited
0N/A# in RAM or swap.
0N/A#
0N/Aifdef ALT_PARALLEL_COMPILE_JOBS
0N/A PARALLEL_COMPILE_JOBS=$(ALT_PARALLEL_COMPILE_JOBS)
0N/Aelse
0N/A PARALLEL_COMPILE_JOBS=2
0N/Aendif
0N/A
0N/A# Previous JDK release (version of BOOTDIR version)
0N/Aifdef ALT_PREVIOUS_JDK_VERSION
0N/A PREVIOUS_JDK_VERSION = $(ALT_PREVIOUS_JDK_VERSION)
0N/Aelse
0N/A PREVIOUS_JDK_VERSION = $(PREVIOUS_MAJOR_VERSION).$(PREVIOUS_MINOR_VERSION).$(PREVIOUS_MICRO_VERSION)
0N/Aendif
0N/Aexport PREVIOUS_JDK_VERSION
0N/APREVIOUS_JDK_VERSION:=$(call AltCheckSpaces,PREVIOUS_JDK_VERSION)
0N/APREVIOUS_JDK_VERSION:=$(call AltCheckValue,PREVIOUS_JDK_VERSION)
0N/A
0N/A# Version with _ instead of . in number
0N/Aifeq ($(PREVIOUS_MINOR_VERSION),5)
0N/A PREVIOUS_JDK_UNDERSCORE_VERSION = $(subst .,_,$(PREVIOUS_JDK_VERSION))
0N/Aelse
0N/A PREVIOUS_JDK_UNDERSCORE_VERSION = $(PREVIOUS_MINOR_VERSION)
0N/Aendif
0N/A
0N/A# Get platform specific settings
0N/Ainclude $(BUILDDIR)/common/shared/Defs-$(PLATFORM).gmk
0N/A
3N/A# Components
3N/Aifdef ALT_LANGTOOLS_DIST
3N/A LANGTOOLS_DIST :=$(call FullPath,$(ALT_LANGTOOLS_DIST))
3N/Aelse
3N/A LANGTOOLS_DIST =
3N/Aendif
3N/A
0N/A# These are the same on all platforms but require the above platform include 1st
0N/A
0N/A# BOOTDIR: Bootstrap JDK, previous released JDK.
0N/A# _BOOTDIR1 and _BOOTDIR2 picked by platform
0N/Aifdef ALT_BOOTDIR
0N/A BOOTDIR =$(ALT_BOOTDIR)
0N/Aelse
0N/A BOOTDIR :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
0N/Aendif
0N/Aexport BOOTDIR
0N/ABOOTDIR:=$(call AltCheckSpaces,BOOTDIR)
0N/ABOOTDIR:=$(call AltCheckValue,BOOTDIR)
0N/A
0N/A# OUTPUTDIR: Location of all output for the build
0N/A_BACKUP_OUTPUTDIR = $(TEMP_DISK)/$(USER)/jdk-outputdir
0N/Aifdef ALT_OUTPUTDIR
0N/A _POSSIBLE_OUTPUTDIR =$(subst \,/,$(ALT_OUTPUTDIR))
0N/Aelse
0N/A ifndef _OUTPUTDIR
0N/A _OUTPUTDIR = $(_BACKUP_OUTPUTDIR)
0N/A endif
0N/A _POSSIBLE_OUTPUTDIR =$(_OUTPUTDIR)
0N/Aendif
0N/A_create_outputdir1:=$(shell mkdir -p $(_POSSIBLE_OUTPUTDIR) > $(DEV_NULL) 2>&1)
0N/AOUTPUTDIR:=$(call WriteDirExists,$(_POSSIBLE_OUTPUTDIR),$(_BACKUP_OUTPUTDIR))
0N/A_create_outputdir2:=$(shell mkdir -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1)
0N/Aifeq "$(OUTPUTDIR)" "$(_BACKUP_OUTPUTDIR)"
0N/A _outputdir_warning:=$(warning "WARNING: OUTPUTDIR '$(_POSSIBLE_OUTPUTDIR)' not writable, will use '$(_BACKUP_OUTPUTDIR)'")
0N/Aendif
0N/AOUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
0N/AOUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
0N/A
0N/A# Bin directory
0N/A# NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
0N/ABINDIR = $(OUTPUTDIR)/bin$(ISA_DIR)
0N/A
0N/A# Absolute path to output directory
0N/AABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
0N/A
0N/A