Makefile revision 181
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This code is free software; you can redistribute it and/or modify it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# under the terms of the GNU General Public License version 2 only, as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# published by the Free Software Foundation. Oracle designates this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# particular file as subject to the "Classpath" exception as provided
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# by Oracle in the LICENSE file that accompanied this code.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# version 2 for more details (a copy is included in the LICENSE file that
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# accompanied this code).
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User# You should have received a copy of the GNU General Public License version
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 2 along with this work; if not, write to the Free Software Foundation,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# or visit www.oracle.com if you need additional information or have any
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# For start and finish echo lines
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserTITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserSTART_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserFINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
2fa992d017c027173a47c834db88bef10df453c0Tinderbox Userinclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# What "all" means
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Everything for a full product build
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Generis build of basic repo series
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews generic_build_repo_series:: openjdk-binary-plugs-bundles
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The debug build, fastdebug or debug. Needs special handling.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Note that debug builds do NOT do INSTALL steps, but must be done
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# after the product build and before the INSTALL step of the product build.
47012ae6dbf18a2503d7b33c1c9583dc38625cb7Mark Andrews# DEBUG_NAME is fastdebug or debug
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The resulting j2sdk-image is used by the install makefiles to create a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# debug install bundle jdk-*-debug-** bundle (tar or zip)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# which will install in the debug or fastdebug subdirectory of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# normal product install area.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The install process needs to know what the DEBUG_NAME is, so
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# look for INSTALL_DEBUG_NAME in the install rules.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Location of fresh bootdir output
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark AndrewsFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews# Create boot image?
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
a1b05dea35aa30b152a47115e18bbe679d3fcf19Mark Andrews # Create the bootdir to use in the build
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater fastdebug_build:: create_fresh_fastdebug_bootdir
9c6a5d1f22f972232d7a9fd5c5fa64f10bacbdffAutomatic Updater # Define variables to be used now for the boot jdk
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Use the supplied ALT_BOOTDIR as the boot
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Build final image
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Check on whether we really can build the openjdk, need source etc.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ECHO) "================================================="
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) "OpenJDK will be built after JDK is built"; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ECHO) "================================================="
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If we have bundle rules, we have a chance here to do a complete cycle
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# build, of production and open build.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# FIXUP: We should create the openjdk source bundle and build that?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# But how do we reliable create or get at a formal openjdk source tree?
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The one we have needs to be trimmed of built bits and closed dirs.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The repositories might not be available.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The openjdk source bundle is probably not available.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinOPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinOPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ECHO) "================================================="
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ECHO) "================================================="
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews @$(ECHO) "================================================="
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @$(ECHO) "================================================="
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Quick jdk verification build
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Quick jdk verification fastdebug build
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Quick deploy verification fastdebug build
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Product build (skip debug builds)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Check target
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Help target
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewshelp: intro_help target_help variable_help notes_help examples_help
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Intro help message
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsMakefile for the JDK builds (all the JDK). \n\
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Target help
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User--- Common Targets --- \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsall -- build the core JDK (default target) \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewshelp -- Print out help information \n\
2fa992d017c027173a47c834db88bef10df453c0Tinderbox Usercheck -- Check make variable values for correctness \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewssanity -- Perform detailed sanity checks on system and settings \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
2fa992d017c027173a47c834db88bef10df453c0Tinderbox Userdebug_build -- build the core JDK in 'debug' mode (-g) \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsclean -- remove all built and imported files \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsclobber -- same as clean \n\
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Variable help (only common ones used by this Makefile)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsvariable_help: variable_help_intro variable_list variable_help_end
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# One line descriptions for the variables
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsJDK_IMPORT_PATH.desc = JDK used to import components of the build
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserCACERTS_FILE.desc = Location of certificates file
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsDEVTOOLS_PATH.desc = Directory containing zip and gnumake
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
2fa992d017c027173a47c834db88bef10df453c0Tinderbox UserDXSDK_PATH.desc = Root directory of DirectX SDK
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Make variables to print out (description and value)
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Make variables that should refer to directories that exist
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Make variables that should refer to files that exist
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Some are windows specific
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# For pattern rules below, so all are treated the same
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
71c66a876ecca77923638d3f94cc0783152b2f03Mark AndrewsDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Complete variable check
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrewsvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
2fa992d017c027173a47c834db88bef10df453c0Tinderbox Uservariable_list: $(DO_PRINTVAL_LIST) variable_check
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Pattern rule for printing out a variable
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Pattern rule for checking to see if a variable with a directory exists
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein @if [ ! -d $($*) ] ; then \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Pattern rule for checking to see if a variable with a file exists
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews @if [ ! -f $($*) ] ; then \
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Misc notes on help
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews--- Notes --- \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews- All builds use same output directory unless overridden with \n\
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews \t to use the clean target first. \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User \t builds or previous release JDK builds will work. \n\
cefd74ae81cf51692af3a38c1330261a5110fca7Tinderbox User- The fastest builds have been when the sources and the BOOTDIR are on \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews \t local disk. \n\
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User--- Examples --- \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews################################################################
2fa992d017c027173a47c834db88bef10df453c0Tinderbox User# Source and binary plug bundling
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews################################################################
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JPRT rule to build
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein################################################################
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein################################################################
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# Force target