Makefile revision 315
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
04428429c4e689333e3ef8d19a2debeb20d4d15dMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# This code is free software; you can redistribute it and/or modify it
2a40fdc2d34adb8a5c72a748449699666032d461Mark Andrews# under the terms of the GNU General Public License version 2 only, as
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# published by the Free Software Foundation. Oracle designates this
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# particular file as subject to the "Classpath" exception as provided
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# by Oracle in the LICENSE file that accompanied this code.
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# This code is distributed in the hope that it will be useful, but WITHOUT
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d56e188030368b835122d759ebbf8d9613c166f4Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# accompanied this code).
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You should have received a copy of the GNU General Public License version
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# or visit www.oracle.com if you need additional information or have any
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
e086341ea57e618a60c9f166b95daee1fab71b3bMark Andrews# Everything for a full product build
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews# Generic build of basic repo series
6a78eb0a8677dca8817233799a715de27f9c2cbbMark Andrews @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews# The debug build, fastdebug or debug. Needs special handling.
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark Andrews# Note that debug builds do NOT do INSTALL steps, but must be done
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# after the product build and before the INSTALL step of the product build.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# DEBUG_NAME is fastdebug or debug
62ee2c9f460d2e2e45dcf1abc8b4b4a4a43f5618Mark Andrews# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
1eb1e1e838d2ea00b166c918bf50764a95826be8Mark Andrews# The resulting j2sdk-image is used by the install makefiles to create a
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# debug install bundle jdk-*-debug-** bundle (tar or zip)
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# which will install in the debug or fastdebug subdirectory of the
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# normal product install area.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# The install process needs to know what the DEBUG_NAME is, so
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# look for INSTALL_DEBUG_NAME in the install rules.
ca12f7f4cf72e2368ee946f3eb4915ab73576cdcMark Andrews# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
1eb1e1e838d2ea00b166c918bf50764a95826be8Mark Andrews# not be the same location.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Location of fresh bootdir output
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark AndrewsFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
ed178efa9ab8f813538fce4ff603b81ded9f1799Mark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Create boot image?
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews # Create the bootdir to use in the build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington fastdebug_build:: create_fresh_fastdebug_bootdir
282e38d96feb488fddbbc0b0409491094786977fMark Andrews # Define variables to be used now for the boot jdk
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington # Use the supplied ALT_BOOTDIR as the boot
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# not be the same location.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) DEBUG_NAME=debug generic_debug_build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Build final image
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Quick jdk verification build
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
0d3490f93bb980fde704055e74c1b508987a5fe4Mark Andrews# Quick jdk verification fastdebug build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# Quick deploy verification fastdebug build
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Product build (skip debug builds)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Check target
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonhelp: intro_help target_help variable_help notes_help examples_help
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Intro help message
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark AndrewsMakefile for the JDK builds (all the JDK). \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington--- Common Targets --- \n\
01bf5871f8861eb805dd8ca79bdb9b0b9e4e6a5eMark Andrewsall -- build the core JDK (default target) \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewshelp -- Print out help information \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewscheck -- Check make variable values for correctness \n\
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrewssanity -- Perform detailed sanity checks on system and settings \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtondebug_build -- build the core JDK in 'debug' mode (-g) \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrewsclean -- remove all built and imported files \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonclobber -- same as clean \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Variable help (only common ones used by this Makefile)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonvariable_help: variable_help_intro variable_list variable_help_end
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# One line descriptions for the variables
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark AndrewsJDK_IMPORT_PATH.desc = JDK used to import components of the build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCACERTS_FILE.desc = Location of certificates file
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDEVTOOLS_PATH.desc = Directory containing zip and gnumake
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark AndrewsCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDXSDK_PATH.desc = Root directory of DirectX SDK
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Make variables to print out (description and value)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Make variables that should refer to directories that exist
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Make variables that should refer to files that exist
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Some are windows specific
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews# For pattern rules below, so all are treated the same
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark AndrewsDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Complete variable check
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonvariable_list: $(DO_PRINTVAL_LIST) variable_check
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Pattern rule for printing out a variable
bf54ac86eeddce16b67c525d38d1096cc956f478Mark Andrews# Pattern rule for checking to see if a variable with a directory exists
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @if [ ! -d $($*) ] ; then \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# Pattern rule for checking to see if a variable with a file exists
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @if [ ! -f $($*) ] ; then \
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Misc notes on help
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington--- Notes --- \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews- All builds use same output directory unless overridden with \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews \t to use the clean target first. \n\
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington \t builds or previous release JDK builds will work. \n\
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington- The fastest builds have been when the sources and the BOOTDIR are on \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews \t local disk. \n\
2bef3713093349af52ba61eaab07adf3207da873Mark Andrews--- Examples --- \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews################################################################
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Source bundling
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews################################################################
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews################################################################
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# rule to test
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @$(ECHO) "#################################################"
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews @$(ECHO) "#################################################"
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews @if [ -s $< ] ; then \
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews# Get failure list from log
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
48b492d73ae5328c5efef4b9e0f22063e0ab058aMark Andrews# Get log file of all tests run
48b492d73ae5328c5efef4b9e0f22063e0ab058aMark Andrews if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
2da2220fe7af2c45724b50b0187523b1fab0cf08Rob Austein################################################################
7e5b2100ea65658a7ec3795919b4ecd29a6f118aMark Andrews# JPRT rule to build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington.PHONY: all test test_run test_start test_summary test_clean \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Force target