Makefile revision 27
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This code is free software; you can redistribute it and/or modify it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# under the terms of the GNU General Public License version 2 only, as
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# published by the Free Software Foundation. Sun designates this
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# particular file as subject to the "Classpath" exception as provided
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews# by Sun in the LICENSE file that accompanied this code.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein# This code is distributed in the hope that it will be useful, but WITHOUT
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# version 2 for more details (a copy is included in the LICENSE file that
f4b4e7c16211137332e50bcad3fef0d15639a4f1Brian Wellington# accompanied this code).
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# You should have received a copy of the GNU General Public License version
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# 2 along with this work; if not, write to the Free Software Foundation,
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# CA 95054 USA or visit www.sun.com if you need additional information or
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# have any questions.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# For start and finish echo lines
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonTITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonSTART_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
77ac297199fc44809d9628558223627c10ae3f31Brian WellingtonFINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellingtoninclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# What "all" means
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonall:: openjdk_check sanity all_product_build
571688b02f955f6304649866e768b1f81739cbedBrian Wellington# Everything for a full product build
23f64ea0dcd7f5b7094ae6ade2a002fb7dde1466Brian Wellington# Generis build of basic repo series
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington generic_build_repo_series:: $(JDK_JAVA_EXE)
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington generic_build_repo_series:: openjdk-binary-plugs-bundles
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# The debug build, fastdebug or debug. Needs special handling.
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Note that debug builds do NOT do INSTALL steps, but must be done
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# after the product build and before the INSTALL step of the product build.
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# DEBUG_NAME is fastdebug or debug
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# The resulting j2sdk-image is used by the install makefiles to create a
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# debug install bundle jdk-*-debug-** bundle (tar or zip)
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# which will install in the debug or fastdebug subdirectory of the
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# normal product install area.
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# The install process needs to know what the DEBUG_NAME is, so
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# look for INSTALL_DEBUG_NAME in the install rules.
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Location of fresh bootdir output
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
75582adac73202213d936dc0850f1c9cf47d6cbeMark Andrews# Create boot image?
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington # Create the bootdir to use in the build
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington product_build:: create_fresh_product_bootdir
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington fastdebug_build:: create_fresh_fastdebug_bootdir
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington # Define variables to be used now for the boot jdk
e2fd12f3a020ca8c5de168a44fb72e339cdaa3e9Brian Wellington # Use the supplied ALT_BOOTDIR as the boot
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington $(MAKE) DEBUG_NAME=debug generic_debug_build
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# Build final image
d2aebe24c477c70e79dc33ea0507e8886eb7d626Brian Wellington# Check on whether we really can build the openjdk, need source etc.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington @$(ECHO) "================================================="
75582adac73202213d936dc0850f1c9cf47d6cbeMark Andrews @if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
75582adac73202213d936dc0850f1c9cf47d6cbeMark Andrews $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(ECHO) "OpenJDK will be built after JDK is built"; \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington @$(ECHO) "================================================="
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# If we have bundle rules, we have a chance here to do a complete cycle
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# build, of production and open build.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# FIXUP: We should create the openjdk source bundle and build that?
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# But how do we reliable create or get at a formal openjdk source tree?
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# The one we have needs to be trimmed of built bits and closed dirs.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# The repositories might not be available.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# The openjdk source bundle is probably not available.
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonOPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonOPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
2f012d936b5ccdf6520c96a4de23721dc58a2221Automatic Updaterifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson @$(ECHO) "================================================="
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson @$(ECHO) "================================================="
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson ( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson @$(ECHO) "================================================="
daa73eae708d568d453e6082e0890d35886a9e0fMark Andrews @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson @$(ECHO) "================================================="
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Quick jdk verification build
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Quick jdk verification fastdebug build
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
6b79e960e6ba2991aeb02a6c39af255ab7f06d99Mark Andrews BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# Quick deploy verification fastdebug build
6b79e960e6ba2991aeb02a6c39af255ab7f06d99Mark Andrews# Product build (skip debug builds)
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Check target
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellingtonhelp: intro_help target_help variable_help notes_help examples_help
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# Intro help message
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian WellingtonMakefile for the JDK builds (all the JDK). \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington--- Common Targets --- \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonall -- build the core JDK (default target) \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonhelp -- Print out help information \n\
77ac297199fc44809d9628558223627c10ae3f31Brian Wellingtoncheck -- Check make variable values for correctness \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonsanity -- Perform detailed sanity checks on system and settings \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonfastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtondebug_build -- build the core JDK in 'debug' mode (-g) \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonclean -- remove all built and imported files \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonclobber -- same as clean \n\
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Variable help (only common ones used by this Makefile)
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellingtonvariable_help: variable_help_intro variable_list variable_help_end
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# One line descriptions for the variables
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonPARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonSLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonJDK_IMPORT_PATH.desc = JDK used to import components of the build
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonCOMPILER_PATH.desc = Compiler install directory
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonCACERTS_FILE.desc = Location of certificates file
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonDEVTOOLS_PATH.desc = Directory containing zip and gnumake
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonCUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonDXSDK_PATH.desc = Root directory of DirectX SDK
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian WellingtonMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Make variables to print out (description and value)
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Make variables that should refer to directories that exist
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Make variables that should refer to files that exist
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# Some are windows specific
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# For pattern rules below, so all are treated the same
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas GustafssonDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas GustafssonDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas GustafssonDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafsson# Complete variable check
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafssonvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
307ba34fa07db768c3a899844f248a2c1d7dcc7fAndreas Gustafssonvariable_list: $(DO_PRINTVAL_LIST) variable_check
60b90a37f41ab7607762d0e9791e79bd19eae4f4Brian Wellington# Pattern rule for printing out a variable
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Pattern rule for checking to see if a variable with a directory exists
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington @if [ ! -d $($*) ] ; then \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Pattern rule for checking to see if a variable with a file exists
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington @if [ ! -f $($*) ] ; then \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Misc notes on help
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington--- Notes --- \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington- All builds use same output directory unless overridden with \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington \t to use the clean target first. \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington \t builds or previous release JDK builds will work. \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington- The fastest builds have been when the sources and the BOOTDIR are on \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington \t local disk. \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington--- Examples --- \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington################################################################
77ac297199fc44809d9628558223627c10ae3f31Brian Wellington# Source and binary plug bundling
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington################################################################
75e1e12f48012505699f504cfa364260cb2bc1afBrian Wellington################################################################
75e1e12f48012505699f504cfa364260cb2bc1afBrian Wellington# JPRT rule to build
e2fd12f3a020ca8c5de168a44fb72e339cdaa3e9Brian Wellington################################################################
5e387b9ce6bafdfadedb5b34e4c33a4404e5d589Brian Wellington################################################################
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington################################################################
033ba09d6df0ac92a736a480b9c3b164b61dccb2Brian Wellington# Force target