Makefile revision 0
0N/A#
0N/A# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Sun designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Sun in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A
0N/Aifndef TOPDIR
0N/A TOPDIR:=$(shell \
0N/A if [ -r ./j2se/make/Makefile -o -r ./jdk/make/Makefile ]; then \
0N/A echo "."; \
0N/A else \
0N/A echo "../.."; \
0N/A fi)
0N/Aendif
0N/A
0N/Aifndef CONTROL_TOPDIR
0N/A CONTROL_TOPDIR=$(TOPDIR)/control
0N/A CONTROL_TOPDIR:=$(shell \
0N/A if [ -r $(TOPDIR)/control/make/Makefile ]; then \
0N/A echo "$(TOPDIR)/control"; \
0N/A else \
0N/A echo "$(TOPDIR)"; \
0N/A fi)
0N/Aendif
0N/A
0N/Aifndef JDK_TOPDIR
0N/A JDK_TOPDIR=$(TOPDIR)/jdk
0N/Aendif
0N/Aifndef JDK_MAKE_SHARED_DIR
0N/A JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
0N/Aendif
0N/A
0N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
0N/A
0N/Ainclude ./make/Defs-internal.gmk
0N/A
0N/Aall::
0N/A @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A
0N/A# Rules for sanity checks
0N/Ainclude ./make/sanity-rules.gmk
0N/A
0N/Adev : dev-build
0N/A
0N/Adev-build:
0N/A $(MAKE) DEV_ONLY=true all
0N/Adev-sanity:
0N/A $(MAKE) DEV_ONLY=true sanity
0N/Adev-clobber:
0N/A $(MAKE) DEV_ONLY=true clobber
0N/A
0N/A# Rules for various components
0N/Ainclude ./make/hotspot-rules.gmk
0N/Ainclude ./make/langtools-rules.gmk
0N/Ainclude ./make/corba-rules.gmk
0N/Ainclude ./make/jaxp-rules.gmk
0N/Ainclude ./make/jaxws-rules.gmk
0N/Ainclude ./make/jdk-rules.gmk
0N/Ainclude ./make/install-rules.gmk
0N/Ainclude ./make/sponsors-rules.gmk
0N/Ainclude ./make/deploy-rules.gmk
0N/A
0N/Aall:: setup build
0N/A
0N/Asetup:
0N/A $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
0N/A $(MKDIR) -p $(ABS_OUTPUTDIR)/j2sdk-image
0N/A $(MKDIR) -p $(OUTPUTDIR)-fastdebug/j2sdk-image
0N/A $(MKDIR) -p $(ABS_OUTPUTDIR)-fastdebug/j2sdk-image
0N/A
0N/Abuild:: sanity
0N/A
0N/Aclobber::
0N/A
0N/Aifeq ($(BUILD_LANGTOOLS), true)
0N/A build:: langtools
0N/A clobber:: langtools-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_CORBA), true)
0N/A build:: corba
0N/A clobber:: corba-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_JAXP), true)
0N/A build:: jaxp
0N/A clobber:: jaxp-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_JAXWS), true)
0N/A build:: jaxws
0N/A clobber:: jaxws-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_HOTSPOT), true)
0N/A build:: $(HOTSPOT)
0N/A clobber:: hotspot-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_JDK), true)
0N/A build:: $(JDK_JAVA_EXE)
0N/A clobber:: jdk-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_DEPLOY), true)
0N/A build:: $(DEPLOY)
0N/A clobber:: deploy-clobber
0N/Aendif
0N/A
0N/A#
0N/A# Generic debug build, fastdebug or debug. Needs special handling.
0N/A# Note that debug builds do NOT do INSTALL steps, but must be done
0N/A# after the product build and before the INSTALL step of the product build.
0N/A#
0N/A# DEBUG_NAME is fastdebug or debug
0N/A# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
0N/A# The resulting j2sdk-image is used by the install makefiles to create a
0N/A# debug install bundle jdk-*-debug-** bundle (tar or zip)
0N/A# which will install in the debug or fastdebug subdirectory of the
0N/A# normal product install area.
0N/A# The install process needs to know what the DEBUG_NAME is, so
0N/A# look for INSTALL_DEBUG_NAME in the install rules.
0N/A#
0N/A
0N/ACOMMON_DEBUG_FLAGS= \
0N/A DEBUG_NAME=$(DEBUG_NAME) \
0N/A ALT_OUTPUTDIR=$(_OUTPUTDIR)-$(DEBUG_NAME) \
0N/A NO_DOCS=true
0N/A
0N/Aproduct_build: setup
0N/A @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A $(MAKE) SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=true all
0N/A @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A
0N/Ageneric_debug_build:
0N/A @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A $(MAKE) $(COMMON_DEBUG_FLAGS) setup build
0N/A @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A
0N/Adebug_build: setup
0N/A $(MAKE) DEBUG_NAME=debug generic_debug_build
0N/A
0N/Afastdebug_build: setup
0N/A $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
0N/A
0N/Aifeq ($(SKIP_FASTDEBUG_BUILD), false)
0N/A all:: fastdebug_build
0N/Aendif
0N/A
0N/Aifeq ($(SKIP_DEBUG_BUILD), false)
0N/A all:: debug_build
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_JDK), true)
0N/A ifeq ($(BUNDLE_RULES_AVAILABLE), true)
0N/A all:: openjdk-binary-plugs-bundles
0N/A endif
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_INSTALL), true)
0N/A all :: $(INSTALL)
0N/A clobber:: install-clobber
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_SPONSORS), true)
0N/A all :: $(SPONSORS)
0N/A clobber:: sponsors-clobber
0N/Aendif
0N/A
0N/Aifneq ($(SKIP_COMPARE_IMAGES), true)
0N/A all :: compare-image
0N/Aendif
0N/A
0N/Aifeq ($(SKIP_OPENJDK_BUILD), false)
0N/A ifeq ($(BUILD_JDK), true)
0N/A ifeq ($(BUNDLE_RULES_AVAILABLE), true)
0N/A # If we have bundle rules, we have a chance here to do a complete cycle
0N/A # build, of closed and open build.
0N/A # FIXUP: We should create the openjdk source bundle and build that?
0N/A ABS_OPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
0N/A ABS_OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/openjdk
0N/A OPENJDK_BUILD_NAME_PREFIX \
0N/A = $(J2SDK_NAME)-$(JDK_MKTG_UNDERSCORE_VERSION)-$(MILESTONE)
0N/A OPENJDK_BUILD_NAME_SUFFIX \
0N/A = $(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
0N/A OPENJDK_BUILD_NAME \
0N/A = $(OPENJDK_BUILD_NAME_PREFIX)-openjdk-$(OPENJDK_BUILD_NAME_SUFFIX)
0N/A OPENJDK_BUILD_BINARY_ZIP \
0N/A = $(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
0N/A all :: openjdk-build
0N/A openjdk-build:
0N/A @$(ECHO) " "
0N/A @$(ECHO) "================================================="
0N/A @$(ECHO) "Starting openjdk build"
0N/A @$(ECHO) "================================================="
0N/A @$(ECHO) " "
0N/A $(RM) -r $(ABS_OPENJDK_OUTPUTDIR)
0N/A $(MKDIR) -p $(ABS_OPENJDK_OUTPUTDIR)
0N/A $(MAKE) OPENJDK=true \
0N/A BUILD_LANGTOOLS=$(BUILD_LANGTOOLS) \
0N/A BUILD_CORBA=$(BUILD_CORBA) \
0N/A BUILD_JAXP=$(BUILD_JAXP) \
0N/A BUILD_JAXWS=$(BUILD_JAXWS) \
0N/A BUILD_HOTSPOT=$(BUILD_HOTSPOT) \
0N/A ALT_OUTPUTDIR=$(ABS_OPENJDK_OUTPUTDIR) \
0N/A ALT_BINARY_PLUGS_PATH=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME) \
0N/A ALT_BOOTDIR=$(ABS_OUTPUTDIR)/j2sdk-image \
0N/A ALT_JDK_IMPORT_PATH=$(ABS_OUTPUTDIR)/j2sdk-image \
0N/A product_build
0N/A $(RM) $(OPENJDK_BUILD_BINARY_ZIP)
0N/A ( $(CD) $(ABS_OPENJDK_OUTPUTDIR)/j2sdk-image && \
0N/A $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
0N/A $(RM) -r $(ABS_OPENJDK_OUTPUTDIR)
0N/A endif
0N/A endif
0N/Aendif
0N/A
0N/Aclobber::
0N/A $(RM) -r $(OUTPUTDIR)/*
0N/A $(RM) -r $(OUTPUTDIR)-debug/*
0N/A $(RM) -r $(OUTPUTDIR)-fastdebug/*
0N/A -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
0N/A
0N/Aclean: clobber
0N/A
0N/Aall::
0N/A @$(ECHO) Control build finished: `$(DATE) '+%y-%m-%d %H:%M'`
0N/A
0N/A#
0N/A# Quick jdk verification build
0N/A#
0N/Ajdk_only:
0N/A $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
0N/A
0N/A
0N/A#
0N/A# Quick jdk verification fastdebug build
0N/A#
0N/Ajdk_fastdebug_only:
0N/A $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
0N/A BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
0N/A
0N/A#
0N/A# Quick deploy verification fastdebug build
0N/A#
0N/Adeploy_fastdebug_only:
0N/A $(MAKE) \
0N/A DEBUG_NAME=fastdebug \
0N/A BUILD_HOTSPOT=false \
0N/A BUILD_JDK=false \
0N/A BUILD_LANGTOOLS=false \
0N/A BUILD_CORBA=false \
0N/A BUILD_JAXP=false \
0N/A BUILD_JAXWS=false \
0N/A BUILD_INSTALL=false \
0N/A BUILD_SPONSORS=false \
0N/A generic_debug_build
0N/A
0N/A#
0N/A# Product build (skip debug builds)
0N/A#
0N/Aproduct_only:
0N/A $(MAKE) SKIP_FASTDEBUG_BUILD=true all
0N/A
0N/A#
0N/A# Check target
0N/A#
0N/A
0N/Acheck: variable_check
0N/A
0N/A#
0N/A# Help target
0N/A#
0N/Ahelp: intro_help target_help variable_help notes_help examples_help
0N/A
0N/A# Intro help message
0N/Aintro_help:
0N/A @$(ECHO) "\
0N/AMakefile for the JDK builds (all the JDK). \n\
0N/A"
0N/A
0N/A# Target help
0N/Atarget_help:
0N/A @$(ECHO) "\
0N/A--- Common Targets --- \n\
0N/Aall -- build the core JDK (default target) \n\
0N/Ahelp -- Print out help information \n\
0N/Acheck -- Check make variable values for correctness \n\
0N/Asanity -- Perform detailed sanity checks on system and settings \n\
0N/Afastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
0N/Adebug_build -- build the core JDK in 'debug' mode (-g) \n\
0N/Aclean -- remove all built and imported files \n\
0N/Aclobber -- same as clean \n\
0N/A"
0N/A
0N/A# Variable help (only common ones used by this Makefile)
0N/Avariable_help: variable_help_intro variable_list variable_help_end
0N/Avariable_help_intro:
0N/A @$(ECHO) "--- Common Variables ---"
0N/Avariable_help_end:
0N/A @$(ECHO) " "
0N/A
0N/A# One line descriptions for the variables
0N/AOUTPUTDIR.desc = Output directory
0N/APARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
0N/ASLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
0N/ABOOTDIR.desc = JDK used to boot the build
0N/AJDK_IMPORT_PATH.desc = JDK used to import components of the build
0N/ACOMPILER_PATH.desc = Compiler install directory
0N/ACACERTS_FILE.desc = Location of certificates file
0N/ADEVTOOLS_PATH.desc = Directory containing zip and gnumake
0N/ACUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
0N/ADXSDK_PATH.desc = Root directory of DirectX SDK
0N/AMSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
0N/AMSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
0N/A
0N/A# Make variables to print out (description and value)
0N/AVARIABLE_PRINTVAL_LIST += \
0N/A OUTPUTDIR \
0N/A PARALLEL_COMPILE_JOBS \
0N/A SLASH_JAVA \
0N/A BOOTDIR \
0N/A JDK_IMPORT_PATH \
0N/A COMPILER_PATH \
0N/A CACERTS_FILE \
0N/A DEVTOOLS_PATH
0N/A
0N/A# Make variables that should refer to directories that exist
0N/AVARIABLE_CHECKDIR_LIST += \
0N/A SLASH_JAVA \
0N/A BOOTDIR \
0N/A JDK_IMPORT_PATH \
0N/A COMPILER_PATH \
0N/A DEVTOOLS_PATH
0N/A
0N/A# Make variables that should refer to files that exist
0N/AVARIABLE_CHECKFIL_LIST += \
0N/A CACERTS_FILE
0N/A
0N/A# Some are windows specific
0N/Aifeq ($(PLATFORM), windows)
0N/A
0N/AVARIABLE_PRINTVAL_LIST += \
0N/A DXSDK_PATH \
0N/A MSDEVTOOLS_PATH \
0N/A MSVCRT_DLL_PATH
0N/A
0N/AVARIABLE_CHECKDIR_LIST += \
0N/A DXSDK_PATH \
0N/A MSDEVTOOLS_PATH \
0N/A MSVCRT_DLL_PATH
0N/A
0N/Aendif
0N/A
0N/A# For pattern rules below, so all are treated the same
0N/ADO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
0N/ADO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
0N/ADO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
0N/A
0N/A# Complete variable check
0N/Avariable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
0N/Avariable_list: $(DO_PRINTVAL_LIST) variable_check
0N/A
0N/A# Pattern rule for printing out a variable
0N/A%.printval:
0N/A @$(ECHO) " ALT_$* - $($*.desc)"
0N/A @$(ECHO) " \t $*=$($*)"
0N/A
0N/A# Pattern rule for checking to see if a variable with a directory exists
0N/A%.checkdir:
0N/A @if [ ! -d $($*) ] ; then \
0N/A $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
0N/A fi
0N/A
0N/A# Pattern rule for checking to see if a variable with a file exists
0N/A%.checkfil:
0N/A @if [ ! -f $($*) ] ; then \
0N/A $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
0N/A fi
0N/A
0N/A# Misc notes on help
0N/Anotes_help:
0N/A @$(ECHO) "\
0N/A--- Notes --- \n\
0N/A- All builds use same output directory unless overridden with \n\
0N/A \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
0N/A \t to use the clean target first. \n\
0N/A- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
0N/A \t builds or previous release JDK builds will work. \n\
0N/A- The fastest builds have been when the sources and the BOOTDIR are on \n\
0N/A \t local disk. \n\
0N/A"
0N/A
0N/Aexamples_help:
0N/A @$(ECHO) "\
0N/A--- Examples --- \n\
0N/A $(MAKE) fastdebug_build \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
0N/A $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
0N/A $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
0N/A $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
0N/A"
0N/A
0N/A################################################################
0N/A# Source and binary plug bundling
0N/A################################################################
0N/Aifeq ($(BUNDLE_RULES_AVAILABLE), true)
0N/A include $(BUNDLE_RULES)
0N/Aendif
0N/A
0N/A################################################################
0N/A# Cycle build. Build the jdk, use it to build the jdk again.
0N/A################################################################
0N/A
0N/AABS_BOOTJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
0N/A
0N/Aboot_cycle:
0N/A $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTJDK_OUTPUTDIR) product_build
0N/A $(MAKE) ALT_BOOTDIR=$(ABS_BOOTJDK_OUTPUTDIR)/j2sdk-image product_build
0N/A
0N/A################################################################
0N/A# JPRT rule to build
0N/A################################################################
0N/A
0N/Ainclude ./make/jprt.gmk
0N/A
0N/A################################################################
0N/A# PHONY
0N/A################################################################
0N/A
0N/A.PHONY: all build what clobber insane \
0N/A fastdebug_build debug_build product_build setup \
0N/A dev dev-build dev-sanity dev-clobber
0N/A
0N/A# FIXUP: Old j2se targets
0N/Aj2se_fastdebug_only: jdk_fastdebug_only
0N/Aj2se_only: jdk_only
0N/A