#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# 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.
#
#
# Definitions for all platforms.
#
# Normally the convention is that these alternate definitions of
# primary make variables are never defined inside the Makefiles anywhere
# but are defined via environment variables or set on the make command
# line. So you should never see an ALT_* variable defined in any
# makefiles, just used. This is the convention and there are some
# exceptions, either mistakes or unusual circumstances.
#
# The naming convention for the default value of one of these variables
# that has an ALT_* override capability is to name the default value with a
# leading underscore (_). So for XXX you would have:
# _XXX default value
# ALT_XXX any override the user is providing if any
# XXX the final value, either the default _XXX or the ALT_XXX value.
#
# On Directory names. In very rare cases should the Windows directory
# names use the backslash, please use the C:/ style of windows paths.
# Avoid duplicating the // characters in paths, this has known to cause
# strange problems with jar and other utilities, e.g. /a//b/ != /a/b/.
# Some of these variables have an explicit trailing / character, but in
# general, they should NOT have the trailing / character.
# Get shared system utilities macros defined
# Assumes ARCH, PLATFORM, ARCH_VM_SUBDIR, JDK_TOPDIR, etc. have been defined.
# Simple pwd path
# NOTE: Just use the shell's cd and pwd here, more reliable at sanity time.
# Checks an ALT value for spaces (should be one word),
# warns and returns Check_ALT_$1 if spaces
$(if $(word 2,$($1)),$(warning "WARNING: Value of $1 contains a space: '$($1)', check or set ALT_$1")Check_ALT_$1,$($1))
# Checks an ALT value for empty, warns and returns Check_ALT_$1 if empty
$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, check or set ALT_$1")Check_ALT_$1)
# Checks any value for empty, warns and returns $2 if empty
# Prefix for a utility prefix path, if empty leave alone, otherwise end with a /
# Select a directory if it exists, or the alternate 2 or the alternate 3
$(shell \
if [ -d "$1" ]; then \
echo "$1"; \
elif [ -d "$2" ]; then \
echo "$2"; \
else \
echo "$3"; \
fi)
# Select a directory if it exists, or the alternate 2, or the alternate 3, or the alternate 4
$(shell \
if [ -d "$1" ]; then \
echo "$1"; \
elif [ -d "$2" ]; then \
echo "$2"; \
elif [ -d "$3" ]; then \
echo "$3"; \
else \
echo "$4"; \
fi)
# Select a writable directory if it exists and is writable, or the alternate
$(shell \
if [ -d "$1" -a -w "$1" ]; then \
echo "$1"; \
else \
echo "$2"; \
fi)
# Select a file if it exists, or the alternate 1, or the alternate 2
$(shell \
if [ -r "$1" ]; then \
echo "$1"; \
elif [ -r "$2" ]; then \
echo "$2"; \
else \
echo "NO_FILE_EXISTS"; \
fi)
# Given a line of text, get the version number from it
# Return one part of the version numbers, watch out for non digits.
# Given a major.minor.micro version, return the major, minor, or micro number
# Macro that returns missing, same, newer, or older $1=version $2=required
$(shell \
if [ "$1" = "" -o "$2" = "" ]; then \
echo missing; \
elif [ "$1" = "$2" ]; then \
echo same; \
echo older; \
echo newer; \
echo older; \
echo newer; \
echo older; \
echo newer; \
else \
echo same; \
fi)
# Expand SRCDIR_LIST, which is used to automatically include various
# macosx trees, depending on the component.
# Make sure certain variables are non-empty at this point
$(call CheckValue,ARCH,),\
$(call CheckValue,ARCH_DATA_MODEL,),\
$(call CheckValue,ARCH_VM_SUBDIR,),\
$(call CheckValue,JDK_TOPDIR,),\
$(call CheckValue,VARIANT,),\
$(call CheckValue,PLATFORM,)
# Misc common settings for all workspaces
# This determines the version of the product, and the previous version or boot
# Default names
COMPANY_NAME = N/A
else
else
# Default variant is the optimized version of everything
# can be OPT or DBG, default is OPT
# Determine the JDK_IMPORT_VARIANT, so we get the right VM files copied over.
# Determine suffix for obj directory or OBJDIR, for .o files.
# (by keeping .o files separate, just .o files, they don't clobber each
# other, however, the library files will clobber each other).
#
else
# Depending on the flavor of the build, add a -debug or -fastdebug to the name
# These default values are redefined during a release build.
# CTE can set JDK_UPDATE_VERSION during the update release
MARKETING_NUMBER := $(shell \
$(ECHO) $(JDK_UPDATE_VERSION) | $(NAWK) '{if (substr($$0,1,1)=="0") print substr($$0, 2); else print $$0;}')
else
# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
else
# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
else
USER_RELEASE_SUFFIX := $(shell $(ECHO) "$(CLEAN_USERNAME)_$(BUILD_DATE)" | $(TR) '[:upper:]' '[:lower:]' )
export USER_RELEASE_SUFFIX
# Promoted build location
# PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel.
# If the user sets ALT_PARALLEL_COMPILE_JOBS, then COMPILE_APPROACH is set
# to parallel.
#
# Recommended setting: 2 seems to be ideal for single cpu machines,
# 2 times the number of CPU's is a basic formula,
# but probably not more than 4 if the machine is
# being shared by others, or the machine is limited
# in RAM or swap.
#
else
# Previous JDK release (version of BOOTDIR version)
else
PREVIOUS_JDK_VERSION = $(PREVIOUS_MAJOR_VERSION).$(PREVIOUS_MINOR_VERSION).$(PREVIOUS_MICRO_VERSION)
export PREVIOUS_JDK_VERSION
# Version with _ instead of . in number
else
# Include any private definitions for this set of workspaces
# OUTPUTDIR: Location of all output for the build
# Assumes this is absolute (checks later)
else
# Default: Get "build" parent directory, which should always exist
else
OUTPUTDIR:=$(_OUTPUTDIR)
# Check for spaces and null value
# Get platform specific settings
# NB: OUTPUTDIR must be defined. Otherwise hotspot import detection will not work correctly
# On other hand this must be included early as it provides platform specific defines such as FullPath
# Get platform specific settings (defines COMPILER_PATH)
# Components
else
else
else
else
# HOTSPOT_DOCS_IMPORT_PATH: Path to hotspot docs files to import into the docs generation
else
HOTSPOT_DOCS_IMPORT_PATH :=$(call DirExists,$(HOTSPOT_IMPORT_PATH)/docs,$(PROMOTED_BUILD_BASEDIR)/docs,/NO_DOCS_DIR)
# These are the same on all platforms but require the above platform include 1st
# BOOTDIR: Bootstrap JDK, previous released JDK.
# _BOOTDIR1 and _BOOTDIR2 picked by platform
# Platform may optionally define _BOOTDIR3 as well.
BOOTDIR =$(ALT_BOOTDIR)
else
else
export BOOTDIR
# PREVIOUS_RELEASE_IMAGE: Previous install image to compare against
# Explicit image provided, no bundle access needed
else
# PREVIOUS_RELEASE_PATH: path to where previous release bundles are
else
# Depending on if we have access to these bundles
# Use images in re area or BOOTDIR (which is normally the previous release)
else
# Get names of and paths to bundles
export PREVIOUS_RELEASE_PATH
# PREVIOUS_JDK_FILE: filename of install bundle for previous JDK
else
export PREVIOUS_JDK_FILE
# PREVIOUS_JRE_FILE: filename of install bundle for previous JRE
else
export PREVIOUS_JRE_FILE
# Paths to these bundles
# Indicate we are using an image comparison
# CACERTS_FILE: if OPENJDK is false and the internal version of the file
# (that is, non-empty) is available, use it, otherwise use an
# empty keystore.
#
# We put this variable here for sanity checks and in case another
# components will need to know which cacerts file is being used.
#
else
CACERTS_FILE :=$(CACERTS_EXT)
else # (!OPENJDK)
endif # (OPENJDK)
#
# When signing the JCE framework and provider, we could be using built
# bits on a read-only filesystem. If so, this test will fail and crash
# the build.
#
# Create the output directory and make sure it exists and is writable
# Define absolute path if needed and check for spaces and null value
#Could not define this at the same time as _OUTPUTDIRNAME as FullPath is not defined at that point
else
# Make doubly sure this is a full path
_outputdir_error:=$(error "ERROR: Trouble with the absolute path for OUTPUTDIR '$(OUTPUTDIR)', was ALT_OUTPUTDIR '$(ALT_OUTPUTDIR)' an absolute path?")
else
_outputdir_error:=$(error "ERROR: ABS_OUTPUTDIR '$(ABS_OUTPUTDIR)' is not the same directory as OUTPUTDIR '$(OUTPUTDIR)', '$(_dir1)'!='$(_dir2)'")
# Bin directory
# NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
# MOZILLA_HEADERS_PATH: path to mozilla header files for plugin
else
# CUPS_HEADERS_PATH: path to Cups headers files for Unix printing
else
else \
fi)
# Utilities ant
# There are few problems with ant we need to workaround:
# 1) ant is using temporary directory java.io.tmpdir
# However, this directory is not unique enough and two separate ant processes
# can easily end up using the exact same temp directory. This may lead to weird build failures
# To workaround this we will define tmp dir explicitly
# 2) ant attempts to detect JDK location based on java.exe location
# This is fragile as developer may have JRE first on the PATH.
# To workaround this we will specify JAVA_HOME explicitly
else
else
# Create file with source information
# The source tips can come from the Mercurial repository, or in the files
# $(HGTIP_FILENAME) which contains the tip but is also positioned in the same
# directory as the original $(HGDIR) directory.
# These should not be := assignments, only used from the root Makefile.
# Emit the repo:tip pairs to $@
if [ "$${i}" = "IGNORE" ] ; then \
continue; \
$(PRINTF) " %s:%s" \
elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
$(PRINTF) " %s:%s" \
fi; \
done >> $@
$(PRINTF) "\n" >> $@
# Create the HGTIP_FILENAME file
# Get the compiler specific settings (will run the compiler to find out)
# NOTE: COMPILER_PATH must be set by this time.
# Up until we include this file, we don't know what specific compiler
# version is actually being used (i.e. what is in PATH or COMPILER_PATH).