0N/A#
278N/A# Copyright (c) 2001, 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
0N/A################################################################
0N/A# SANITY
0N/A################################################################
0N/A
0N/Asanity:: pre-sanity settings insane environment
0N/A
0N/Aifeq ($(BUILD_HOTSPOT), true)
0N/A sanity:: hotspot-sanity
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_DEPLOY), true)
0N/A sanity:: deploy-sanity
0N/Aendif
0N/A
0N/Aifeq ($(BUILD_JDK), true)
0N/A sanity:: jdk-sanity
0N/Aendif
0N/A
0N/A# Only need these sanity rules when not doing a debug build
0N/Aifeq ($(DEBUG_NAME),)
0N/A
0N/A ifeq ($(BUILD_INSTALL), true)
0N/A sanity:: install-sanity
0N/A endif
0N/A
0N/A ifeq ($(BUILD_SPONSORS), true)
0N/A sanity:: sponsors-sanity
0N/A endif
0N/A
0N/Aendif
0N/A
0N/Asanity:: post-sanity
0N/A
0N/Asource-sanity : pre-sanity alt_bootdir bootdir post-sanity
0N/A
0N/A$(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE):
0N/A @$(prep-target)
0N/A
0N/Apurge-sanity: $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
0N/A -@$(RM) $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
0N/A
0N/Apre-sanity: purge-sanity
0N/A
0N/A# this should be the last rule in any target's sanity rule.
0N/Apost-sanity post-sanity-hotspot post-sanity-jdk post-sanity-install post-sanity-deploy:
0N/A @if [ -r $(MESSAGE_FILE) ]; then \
0N/A $(ECHO) "" ; \
0N/A $(CAT) $(MESSAGE_FILE) ; \
0N/A fi
0N/A @if [ -r $(WARNING_FILE) ]; then \
0N/A $(CAT) $(WARNING_FILE) ; \
0N/A fi
0N/A @if [ "x$(INSANE)" != x ]; then \
0N/A $(ECHO) "INSANE mode requested. \n" \
0N/A "Sanity will not force a build termination, even with errors.\n" \
0N/A "" >> $(ERROR_FILE); \
0N/A fi
0N/A @if [ -r $(ERROR_FILE) ]; then \
0N/A if [ "x$(INSANE)" = x ]; then \
0N/A $(ECHO) "Exiting because of the above error(s). \n" \
0N/A "">> $(ERROR_FILE); \
0N/A fi ; \
0N/A $(CAT) $(ERROR_FILE) ; \
0N/A if [ "x$(INSANE)" = x ]; then \
0N/A exit 1 ; \
0N/A fi ; \
0N/A fi
0N/Aifdef PEDANTIC
0N/A @if [ -r $(WARNING_FILE) ]; then \
0N/A $(ECHO) "PEDANTIC mode requested. \n" \
0N/A "Exiting because of the above warning(s). \n" \
0N/A "" >> $(ERROR_FILE); \
0N/A $(CAT) $(ERROR_FILE) ; \
0N/A exit 1 ; \
0N/A fi
0N/Aendif
0N/A @if [ ! -r $(ERROR_FILE) ]; then \
0N/A $(ECHO) "Sanity check passed." ; \
0N/A fi
0N/A
0N/Ainsane:
0N/Aifdef INSANE
0N/A @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \
0N/A " should not use this mode, and in fact, \n" \
0N/A " it may be removed at any time. If you \n" \
0N/A " have build problems as a result of using \n" \
0N/A " INSANE mode, then you should not expect \n" \
0N/A " assistance from anyone with the problems \n" \
0N/A " or consequences you experience. \n" \
0N/A "" >> $(WARNING_FILE)
0N/Aendif
0N/A
0N/A# Get list of environment variables set that we do not want set
0N/Aifdef ALT_HOTSPOT_SERVER_PATH
0N/A DO_NOT_SET_LIST += ALT_HOTSPOT_SERVER_PATH
0N/Aendif
0N/Aifdef ALT_HOTSPOT_CLIENT_PATH
0N/A DO_NOT_SET_LIST += ALT_HOTSPOT_CLIENT_PATH
0N/Aendif
0N/Aifdef ALT_HOTSPOT_LIB_PATH
0N/A DO_NOT_SET_LIST += ALT_HOTSPOT_LIB_PATH
0N/Aendif
0N/A
0N/A# Error message for environment variable set that should not be
0N/A%.do_not_set:
0N/A @$(ECHO) "ERROR: Your build environment has the variable\n" \
0N/A " $* defined. Please unset it and restart your build. \n" \
0N/A "" >> $(ERROR_FILE)
0N/A
0N/A# Check the environment variables
0N/Aenvironment: $(DO_NOT_SET_LIST:%=%.do_not_set)
0N/Aifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_LANGTOOLS), true)
0N/A @$(ECHO) "WARNING: You are not building the LANGTOOLS sources.\n" \
0N/A " Lang tools (javac) will be obtained from \n" \
0N/A " the location set in ALT_JDK_IMPORT_PATH. \n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(JAXP_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_JAXP), true)
0N/A @$(ECHO) "WARNING: You are not building the JAXP sources.\n" \
0N/A " The jaxp files will be obtained from \n" \
0N/A " the location set in ALT_JDK_IMPORT_PATH. \n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(JAXWS_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_JAXWS), true)
0N/A @$(ECHO) "WARNING: You are not building the JAXWS sources.\n" \
0N/A " The jaxws files will be obtained from \n" \
0N/A " the location set in ALT_JDK_IMPORT_PATH. \n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(CORBA_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_CORBA), true)
0N/A @$(ECHO) "WARNING: You are not building the CORBA sources.\n" \
0N/A " The corba files will be obtained from \n" \
0N/A " the location set in ALT_JDK_IMPORT_PATH. \n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(HOTSPOT_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_HOTSPOT), true)
0N/A @$(ECHO) "WARNING: You are not building the HOTSPOT sources.\n" \
0N/A " Hotspot libs will be obtained from \n" \
0N/A " the location set in ALT_HOTSPOT_IMPORT_PATH. \n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(JDK_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_JDK), true)
0N/A @$(ECHO) "WARNING: You are not building the JDK sources.\n" \
0N/A " This will result in a development-only\n" \
0N/A " build of the JDK , lacking the jdk binaries.\n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(DEPLOY_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_DEPLOY), true)
0N/A @$(ECHO) "WARNING: You are not building the DEPLOY sources.\n" \
0N/A " This will result in a development-only\n" \
0N/A " build of the JDK, lacking the plugin and javaws binaries.\n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(INSTALL_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_INSTALL), true)
0N/A @$(ECHO) "WARNING: You are not building the INSTALL sources.\n" \
0N/A " This will result in a development-only\n" \
0N/A " build of the JDK, lacking the installation bundles\n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
0N/Aifeq ($(SPONSORS_SRC_AVAILABLE), true)
0N/A ifneq ($(BUILD_SPONSORS), true)
0N/A @$(ECHO) "WARNING: You are not building the SPONSORS sources.\n" \
0N/A "" >> $(WARNING_FILE)
0N/A endif
0N/Aendif
142N/Aifeq ($(GENERATE_DOCS),false)
142N/A @$(ECHO) "WARNING: This build does not include running javadoc.\n" \
0N/A "" >> $(WARNING_FILE)
0N/Aendif
0N/Aifdef NO_IMAGES
0N/A @$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \
0N/A " defined. This will result in a development-only\n" \
0N/A " build of the JDK, lacking the install images\n" \
0N/A " and bundles.\n" \
0N/A "" >> $(WARNING_FILE)
0N/Aendif
0N/Aifdef DEV_ONLY
0N/A @$(ECHO) "WARNING: Your build environment has the variable DEV_ONLY\n" \
0N/A " defined. This will result in a development-only\n" \
0N/A " build of the JDK, lacking the documentation\n" \
0N/A " build and installation bundles.\n" \
0N/A "" >> $(WARNING_FILE)
0N/Aendif
0N/A
0N/A######################################################
0N/A# if specified, ALT_BOOTDIR must point to non-relative path if set
0N/A######################################################
0N/Aalt_bootdir:
0N/Aifdef ALT_BOOTDIR
198N/A @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
0N/A $(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \
0N/A " not a Relative Path Name. \n" \
0N/A " The current value of ALT_BOOTDIR is \n" \
0N/A " $(ALT_BOOTDIR) \n" \
0N/A " Please fix this and continue your build. \n" \
0N/A "" >> $(ERROR_FILE) ; \
0N/A fi
0N/Aendif
0N/A
0N/A######################################################
0N/A# BOOTDIR must point to a valid JDK.
0N/A######################################################
0N/AJAVA_VERSION := $(shell $(BOOTDIR)/bin/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }')
0N/AJAVA_VERSION_OK := $(shell $(ECHO) $(JAVA_VERSION) | $(EGREP) -c '^1.[5-6].[0-9]')
0N/Abootdir:
0N/A @if [ -x $(BOOTDIR)/bin/java$(EXE_SUFFIX) ]; then \
0N/A if [ $(JAVA_VERSION_OK) -ne 1 ]; then \
0N/A $(ECHO) "ERROR: Your BOOTDIR environment variable does not point \n" \
0N/A " to a valid JDK for bootstrapping this build. \n" \
0N/A " A JDK $(JDK_MKTG_VERSION) source generation process must be \n" \
0N/A " bootstrapped using JDK $(PREVIOUS_JDK_VERSION) fcs (or later). \n" \
0N/A " Apparently, your bootstrap JDK is version $(JAVA_VERSION) \n" \
0N/A " Please update your ALT_BOOTDIR setting and start your build again. \n" \
0N/A "" >> $(ERROR_FILE) ; \
0N/A fi \
0N/A else \
0N/A $(ECHO) "ERROR: BOOTDIR does not point to a valid Java 2 SDK \n" \
0N/A " Check that you have access to \n" \
0N/A " $(BOOTDIR)/bin/java$(EXE_SUFFIX) \n" \
0N/A " and/or check your value of ALT_BOOTDIR. \n" \
0N/A "" >> $(ERROR_FILE) ; \
0N/A fi
0N/A
0N/A######################################################
0N/A# dump out the variable settings...
0N/A######################################################
0N/Aifneq ($(PLATFORM), windows)
0N/A ifndef HOSTNAME
0N/A HOSTNAME := $(shell hostname)
0N/A endif
0N/Aendif
0N/Asettings::
0N/A @$(ECHO) "Build Machine Information:" >> $(MESSAGE_FILE)
0N/Aifeq ($(PLATFORM), windows)
0N/A @$(ECHO) " build machine = $(COMPUTERNAME)" >> $(MESSAGE_FILE)
0N/Aelse
0N/A @$(ECHO) " build machine = $(HOSTNAME)" >> $(MESSAGE_FILE)
0N/Aendif
0N/A @$(ECHO) "" >> $(MESSAGE_FILE)
0N/A @$(ECHO) "Build Directory Structure:" >> $(MESSAGE_FILE)
0N/A @$(ECHO) " CWD = `$(PWD)`" >> $(MESSAGE_FILE)
0N/A @$(ECHO) " TOPDIR = $(TOPDIR)" >> $(MESSAGE_FILE)
0N/Aifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " LANGTOOLS_TOPDIR = $(LANGTOOLS_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JAXP_SRC_AVAILABLE), true)
0N/A @$(ECHO) " JAXP_TOPDIR = $(JAXP_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JAXWS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " JAXWS_TOPDIR = $(JAXWS_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(CORBA_SRC_AVAILABLE), true)
0N/A @$(ECHO) " CORBA_TOPDIR = $(CORBA_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(HOTSPOT_SRC_AVAILABLE), true)
0N/A @$(ECHO) " HOTSPOT_TOPDIR = $(HOTSPOT_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JDK_SRC_AVAILABLE), true)
0N/A @$(ECHO) " JDK_TOPDIR = $(JDK_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(DEPLOY_SRC_AVAILABLE), true)
0N/A @$(ECHO) " DEPLOY_TOPDIR = $(DEPLOY_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(INSTALL_SRC_AVAILABLE), true)
0N/A @$(ECHO) " INSTALL_TOPDIR = $(INSTALL_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(SPONSORS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " SPONSORS_TOPDIR = $(SPONSORS_TOPDIR)" >> $(MESSAGE_FILE)
0N/Aendif
0N/A @$(ECHO) "" >> $(MESSAGE_FILE)
0N/Aifneq ($(SKIP_COMPARE_IMAGES), true)
0N/A @$(ECHO) "External File/Binary Locations:" >> $(MESSAGE_FILE)
0N/A @$(ECHO) " PREVIOUS_JRE_BUNDLE = $(PREVIOUS_JRE_BUNDLE) " >> $(MESSAGE_FILE)
0N/A @$(ECHO) " PREVIOUS_JDK_BUNDLE = $(PREVIOUS_JDK_BUNDLE) " >> $(MESSAGE_FILE)
0N/A @$(ECHO) "" >> $(MESSAGE_FILE)
0N/Aendif
0N/A @$(ECHO) "Build Directives:" >> $(MESSAGE_FILE)
0N/Aifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_LANGTOOLS = $(BUILD_LANGTOOLS) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JAXP_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_JAXP = $(BUILD_JAXP) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JAXWS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_JAXWS = $(BUILD_JAXWS) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(CORBA_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_CORBA = $(BUILD_CORBA) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(HOTSPOT_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_HOTSPOT = $(BUILD_HOTSPOT) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(JDK_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_JDK = $(BUILD_JDK) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(DEPLOY_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_DEPLOY = $(BUILD_DEPLOY) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(INSTALL_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_INSTALL = $(BUILD_INSTALL) " >> $(MESSAGE_FILE)
0N/Aendif
0N/Aifeq ($(SPONSORS_SRC_AVAILABLE), true)
0N/A @$(ECHO) " BUILD_SPONSORS = $(BUILD_SPONSORS) " >> $(MESSAGE_FILE)
0N/Aendif
78N/A @$(ECHO) " DEBUG_CLASSFILES = $(DEBUG_CLASSFILES) " >> $(MESSAGE_FILE)
78N/A @$(ECHO) " DEBUG_BINARIES = $(DEBUG_BINARIES) " >> $(MESSAGE_FILE)
0N/A @$(ECHO) "" >> $(MESSAGE_FILE)
0N/A
0N/A.PHONY: sanity settings pre-sanity insane \
0N/A post-sanity post-sanity-hotspot post-sanity-jdk \
0N/A post-sanity-install post-sanity-deploy \
142N/A alt_bootdir bootdir environment