Makefile revision 315
0N/A#
189N/A# Copyright (c) 1995, 2010, Oracle and/or its affiliates. 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
180N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
180N/A# by Oracle 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#
180N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
180N/A# or visit www.oracle.com if you need additional information or have any
180N/A# questions.
0N/A#
0N/A
5N/ABUILD_PARENT_DIRECTORY=.
5N/A
0N/Aifndef TOPDIR
8N/A TOPDIR:=.
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
27N/Adefault: all
0N/A
27N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
27N/Ainclude ./make/Defs-internal.gmk
27N/Ainclude ./make/sanity-rules.gmk
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
286N/Aall:: sanity
27N/A
27N/Aifeq ($(SKIP_FASTDEBUG_BUILD), false)
27N/A all:: fastdebug_build
27N/Aendif
27N/A
27N/Aifeq ($(SKIP_DEBUG_BUILD), false)
27N/A all:: debug_build
27N/Aendif
27N/A
32N/Aall:: all_product_build
32N/A
315N/Aall_product_build::
315N/A
311N/A# Everything for a full product build
311N/Aifeq ($(SKIP_PRODUCT_BUILD), false)
27N/A
27N/A all_product_build:: product_build
27N/A
27N/A ifeq ($(BUILD_INSTALL), true)
27N/A all_product_build:: $(INSTALL)
27N/A clobber:: install-clobber
27N/A endif
311N/A
27N/A ifeq ($(BUILD_SPONSORS), true)
27N/A all_product_build:: $(SPONSORS)
27N/A clobber:: sponsors-clobber
27N/A endif
311N/A
27N/A ifneq ($(SKIP_COMPARE_IMAGES), true)
27N/A all_product_build:: compare-image
27N/A endif
27N/A
27N/Aendif
27N/A
311N/Adefine StartTimer
311N/A $(MKDIR) -p $(BUILDTIMESDIR)
311N/A $(RM) $(BUILDTIMESDIR)/build_time_*
311N/A $(call RecordStartTime,TOTAL)
311N/Aendef
311N/A
311N/Adefine StopTimer
311N/A $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
311N/Aendef
27N/A
189N/A# Generic build of basic repo series
27N/Ageneric_build_repo_series::
27N/A $(MKDIR) -p $(OUTPUTDIR)
27N/A $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
311N/A @$(call StartTimer)
27N/A
27N/Aifeq ($(BUILD_LANGTOOLS), true)
27N/A generic_build_repo_series:: langtools
27N/A clobber:: langtools-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_CORBA), true)
27N/A generic_build_repo_series:: corba
27N/A clobber:: corba-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_JAXP), true)
27N/A generic_build_repo_series:: jaxp
27N/A clobber:: jaxp-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_JAXWS), true)
27N/A generic_build_repo_series:: jaxws
27N/A clobber:: jaxws-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_HOTSPOT), true)
27N/A generic_build_repo_series:: $(HOTSPOT)
27N/A clobber:: hotspot-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_JDK), true)
27N/A generic_build_repo_series:: $(JDK_JAVA_EXE)
27N/A clobber:: jdk-clobber
27N/Aendif
27N/A
27N/Aifeq ($(BUILD_DEPLOY), true)
27N/A generic_build_repo_series:: $(DEPLOY)
27N/A clobber:: deploy-clobber
27N/Aendif
27N/A
311N/Ageneric_build_repo_series::
311N/A @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
311N/A
27N/A# The debug build, fastdebug or debug. Needs special handling.
27N/A# Note that debug builds do NOT do INSTALL steps, but must be done
27N/A# after the product build and before the INSTALL step of the product build.
27N/A#
27N/A# DEBUG_NAME is fastdebug or debug
27N/A# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
27N/A# The resulting j2sdk-image is used by the install makefiles to create a
27N/A# debug install bundle jdk-*-debug-** bundle (tar or zip)
27N/A# which will install in the debug or fastdebug subdirectory of the
27N/A# normal product install area.
27N/A# The install process needs to know what the DEBUG_NAME is, so
27N/A# look for INSTALL_DEBUG_NAME in the install rules.
27N/A#
189N/A# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
189N/A# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
189N/A# not be the same location.
189N/A#
27N/A
27N/A# Location of fresh bootdir output
27N/AABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
27N/AFRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
189N/AFRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
27N/A
27N/Acreate_fresh_product_bootdir: FRC
27N/A $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
142N/A GENERATE_DOCS=false \
27N/A BOOT_CYCLE_SETTINGS= \
27N/A build_product_image
27N/A
27N/Acreate_fresh_debug_bootdir: FRC
27N/A $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
142N/A GENERATE_DOCS=false \
27N/A BOOT_CYCLE_DEBUG_SETTINGS= \
27N/A build_debug_image
27N/A
27N/Acreate_fresh_fastdebug_bootdir: FRC
27N/A $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
142N/A GENERATE_DOCS=false \
27N/A BOOT_CYCLE_DEBUG_SETTINGS= \
27N/A build_fastdebug_image
27N/A
27N/A# Create boot image?
27N/Aifeq ($(SKIP_BOOT_CYCLE),false)
27N/A ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
27N/A DO_BOOT_CYCLE=true
27N/A endif
27N/Aendif
27N/A
311N/A
311N/A
27N/Aifeq ($(DO_BOOT_CYCLE),true)
27N/A
27N/A # Create the bootdir to use in the build
27N/A product_build:: create_fresh_product_bootdir
27N/A debug_build:: create_fresh_debug_bootdir
27N/A fastdebug_build:: create_fresh_fastdebug_bootdir
27N/A
27N/A # Define variables to be used now for the boot jdk
27N/A BOOT_CYCLE_SETTINGS= \
27N/A ALT_BOOTDIR=$(FRESH_BOOTDIR) \
27N/A ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
27N/A BOOT_CYCLE_DEBUG_SETTINGS= \
27N/A ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
27N/A ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
27N/A
27N/Aelse
27N/A
27N/A # Use the supplied ALT_BOOTDIR as the boot
27N/A BOOT_CYCLE_SETTINGS=
27N/A BOOT_CYCLE_DEBUG_SETTINGS=
27N/A
27N/Aendif
27N/A
27N/Abuild_product_image:
27N/A $(MAKE) \
27N/A SKIP_FASTDEBUG_BUILD=true \
27N/A SKIP_DEBUG_BUILD=true \
27N/A $(BOOT_CYCLE_SETTINGS) \
27N/A generic_build_repo_series
27N/A
189N/A# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
189N/A# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
189N/A# not be the same location.
189N/A
27N/Ageneric_debug_build:
27N/A $(MAKE) \
189N/A ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
27N/A DEBUG_NAME=$(DEBUG_NAME) \
142N/A GENERATE_DOCS=false \
27N/A $(BOOT_CYCLE_DEBUG_SETTINGS) \
27N/A generic_build_repo_series
27N/A
27N/Abuild_debug_image:
27N/A $(MAKE) DEBUG_NAME=debug generic_debug_build
27N/A
27N/Abuild_fastdebug_image:
27N/A $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
27N/A
27N/A# Build final image
27N/Aproduct_build:: build_product_image
27N/Adebug_build:: build_debug_image
27N/Afastdebug_build:: build_fastdebug_image
0N/A
311N/Aclobber:: REPORT_BUILD_TIMES=
311N/Aclobber::
0N/A $(RM) -r $(OUTPUTDIR)/*
189N/A $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
189N/A $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
0N/A -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
0N/A
0N/Aclean: clobber
0N/A
27N/A#
27N/A# Dev builds
27N/A#
27N/A
27N/Adev : dev-build
27N/A
27N/Adev-build:
27N/A $(MAKE) DEV_ONLY=true all
27N/Adev-sanity:
27N/A $(MAKE) DEV_ONLY=true sanity
27N/Adev-clobber:
27N/A $(MAKE) DEV_ONLY=true clobber
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/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 += \
289N/A DXSDK_PATH
0N/A
0N/AVARIABLE_CHECKDIR_LIST += \
289N/A DXSDK_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################################################################
276N/A# Source bundling
0N/A################################################################
0N/Aifeq ($(BUNDLE_RULES_AVAILABLE), true)
0N/A include $(BUNDLE_RULES)
0N/Aendif
0N/A
0N/A################################################################
189N/A# rule to test
189N/A################################################################
189N/A
222N/A.NOTPARALLEL: test_run
189N/A
222N/Atest:
222N/A $(MAKE) test_run
222N/A
222N/Atest_run: test_clean test_start test_summary
189N/A
189N/Atest_start:
189N/A @$(ECHO) "Tests started at `$(DATE)`"
189N/A
189N/Atest_clean:
189N/A $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
189N/A
189N/Atest_summary: $(OUTPUTDIR)/test_failures.txt
189N/A @$(ECHO) "#################################################"
189N/A @$(ECHO) "Tests completed at `$(DATE)`"
189N/A @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
189N/A || $(ECHO) "No TEST STATS seen in log" )
189N/A @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
189N/A @$(ECHO) "#################################################"
189N/A @if [ -s $< ] ; then \
189N/A $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
189N/A $(CAT) $<; \
189N/A exit 1; \
189N/A else \
189N/A $(ECHO) "Success! No failures detected"; \
189N/A fi
189N/A
189N/A# Get failure list from log
189N/A$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
189N/A @$(RM) $@
222N/A @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
189N/A
189N/A# Get log file of all tests run
189N/AJDK_TO_TEST := $(shell \
189N/A if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
189N/A $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
189N/A elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
189N/A $(ECHO) "$(ABS_OUTPUTDIR)"; \
189N/A elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
189N/A $(ECHO) "$(PRODUCT_HOME)"; \
189N/A fi \
189N/A)
222N/ATEST_TARGETS=all
189N/A$(OUTPUTDIR)/test_log.txt:
189N/A $(RM) $@
222N/A ( $(CD) test && \
222N/A $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
189N/A ) | tee $@
189N/A
189N/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
222N/A.PHONY: all test test_run test_start test_summary test_clean \
27N/A generic_build_repo_series \
27N/A what clobber insane \
27N/A dev dev-build dev-sanity dev-clobber \
27N/A product_build \
27N/A fastdebug_build \
27N/A debug_build \
27N/A build_product_image \
27N/A build_debug_image \
27N/A build_fastdebug_image \
27N/A create_fresh_product_bootdir \
27N/A create_fresh_debug_bootdir \
27N/A create_fresh_fastdebug_bootdir \
27N/A generic_debug_build
0N/A
5N/A# Force target
5N/AFRC:
5N/A