Makefile revision 8
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# This code is free software; you can redistribute it and/or modify it
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# under the terms of the GNU General Public License version 2 only, as
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# published by the Free Software Foundation. Sun designates this
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# particular file as subject to the "Classpath" exception as provided
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# by Sun in the LICENSE file that accompanied this code.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# This code is distributed in the hope that it will be useful, but WITHOUT
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# accompanied this code).
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# You should have received a copy of the GNU General Public License version
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a02a0a8a7eb461619931f4a0e896afa247b52c54Mark Andrews# CA 95054 USA or visit www.sun.com if you need additional information or
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# have any questions.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssoninclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: `$(DATE) '+%y-%m-%d %H:%M'`
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Rules for sanity checks
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Rules for various components
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Check on whether we really can build the openjdk, need source etc.
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews @$(ECHO) "================================================="
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews @if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ECHO) "OpenJDK will be built after JDK is built"; \
413988c8166976498250c0ebb2e3a645d0366bd3Mark Andrews $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
c25080dc50542213058c240226c9f342186e6285Mark Andrews @$(ECHO) "================================================="
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Generic debug build, fastdebug or debug. Needs special handling.
ca12f7f4cf72e2368ee946f3eb4915ab73576cdcMark Andrews# Note that debug builds do NOT do INSTALL steps, but must be done
c25080dc50542213058c240226c9f342186e6285Mark Andrews# after the product build and before the INSTALL step of the product build.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# DEBUG_NAME is fastdebug or debug
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The resulting j2sdk-image is used by the install makefiles to create a
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# debug install bundle jdk-*-debug-** bundle (tar or zip)
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# which will install in the debug or fastdebug subdirectory of the
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# normal product install area.
0756445a735e2df39bf798d8de42ae5dd030aa3bMark Andrews# The install process needs to know what the DEBUG_NAME is, so
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# look for INSTALL_DEBUG_NAME in the install rules.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(MAKE) SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=true all
09344332cf7840e7e219215128fd52ea4c3d6942Mark Andrews @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
09344332cf7840e7e219215128fd52ea4c3d6942Mark Andrews @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(MAKE) $(COMMON_DEBUG_FLAGS) setup build
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# If we have bundle rules, we have a chance here to do a complete cycle
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# build, of production and open build.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# FIXUP: We should create the openjdk source bundle and build that?
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# But how do we reliable create or get at a formal openjdk source tree?
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The one we have needs to be trimmed of built bits and closed dirs.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The repositories might not be available.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The openjdk source bundle is probably not available.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonOPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonOPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonOPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "================================================="
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "================================================="
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington ( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "================================================="
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @$(ECHO) "================================================="
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @$(ECHO) Control build finished: `$(DATE) '+%y-%m-%d %H:%M'`
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Quick jdk verification build
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Quick jdk verification fastdebug build
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Quick deploy verification fastdebug build
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Product build (skip debug builds)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Check target
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewshelp: intro_help target_help variable_help notes_help examples_help
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Intro help message
eaccf5e805405de257b5a4840256c580fefe00e3Mark AndrewsMakefile for the JDK builds (all the JDK). \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Target help
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 WellingtonMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Make variables to print out (description and value)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Make variables that should refer to directories that exist
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Make variables that should refer to files that exist
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Some are windows specific
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# For pattern rules below, so all are treated the same
eaccf5e805405de257b5a4840256c580fefe00e3Mark AndrewsDO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
068a66979695c77359e7a9181bb3f831c965b21cMark AndrewsDO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Complete variable check
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrewsvariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewsvariable_list: $(DO_PRINTVAL_LIST) variable_check
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# Pattern rule for printing out a variable
eaccf5e805405de257b5a4840256c580fefe00e3Mark Andrews# Pattern rule for checking to see if a variable with a directory exists
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @if [ ! -d $($*) ] ; then \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Pattern rule for checking to see if a variable with a file exists
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @if [ ! -f $($*) ] ; then \
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Misc notes on help
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews--- Notes --- \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews- All builds use same output directory unless overridden with \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews \t to use the clean target first. \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews \t builds or previous release JDK builds will work. \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews- The fastest builds have been when the sources and the BOOTDIR are on \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews \t local disk. \n\
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews--- Examples --- \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Source and binary plug bundling
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Cycle build. Build the jdk, use it to build the jdk again.
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews################################################################
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) product_build
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews $(MAKE) ALT_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image product_build
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews################################################################
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews# JPRT rule to build
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews################################################################
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews################################################################
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews################################################################
48b492d73ae5328c5efef4b9e0f22063e0ab058aMark Andrews fastdebug_build debug_build product_build setup \
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# Force target