Makefile revision 289
638a9edaf48cf003cd40ac25ee8c25f572107414stoddard# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# This code is free software; you can redistribute it and/or modify it
0d2f57cf389a981efa5e98d9b451c6baf0af12bfjerenkrantz# under the terms of the GNU General Public License version 2 only, as
0d2f57cf389a981efa5e98d9b451c6baf0af12bfjerenkrantz# published by the Free Software Foundation. Oracle designates this
2cc7cdffce670f2ae1bd4ae502b2c19481487dbejerenkrantz# particular file as subject to the "Classpath" exception as provided
d89c116f82699294ca744125723651c554bc5925wrowe# by Oracle in the LICENSE file that accompanied this code.
8721697e2aece27b0e738519329f7976c72b27bfjerenkrantz# This code is distributed in the hope that it will be useful, but WITHOUT
4a257be29f8aeab984fe5622fa69e0b2aab204d7jerenkrantz# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91cacb801f6c0215b38322f6d2fc58cbfedfecfbjerenkrantz# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
91cacb801f6c0215b38322f6d2fc58cbfedfecfbjerenkrantz# version 2 for more details (a copy is included in the LICENSE file that
df14f0d3a5191cdd7c4bb5b03acd135d43a6f51brbb# accompanied this code).
ab71b233b3a36489e44a7b061c48293be0b17788jwoolley# You should have received a copy of the GNU General Public License version
571760de5e60c0b459cb11be45507b923cd023eejwoolley# 2 along with this work; if not, write to the Free Software Foundation,
571760de5e60c0b459cb11be45507b923cd023eejwoolley# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bcb6e1be6041dfeb549c8ea8d37f97ad4e90a0c3rbb# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9bd71e35f5d26d26d23fe3a677401828e842ed72wrowe# or visit www.oracle.com if you need additional information or have any
2900ab946a2d76b73a14cebfe2985d253f01c967stoddard# questions.
af4c982a7cf4515f124935f99a329744035fc699slive# For start and finish echo lines
af4c982a7cf4515f124935f99a329744035fc699sliveSTART_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
af4c982a7cf4515f124935f99a329744035fc699sliveFINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
976501adbc040220270f7d1d77c4b8373033be69wrowe# What "all" means
e96626975ebc300abc02202f98296f2774e04367brianp# Everything for a full product build
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz# Generic build of basic repo series
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# The debug build, fastdebug or debug. Needs special handling.
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# Note that debug builds do NOT do INSTALL steps, but must be done
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# after the product build and before the INSTALL step of the product build.
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# DEBUG_NAME is fastdebug or debug
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# The resulting j2sdk-image is used by the install makefiles to create a
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# debug install bundle jdk-*-debug-** bundle (tar or zip)
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# which will install in the debug or fastdebug subdirectory of the
5d12baef135b5d3cb94745e007a1575398469724jerenkrantz# normal product install area.
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# The install process needs to know what the DEBUG_NAME is, so
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# look for INSTALL_DEBUG_NAME in the install rules.
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# not be the same location.
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantz# Location of fresh bootdir output
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantzFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
b865daaa4ef731a7066ee6d97e2aae36c7743939jerenkrantzFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
262bfa74293f7bc2049b4cd525875c8775711ca2aaron# Create boot image?
ff42f83cbf31893bcde9712332a8e5ee970f6a74trawick # Create the bootdir to use in the build
54e1babd5a5a56c576eeeace54110150769cc916coar # Define variables to be used now for the boot jdk
54e1babd5a5a56c576eeeace54110150769cc916coar # Use the supplied ALT_BOOTDIR as the boot
f126ee03179eb54308118f1ec3de5a7b461685d8aaron# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
f126ee03179eb54308118f1ec3de5a7b461685d8aaron# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
f126ee03179eb54308118f1ec3de5a7b461685d8aaron# not be the same location.
f126ee03179eb54308118f1ec3de5a7b461685d8aaron ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
109faf633e12ab0bbdd602c7addc795cce59e8addreid# Build final image
4ca13a5e126946272f02637e268a8e09193c553ecoar $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
4ca13a5e126946272f02637e268a8e09193c553ecoar -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
48c0c81cd6fabac9d3386406d97633780365b839coar# Dev builds
7fe18c15b669db9d191859695901dc4fcf3829dawrowe# Quick jdk verification build
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
48c0c81cd6fabac9d3386406d97633780365b839coar# Quick jdk verification fastdebug build
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe# Quick deploy verification fastdebug build
7bce59d998f2e5ca1cb60038ef6c1d0817605d62stoddard# Product build (skip debug builds)
1b9744b72f26e9a0e935f9c08d49feb1fcce72f9jwoolley# Check target
7bce59d998f2e5ca1cb60038ef6c1d0817605d62stoddard# Help target
19cbe4d7b7c931723e7249de6829bf965a1fee72stoddardhelp: intro_help target_help variable_help notes_help examples_help
b187d568e1507d75139ebc13ca945b38fc05d55cstoddard# Intro help message
1c6fb1e726ce22694de0e9a957adb67b929e5d4fstoddardMakefile for the JDK builds (all the JDK). \n\
d2f8b010487ffa990a9c268df5a25579e7291bcdrbb# Target help
0bff2f28ef945280c17099c142126178a78e1e54manoj--- Common Targets --- \n\
0bff2f28ef945280c17099c142126178a78e1e54manojall -- build the core JDK (default target) \n\
1e585ba09ea32272e63c4c39c35491e975d21d98stoddardhelp -- Print out help information \n\
0bff2f28ef945280c17099c142126178a78e1e54manojcheck -- Check make variable values for correctness \n\
35330e0d79ceb8027223bbb8330a381b1f989d6etrawicksanity -- Perform detailed sanity checks on system and settings \n\
0bff2f28ef945280c17099c142126178a78e1e54manojfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddarddebug_build -- build the core JDK in 'debug' mode (-g) \n\
ff849e4163ed879288f0df15f78b6c9d278ec804fanfclean -- remove all built and imported files \n\
ff849e4163ed879288f0df15f78b6c9d278ec804fanfclobber -- same as clean \n\
e0427bf8e52a8fb920cb8b6adb5cdb3b6535b7fecoar# Variable help (only common ones used by this Makefile)
e0427bf8e52a8fb920cb8b6adb5cdb3b6535b7fecoarvariable_help: variable_help_intro variable_list variable_help_end
db3ccce11afac4fc1d4f51a65424412f7480c46cgstein# One line descriptions for the variables
48c0c81cd6fabac9d3386406d97633780365b839coarPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
48c0c81cd6fabac9d3386406d97633780365b839coarSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
48c0c81cd6fabac9d3386406d97633780365b839coarJDK_IMPORT_PATH.desc = JDK used to import components of the build
79d5106a9b65b956d646f5daae4b94bc79e315b8trawickDEVTOOLS_PATH.desc = Directory containing zip and gnumake
79d5106a9b65b956d646f5daae4b94bc79e315b8trawickCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
cf6bf6c34c936e6a6fe731dbce4a5c3c8bf8e9a3gstein# Make variables to print out (description and value)
e636eba7474e0010b5c7198af1c2fe5ad8652dbbmanoj# Make variables that should refer to directories that exist
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe# Make variables that should refer to files that exist
60d567a0c2aae815ee6fc20c0d65032bea52c92cwrowe# Some are windows specific
fdff4ace2701177219fe1c444f69242372423354aaron# For pattern rules below, so all are treated the same
27757f6699a924d4b493a1b6cceb27df27a43287dreidDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
27757f6699a924d4b493a1b6cceb27df27a43287dreidDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
27757f6699a924d4b493a1b6cceb27df27a43287dreidDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
7169eebe7cef1a6bbd082f28b1906f91b6fc6621stoddard# Complete variable check
7169eebe7cef1a6bbd082f28b1906f91b6fc6621stoddardvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
21e01f13f717faeca3e498d7d9c9b4d3af98ae27trawick# Pattern rule for printing out a variable
21e01f13f717faeca3e498d7d9c9b4d3af98ae27trawick# Pattern rule for checking to see if a variable with a directory exists
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @if [ ! -d $($*) ] ; then \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
48c0c81cd6fabac9d3386406d97633780365b839coar# Pattern rule for checking to see if a variable with a file exists
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @if [ ! -f $($*) ] ; then \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# Misc notes on help
64ad864fa0f4493eebb181e393b40a8a90beccb9coar--- Notes --- \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar- All builds use same output directory unless overridden with \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar \t to use the clean target first. \n\
48c0c81cd6fabac9d3386406d97633780365b839coar- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar \t builds or previous release JDK builds will work. \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar- The fastest builds have been when the sources and the BOOTDIR are on \n\
64ad864fa0f4493eebb181e393b40a8a90beccb9coar \t local disk. \n\
48c0c81cd6fabac9d3386406d97633780365b839coar--- Examples --- \n\
48c0c81cd6fabac9d3386406d97633780365b839coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# Source bundling
64ad864fa0f4493eebb181e393b40a8a90beccb9coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar################################################################
48c0c81cd6fabac9d3386406d97633780365b839coar# rule to test
64ad864fa0f4493eebb181e393b40a8a90beccb9coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @$(ECHO) "#################################################"
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @$(ECHO) "#################################################"
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @if [ -s $< ] ; then \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# Get failure list from log
64ad864fa0f4493eebb181e393b40a8a90beccb9coar$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
64ad864fa0f4493eebb181e393b40a8a90beccb9coar @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# Get log file of all tests run
64ad864fa0f4493eebb181e393b40a8a90beccb9coar elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
48c0c81cd6fabac9d3386406d97633780365b839coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# JPRT rule to build
64ad864fa0f4493eebb181e393b40a8a90beccb9coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar################################################################
48c0c81cd6fabac9d3386406d97633780365b839coar################################################################
64ad864fa0f4493eebb181e393b40a8a90beccb9coar.PHONY: all test test_run test_start test_summary test_clean \
64ad864fa0f4493eebb181e393b40a8a90beccb9coar# Force target