Makefile revision 613
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# This code is free software; you can redistribute it and/or modify it
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# under the terms of the GNU General Public License version 2 only, as
983523cf73bc85cce6282cb5aa78b60f6bcd959fLubos Kosco# published by the Free Software Foundation. Oracle designates this
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# particular file as subject to the "Classpath" exception as provided
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# by Oracle in the LICENSE file that accompanied this code.
983523cf73bc85cce6282cb5aa78b60f6bcd959fLubos Kosco# This code is distributed in the hope that it will be useful, but WITHOUT
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# version 2 for more details (a copy is included in the LICENSE file that
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# accompanied this code).
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# You should have received a copy of the GNU General Public License version
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# 2 along with this work; if not, write to the Free Software Foundation,
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# or visit www.oracle.com if you need additional information or have any
983523cf73bc85cce6282cb5aa78b60f6bcd959fLubos Kosco# Basename of any originally supplied ALT_OUTPUTDIR directory
983523cf73bc85cce6282cb5aa78b60f6bcd959fLubos Kosco ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# The three possible directories created for output (3 build flavors)
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter BrayOUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalOUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# Relative path to a debug output area
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalREL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
65df1e87266301e243dcead8082ca6255abea666Vladimir Kotal# The created jdk image directory
425278cfacbc73f1e955ab6016f206fc5ed93ccbVladimir KotalJDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
65df1e87266301e243dcead8082ca6255abea666Vladimir KotalABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
65df1e87266301e243dcead8082ca6255abea666Vladimir Kotal# Relative path from an output directory to the image directory
425278cfacbc73f1e955ab6016f206fc5ed93ccbVladimir KotalREL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalREL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalREL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
83439b4ed8fe40097dc3f2c05168d26bd7926159Vladimir Kotalinclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco# Everything for a full product build
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# Generic build of basic repo series
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco generic_build_repo_series:: install-binaries-jdk-debug
cd348e325366620fe047edcc849e3c9424828599Peter Bray @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The debug build, fastdebug or debug. Needs special handling.
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Note that debug builds do NOT do INSTALL steps aside from the
cd348e325366620fe047edcc849e3c9424828599Peter Bray# install-binaries-jdk-debug or install-binaries-jdk-debug-clobber targets.
cd348e325366620fe047edcc849e3c9424828599Peter Bray# DEBUG_NAME is fastdebug or debug
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The resulting image directory (j2sdk-image) is used by the install makefiles
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal# (only if debug files are present when install checks for them)
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal# to create a debug install bundle jdk-*-debug-** bundle (tar or zip)
cd348e325366620fe047edcc849e3c9424828599Peter Bray# which will install in the debug or fastdebug subdirectory of the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# normal product install area.
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The install process needs to know what the DEBUG_NAME is, so
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# look for INSTALL_DEBUG_NAME in the install rules.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco# not be the same location.
d7c1415de39f4b07c85828f49cd1ee7a2a19eb9eLubos Kosco# Location of fresh bootdir output
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos KoscoFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos KoscoFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
bc5565fc58603964988b42b6aee40e246f35d94fVladimir Kotal $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
bc5565fc58603964988b42b6aee40e246f35d94fVladimir Kotal $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Create boot image?
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Create the bootdir to use in the build
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Define variables to be used now for the boot jdk
17d95a647aba8c37d9ac34d97e4eed729aa46f67Naseer Ahmed # Use the supplied ALT_BOOTDIR as the boot
cd348e325366620fe047edcc849e3c9424828599Peter Bray# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
b17cb0705d90907337b3528aa7b8ed1700806f26Vladimir Kotal# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
d6ee3934a24d8ccc0e4bb478405d8e5f6a35825dLubos Kosco# not be the same location.
8f8c3f4555e5aa3160f03f2e9c55ddbd3381357bLubos Kosco ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco# Build final image
1a5c2ab40bd94d2b2c63afda767ce7bbf29ecc4bJan Friedel# The source tips are stored with the relative path to the repo.
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco# This file will be used when constructing the jdk image.
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Quick jdk verification build
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco# Quick jdk verification fastdebug build
cd348e325366620fe047edcc849e3c9424828599Peter Bray $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Quick deploy verification fastdebug build
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# Product build (skip debug builds)
83439b4ed8fe40097dc3f2c05168d26bd7926159Vladimir Kotal# Check target
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozinahelp: intro_help target_help variable_help notes_help examples_help
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina# Intro help message
cd348e325366620fe047edcc849e3c9424828599Peter BrayMakefile for the JDK builds (all the JDK). \n\
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Target help
cd348e325366620fe047edcc849e3c9424828599Peter Bray--- Common Targets --- \n\
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Brayall -- build the core JDK (default target) \n\
cd348e325366620fe047edcc849e3c9424828599Peter Brayhelp -- Print out help information \n\
cd348e325366620fe047edcc849e3c9424828599Peter Braycheck -- Check make variable values for correctness \n\
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Braysanity -- Perform detailed sanity checks on system and settings \n\
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Brayfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Koscodebug_build -- build the core JDK in 'debug' mode (-g) \n\
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbyeclean -- remove all built and imported files \n\
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Brayclobber -- same as clean \n\
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye# Variable help (only common ones used by this Makefile)
3a5046f0538ba9fb3a9429199544a9f4b93d9a4dLubos Koscovariable_help: variable_help_intro variable_list variable_help_end
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# One line descriptions for the variables
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BraySLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayJDK_IMPORT_PATH.desc = JDK used to import components of the build
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoDEVTOOLS_PATH.desc = Directory containing zip and gnumake
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Make variables to print out (description and value)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Make variables that should refer to directories that exist
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Make variables that should refer to files that exist
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal# Some are windows specific
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# For pattern rules below, so all are treated the same
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Complete variable check
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Brayvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye# Pattern rule for printing out a variable
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye# Pattern rule for checking to see if a variable with a directory exists
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye @if [ ! -d $($*) ] ; then \
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye# Pattern rule for checking to see if a variable with a file exists
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye @if [ ! -f $($*) ] ; then \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal# Misc notes on help
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal--- Notes --- \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal- All builds use same output directory unless overridden with \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal \t to use the clean target first. \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal \t builds or previous release JDK builds will work. \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal- The fastest builds have been when the sources and the BOOTDIR are on \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal \t local disk. \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal--- Examples --- \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
f9e7e93ed37cbcb0a111b6f997bb75d567c31c0bVladimir Kotal $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Source bundling
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# rule to test
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye################################################################
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @$(ECHO) "#################################################"
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @$(ECHO) "#################################################"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @if [ -s $< ] ; then \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Get failure list from log
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Get log file of all tests run
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# JPRT rule to build
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
fe967af3e58b6c8feaecf15b06fc1d5401b07914Lubos Kosco################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray################################################################
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray.PHONY: all test test_run test_start test_summary test_clean \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Force target