Makefile revision 311
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
7a2a1b8b14fc804ac80612d7b98064095e445be5Automatic Updater# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# This code is free software; you can redistribute it and/or modify it
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# under the terms of the GNU General Public License version 2 only, as
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater# published by the Free Software Foundation. Oracle designates this
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# particular file as subject to the "Classpath" exception as provided
fe84edc17e0d582cf7b4270f8df9d4742a107b1cAutomatic Updater# by Oracle in the LICENSE file that accompanied this code.
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User# This code is distributed in the hope that it will be useful, but WITHOUT
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# version 2 for more details (a copy is included in the LICENSE file that
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# accompanied this code).
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater# You should have received a copy of the GNU General Public License version
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# or visit www.oracle.com if you need additional information or have any
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterinclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
a80993946f29ff39df38818ee9b2e58a4e46cb7eTinderbox User# Everything for a full product build
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Generic build of basic repo series
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater generic_build_repo_series:: $(JDK_JAVA_EXE)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# The debug build, fastdebug or debug. Needs special handling.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# Note that debug builds do NOT do INSTALL steps, but must be done
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# after the product build and before the INSTALL step of the product build.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# DEBUG_NAME is fastdebug or debug
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
f132a836c4e386b1af045dd8fe7106ae61b90bffAutomatic Updater# The resulting j2sdk-image is used by the install makefiles to create a
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater# debug install bundle jdk-*-debug-** bundle (tar or zip)
c6a0f4ae1d7183a16ffb196b86b647f870694796Automatic Updater# which will install in the debug or fastdebug subdirectory of the
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater# normal product install area.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# The install process needs to know what the DEBUG_NAME is, so
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# look for INSTALL_DEBUG_NAME in the install rules.
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater# not be the same location.
4e0e18467f8ec5a9e5d0c538ce46bf07409ecf9bTinderbox User# Location of fresh bootdir output
e85565067cf73f8cc21ee29b11761659f1d47ee9Automatic UpdaterABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic UpdaterFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic UpdaterFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Create boot image?
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater # Create the bootdir to use in the build
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater product_build:: create_fresh_product_bootdir
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater fastdebug_build:: create_fresh_fastdebug_bootdir
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews # Define variables to be used now for the boot jdk
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
1368e4b34cef64604c874fcc40201c78e548714cTinderbox User # Use the supplied ALT_BOOTDIR as the boot
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
c3fd32ed29e9e419bb56583f4272a506773b1ea0Automatic Updater# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
a382ca49c874d38ad3ac8995b49f9f27128e4ca9Automatic Updater# not be the same location.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
e2caa7536302de34de6cc04025abcd53dc3a499aAutomatic Updater $(MAKE) DEBUG_NAME=debug generic_debug_build
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
0b57424d28c9a67018107133f9fbc0a7dcf057e2Mark Andrews# Build final image
3351ccbd5c1961404044f8273d54dad405f53960Mark Andrews $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
7d12a6b412fe47e6d6582923fd6954ab8cd0baebAutomatic Updater $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User# Quick jdk verification build
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# Quick jdk verification fastdebug build
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Quick deploy verification fastdebug build
b13d89bd89878137c81b36a36596cca3920f27a4Automatic Updater# Product build (skip debug builds)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonhelp: intro_help target_help variable_help notes_help examples_help
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Intro help message
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonMakefile for the JDK builds (all the JDK). \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington--- Common Targets --- \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonall -- build the core JDK (default target) \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonhelp -- Print out help information \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtoncheck -- Check make variable values for correctness \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonsanity -- Perform detailed sanity checks on system and settings \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtondebug_build -- build the core JDK in 'debug' mode (-g) \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonclean -- 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:
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonJDK_IMPORT_PATH.desc = JDK used to import components of the build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCOMPILER_PATH.desc = Compiler install directory
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCACERTS_FILE.desc = Location of certificates file
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDEVTOOLS_PATH.desc = Directory containing zip and gnumake
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCUPS_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)
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# Make variables that should refer to directories that exist
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# Make variables that should refer to files that exist
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Some are windows specific
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# For pattern rules below, so all are treated the same
099b86fb8136a7dff81df85cf395978c16eb254cAutomatic UpdaterDO_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
e10d61d84e0b735f1e8eca18644cfdb1b06cad33Tinderbox Uservariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updatervariable_list: $(DO_PRINTVAL_LIST) variable_check
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Pattern rule for printing out a variable
e01f44b37ba11c9d34f4a8394f950efae5c07f33Automatic Updater# Pattern rule for checking to see if a variable with a directory exists
c01dec514a81ecf8c17ca3ef8c3ba95e437295ebAutomatic Updater @if [ ! -d $($*) ] ; then \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
3de6db3208d51de1e138b63b9670430c03f99694Automatic Updater# Pattern rule for checking to see if a variable with a file exists
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @if [ ! -f $($*) ] ; then \
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User $(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\
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater################################################################
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# Source bundling
79cea03ba823e2d3a34895f0ba91d7fb5ad799e7Automatic Updater################################################################
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) "#################################################"
7d704e522860496310bb29c28e76064868401a9cMark Andrews @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "#################################################"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @if [ -s $< ] ; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# Get failure list from log
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Get log file of all tests run
42bee07ebb8152a6ec2f87f4790d87368c24704cAutomatic Updater if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# JPRT rule to build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington################################################################