Makefile revision 332
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
18920d790825d96ca3943aa2dcb6eb80dc611c5fTinderbox User# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e9e4257668ff6c4e583b0c0db2508650b0b677b8Tinderbox User# This code is free software; you can redistribute it and/or modify it
e9e4257668ff6c4e583b0c0db2508650b0b677b8Tinderbox User# under the terms of the GNU General Public License version 2 only, as
c57668a2fbbe558c1bd21652813616f2f517c469Tinderbox User# published by the Free Software Foundation. Oracle designates this
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews# particular file as subject to the "Classpath" exception as provided
1f4c645185bd8fc70048e0a69eee46193a284e5cTinderbox User# by Oracle in the LICENSE file that accompanied this code.
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User# This code is distributed in the hope that it will be useful, but WITHOUT
950d203b64f512b85fcc093ee1e9e3e531a1aea3Tinderbox User# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# accompanied this code).
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You should have received a copy of the GNU General Public License version
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
a7c412f37cc73d0332887a746e81220cbf09dd00Mark 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
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# or visit www.oracle.com if you need additional information or have any
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
16f6050f29b6b0422cee858e609f65e474e70ef2Tinderbox User# Everything for a full product build
7a6494cfb6cc7d3f67af07359561e05e6bb8c0edTinderbox User $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
18920d790825d96ca3943aa2dcb6eb80dc611c5fTinderbox User# Generic build of basic repo series
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# The debug build, fastdebug or debug. Needs special handling.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Note that debug builds do NOT do INSTALL steps, but must be done
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# after the product build and before the INSTALL step of the product build.
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# DEBUG_NAME is fastdebug or debug
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# The resulting j2sdk-image is used by the install makefiles to create a
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# debug install bundle jdk-*-debug-** bundle (tar or zip)
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# which will install in the debug or fastdebug subdirectory of the
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# normal product install area.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# The install process needs to know what the DEBUG_NAME is, so
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox User# look for INSTALL_DEBUG_NAME in the install rules.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
e20788e1216ed720aefa84f3295f7899d9f28c22Mark Andrews# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# not be the same location.
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox User# Location of fresh bootdir output
37d8e0a4455876fe1e4cca511076cc2c5ab9eedeTinderbox UserABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox UserFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# Create boot image?
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews # Create the bootdir to use in the build
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User fastdebug_build:: create_fresh_fastdebug_bootdir
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User # Define variables to be used now for the boot jdk
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User # Use the supplied ALT_BOOTDIR as the boot
37d8e0a4455876fe1e4cca511076cc2c5ab9eedeTinderbox User# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox User# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews# not be the same location.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
b02be031b9ff37b042adc8e68e36b8bbc1f672b7Tinderbox User# Build final image
d7d105151a78d35afb4233d2a6dbd47b7ec0d9a5Tinderbox User# The source tips are stored with the relative path to the repo.
b02be031b9ff37b042adc8e68e36b8bbc1f672b7Tinderbox User# This file will be used when constructing the jdk image.
37d8e0a4455876fe1e4cca511076cc2c5ab9eedeTinderbox User $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
91d187ce035f39073f0732ff2a401a45c3c955fbMark Andrews $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
c2abd6efeb9affa70aabb63da2acb23e135cf7f2Mark Andrews -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Quick jdk verification build
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews# Quick jdk verification fastdebug build
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
757ff043760e4743dda1a10e7d58349275934902Tinderbox User BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# Quick deploy verification fastdebug build
3857cb6fcabeb79d85de4b3e3e4ab99912b701f8Mark Andrews# Product build (skip debug builds)
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# Check target
4f45d802dc97f12f87e23be2f2e0ba6216e6cea2Tinderbox Userhelp: intro_help target_help variable_help notes_help examples_help
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# Intro help message
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsMakefile for the JDK builds (all the JDK). \n\
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews# Target help
0e573cdd111e060e5f6c18249b5ccacbe8abe278Tinderbox User--- Common Targets --- \n\
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrewsall -- build the core JDK (default target) \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewshelp -- Print out help information \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewscheck -- Check make variable values for correctness \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewssanity -- Perform detailed sanity checks on system and settings \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewsfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewsdebug_build -- build the core JDK in 'debug' mode (-g) \n\
e8fc8c884b44371784805e1e0d3100da403dd3f1Automatic Updaterclean -- remove all built and imported files \n\
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewsclobber -- same as clean \n\
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Variable help (only common ones used by this Makefile)
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrewsvariable_help: variable_help_intro variable_list variable_help_end
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# One line descriptions for the variables
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
0eb371ca0dab50ae3462e98794a6126198c52f4bMark AndrewsJDK_IMPORT_PATH.desc = JDK used to import components of the build
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsCACERTS_FILE.desc = Location of certificates file
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsDEVTOOLS_PATH.desc = Directory containing zip and gnumake
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews# Make variables to print out (description and value)
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# Make variables that should refer to directories that exist
37d8e0a4455876fe1e4cca511076cc2c5ab9eedeTinderbox User# Make variables that should refer to files that exist
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Some are windows specific
3a988722ad9e209ba4064604d482dc4efe0e19ebTinderbox User# For pattern rules below, so all are treated the same
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark AndrewsDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# Complete variable check
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsvariable_list: $(DO_PRINTVAL_LIST) variable_check
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Pattern rule for printing out a variable
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# Pattern rule for checking to see if a variable with a directory exists
a5636b773fa05a272b6876afd99309c0b3090e2fMark Andrews @if [ ! -d $($*) ] ; then \
a5636b773fa05a272b6876afd99309c0b3090e2fMark Andrews $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
a5636b773fa05a272b6876afd99309c0b3090e2fMark Andrews# Pattern rule for checking to see if a variable with a file exists
f7369b2881b5e63d69600adcedc8ba938303d30cTinderbox User @if [ ! -f $($*) ] ; then \
d6317350b1180aa4517f2e8a92fa8fbcbf904ad8Automatic Updater $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Misc notes on help
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington--- Notes --- \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington- All builds use same output directory unless overridden with \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington \t to use the clean target first. \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington \t builds or previous release JDK builds will work. \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington- The fastest builds have been when the sources and the BOOTDIR are on \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington \t local disk. \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington--- Examples --- \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Source bundling
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# rule to test
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtontest_run: test_clean test_start test_summary
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtontest_summary: $(OUTPUTDIR)/test_failures.txt
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "#################################################"
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews @$(ECHO) "#################################################"
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews @if [ -s $< ] ; then \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater $(ECHO) "Success! No failures detected"; \
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# Get failure list from log
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# Get log file of all tests run
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User################################################################
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# JPRT rule to build
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews################################################################
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User################################################################
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews################################################################
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews.PHONY: all test test_run test_start test_summary test_clean \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Force target