0N/A#
438N/A# Copyright (c) 1995, 2012, 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
180N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
180N/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#
180N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
180N/A# or visit www.oracle.com if you need additional information or have any
180N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Common variables used by all the Java makefiles. This file should
0N/A# not contain rules.
0N/A#
0N/A
311N/A# The build times report is turned off by setting REPORT_BUILD_TIMES to nothing.
311N/A# This is necessary for the target clobber/clean which will erase the
311N/A# directories where the buildtimes are stored.
311N/AREPORT_BUILD_TIMES=1
311N/A# Store the build times in this directory.
311N/ABUILDTIMESDIR=$(ABS_OUTPUTDIR)/tmp/buildtimes
311N/A
311N/A# Record starting time for build of a sub repository.
311N/Adefine RecordStartTime
311N/A$(MKDIR) -p $(BUILDTIMESDIR)
311N/A$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
311N/A$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
311N/Aendef
311N/A
311N/A# Indicate that we started to build a sub repository and record starting time.
126N/Adefine MakeStart
311N/A$(call RecordStartTime,$1)
311N/A$(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \
126N/A"########################################################################" \
126N/A"########################################################################" \
311N/A"Entering $1 for target(s) $2" \
126N/A"########################################################################"
126N/Aendef
126N/A
311N/A# Record ending time and calculate the difference and store it in a
311N/A# easy to read format. Handles builds that cross midnight. Expects
311N/A# that a build will never take 24 hours or more.
311N/Adefine RecordEndTime
311N/A$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
311N/A$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
311N/A$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
311N/A $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
311N/A M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
311N/A > $(BUILDTIMESDIR)/build_time_diff_$1
311N/Aendef
311N/A
311N/A# Indicate that we are done.
311N/A# Record ending time and print out the total time it took to build.
311N/Adefine MakeFinish
311N/A$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),)
311N/A$(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \
126N/A"########################################################################" \
311N/A"Leaving $1 for target(s) $2" \
126N/A"########################################################################" \
311N/A$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
311N/A"########################################################################"
311N/Aendef
311N/A
311N/A# Find all build_time_* files and print their contents in a list sorted
311N/A# on the name of the sub repository.
311N/Adefine ReportBuildTimes
400N/A$(PRINTF) "#-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
311N/A$1 \
311N/A"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
311N/A"`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
311N/A"`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
311N/A"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
126N/Aendef
126N/A
7N/Aifdef OPENJDK
7N/A ifneq ($(OPENJDK),true)
7N/A x:=$(error "OPENJDK (if defined) can only be set to true")
7N/A endif
7N/Aendif
7N/A
0N/A# Define absolute paths to TOPDIRs
0N/AABS_LANGTOOLS_TOPDIR:=$(call OptFullPath,"$(LANGTOOLS_TOPDIR)")
0N/AABS_CORBA_TOPDIR:=$(call OptFullPath,"$(CORBA_TOPDIR)")
0N/AABS_JAXP_TOPDIR:=$(call OptFullPath,"$(JAXP_TOPDIR)")
0N/AABS_JAXWS_TOPDIR:=$(call OptFullPath,"$(JAXWS_TOPDIR)")
0N/AABS_JDK_TOPDIR:=$(call OptFullPath,"$(JDK_TOPDIR)")
0N/AABS_HOTSPOT_TOPDIR:=$(call OptFullPath,"$(HOTSPOT_TOPDIR)")
0N/AABS_INSTALL_TOPDIR:=$(call OptFullPath,"$(INSTALL_TOPDIR)")
0N/AABS_SPONSORS_TOPDIR:=$(call OptFullPath,"$(SPONSORS_TOPDIR)")
0N/AABS_DEPLOY_TOPDIR:=$(call OptFullPath,"$(DEPLOY_TOPDIR)")
0N/A
0N/A# Macro to return true or false if a file exists and is readable
0N/Adefine MkExists
0N/A$(shell if [ -r $1 ]; then $(ECHO) true; else $(ECHO) false; fi)
0N/Aendef
0N/A
0N/AHOTSPOT_SRC_AVAILABLE := $(call MkExists,$(HOTSPOT_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_HOTSPOT
0N/A ifdef ALT_HOTSPOT_IMPORT_PATH
0N/A BUILD_HOTSPOT := false
0N/A else
0N/A BUILD_HOTSPOT := $(HOTSPOT_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/ALANGTOOLS_SRC_AVAILABLE := $(call MkExists,$(LANGTOOLS_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_LANGTOOLS
0N/A ifdef ALT_LANGTOOLS_DIST
0N/A BUILD_LANGTOOLS := false
0N/A else
0N/A BUILD_LANGTOOLS := $(LANGTOOLS_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/ACORBA_SRC_AVAILABLE := $(call MkExists,$(CORBA_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_CORBA
0N/A ifdef ALT_CORBA_DIST
0N/A BUILD_CORBA := false
0N/A else
0N/A BUILD_CORBA := $(CORBA_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/AJAXP_SRC_AVAILABLE := $(call MkExists,$(JAXP_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_JAXP
0N/A ifdef ALT_JAXP_DIST
0N/A BUILD_JAXP := false
0N/A else
0N/A BUILD_JAXP := $(JAXP_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/AJAXWS_SRC_AVAILABLE := $(call MkExists,$(JAXWS_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_JAXWS
0N/A ifdef ALT_JAXWS_DIST
0N/A BUILD_JAXWS := false
0N/A else
0N/A BUILD_JAXWS := $(JAXWS_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/AJDK_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_JDK
0N/A BUILD_JDK := $(JDK_SRC_AVAILABLE)
0N/Aendif
0N/Aifeq ($(JDK_SRC_AVAILABLE),true)
0N/A JDK_CLOSED_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/src/closed)
7N/A ifeq ($(JDK_CLOSED_SRC_AVAILABLE),false)
7N/A OPENJDK = true
0N/A endif
0N/Aendif
0N/A
0N/ADEPLOY_SRC_AVAILABLE := $(call MkExists,$(DEPLOY_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_DEPLOY
0N/A BUILD_DEPLOY := $(DEPLOY_SRC_AVAILABLE)
0N/Aendif
0N/A
0N/AINSTALL_SRC_AVAILABLE := $(call MkExists,$(INSTALL_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_INSTALL
0N/A ifdef DEV_ONLY
0N/A BUILD_INSTALL := false
0N/A else
0N/A BUILD_INSTALL := $(INSTALL_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/ASPONSORS_SRC_AVAILABLE := $(call MkExists,$(SPONSORS_TOPDIR)/make/Makefile)
0N/Aifndef BUILD_SPONSORS
0N/A ifdef DEV_ONLY
0N/A BUILD_SPONSORS := false
0N/A else
0N/A BUILD_SPONSORS := $(SPONSORS_SRC_AVAILABLE)
0N/A endif
0N/Aendif
0N/A
0N/A
286N/A# Do we build the source bundles?
0N/ABUNDLE_RULES = $(JDK_TOPDIR)/make/closed/bundles.gmk
120N/Aifeq ($(SKIP_BUNDLES_BUILD), true)
120N/A BUNDLE_RULES_AVAILABLE := false
120N/Aelse
120N/A BUNDLE_RULES_AVAILABLE := $(call MkExists,$(BUNDLE_RULES))
120N/Aendif
0N/A
0N/A# Current things we do NOT build for OPENJDK
0N/Aifdef OPENJDK
0N/A BUILD_DEPLOY = false
0N/A BUILD_INSTALL = false
0N/A BUILD_SPONSORS = false
0N/A BUNDLE_RULES_AVAILABLE := false
0N/A # These could be over-ridden on the command line or in environment
0N/A ifndef SKIP_FASTDEBUG_BUILD
0N/A SKIP_FASTDEBUG_BUILD = true
0N/A endif
0N/A ifndef SKIP_DEBUG_BUILD
0N/A SKIP_DEBUG_BUILD = true
0N/A endif
0N/A ifndef SKIP_COMPARE_IMAGES
0N/A SKIP_COMPARE_IMAGES = true
0N/A endif
0N/Aelse
100N/A
100N/A # Various non-OPENJDK reasons to NOT build the deploy repository
100N/A ifeq ($(ARCH), ia64)
100N/A BUILD_DEPLOY=false
100N/A endif
100N/A ifeq ($(ARCH), sparcv9)
100N/A BUILD_DEPLOY=false
100N/A endif
100N/A ifeq ($(ARCH), amd64)
100N/A ifeq ($(PLATFORM), solaris)
100N/A BUILD_DEPLOY=false
100N/A endif
100N/A endif
100N/A
0N/Aendif
27N/Aifndef SKIP_PRODUCT_BUILD
27N/A SKIP_PRODUCT_BUILD = false
27N/Aendif
0N/A
0N/A# Many reasons why we would want to skip the comparison to previous jdk
0N/Aifndef SKIP_COMPARE_IMAGES
0N/A ifeq ($(BUILD_JDK), false)
0N/A SKIP_COMPARE_IMAGES = true
0N/A endif
0N/A ifeq ($(BUILD_DEPLOY), false)
0N/A SKIP_COMPARE_IMAGES = true
0N/A endif
0N/A ifeq ($(BUILD_INSTALL), false)
0N/A SKIP_COMPARE_IMAGES = true
0N/A endif
0N/A ifdef DEV_ONLY
0N/A SKIP_COMPARE_IMAGES = true
0N/A endif
0N/Aendif
0N/A
0N/A# Select defaults if these are not set to true or false
0N/Aifndef SKIP_DEBUG_BUILD
0N/A SKIP_DEBUG_BUILD=true
0N/Aendif
0N/Aifndef SKIP_FASTDEBUG_BUILD
294N/A SKIP_FASTDEBUG_BUILD=true
0N/Aendif
0N/A
142N/A# Select javadoc setting GENERATE_DOCS
142N/Aifndef NO_DOCS
142N/A # Default value (we want javadoc run)
142N/A GENERATE_DOCS=true
142N/A # If langtools, corba, jaxp, and jaxws are not being built,
142N/A # a full jdk javadoc is not possible
142N/A ifneq ($(BUILD_LANGTOOLS), true)
142N/A GENERATE_DOCS=false
142N/A endif
142N/A ifneq ($(BUILD_CORBA), true)
142N/A GENERATE_DOCS=false
142N/A endif
142N/A ifneq ($(BUILD_JAXP), true)
142N/A GENERATE_DOCS=false
142N/A endif
142N/A ifneq ($(BUILD_JAXWS), true)
142N/A GENERATE_DOCS=false
142N/A endif
142N/A ifeq ($(GENERATE_DOCS),false)
142N/A NO_DOCS=true
142N/A endif
142N/Aelse
142N/A GENERATE_DOCS=false
142N/Aendif
142N/A
0N/A# Output directory for hotspot build
0N/AHOTSPOT_DIR = $(ABS_OUTPUTDIR)/hotspot
0N/A
0N/A# If we are building components
0N/Aifndef ALT_LANGTOOLS_DIST
0N/A LANGTOOLS_OUTPUTDIR = $(ABS_OUTPUTDIR)/langtools
0N/A ABS_LANGTOOLS_DIST = $(LANGTOOLS_OUTPUTDIR)/dist
0N/Aendif
0N/Aifndef ALT_CORBA_DIST
0N/A CORBA_OUTPUTDIR = $(ABS_OUTPUTDIR)/corba
0N/A ABS_CORBA_DIST = $(CORBA_OUTPUTDIR)/dist
0N/Aendif
0N/Aifndef ALT_JAXP_DIST
0N/A JAXP_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxp
0N/A ABS_JAXP_DIST = $(JAXP_OUTPUTDIR)/dist
0N/Aendif
0N/Aifndef ALT_JAXWS_DIST
0N/A JAXWS_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxws
0N/A ABS_JAXWS_DIST = $(JAXWS_OUTPUTDIR)/dist
0N/Aendif
0N/A
0N/A# Common make arguments (supplied to all component builds)
0N/ACOMMON_BUILD_ARGUMENTS = \
0N/A JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
0N/A JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
0N/A EXTERNALSANITYCONTROL=true \
85N/A SOURCE_LANGUAGE_VERSION=$(SOURCE_LANGUAGE_VERSION) \
0N/A TARGET_CLASS_VERSION=$(TARGET_CLASS_VERSION) \
0N/A MILESTONE=$(MILESTONE) \
0N/A BUILD_NUMBER=$(BUILD_NUMBER) \
0N/A JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) \
0N/A FULL_VERSION=$(FULL_VERSION) \
0N/A PREVIOUS_JDK_VERSION=$(PREVIOUS_JDK_VERSION) \
0N/A JDK_VERSION=$(JDK_VERSION) \
0N/A JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
0N/A JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
0N/A JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
15N/A JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
15N/A PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
15N/A PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
15N/A PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
0N/A
0N/Aifdef ARCH_DATA_MODEL
0N/A COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
0N/Aendif
0N/A
0N/Aifeq ($(DEBUG_NAME), debug)
0N/A COMMON_BUILD_ARGUMENTS += VARIANT=DBG DEBUG_CLASSFILES=true
0N/Aendif
0N/A
0N/Aifeq ($(DEBUG_NAME), fastdebug)
0N/A COMMON_BUILD_ARGUMENTS += VARIANT=DBG FASTDEBUG=true DEBUG_CLASSFILES=true
0N/Aendif
0N/A
0N/Aifdef COOKED_JDK_UPDATE_VERSION
0N/A COMMON_BUILD_ARGUMENTS += COOKED_JDK_UPDATE_VERSION=$(COOKED_JDK_UPDATE_VERSION)
0N/Aendif
0N/A
0N/Aifdef COOKED_BUILD_NUMBER
0N/A COMMON_BUILD_ARGUMENTS += COOKED_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
0N/Aendif
0N/A
0N/Aifdef ANT_HOME
0N/A COMMON_BUILD_ARGUMENTS += ANT_HOME="$(ANT_HOME)"
0N/Aendif
0N/A
438N/A# When all repos support FULL_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES,
438N/A# then these can be set here:
438N/A#ifdef FULL_DEBUG_SYMBOLS
438N/A# COMMON_BUILD_ARGUMENTS += FULL_DEBUG_SYMBOLS=$(FULL_DEBUG_SYMBOLS)
438N/A#endif
438N/A#
438N/A#ifdef ZIP_DEBUGINFO_FILES
438N/A# COMMON_BUILD_ARGUMENTS += ZIP_DEBUGINFO_FILES="$(ZIP_DEBUGINFO_FILES)"
438N/A#endif