duke@2: # jjg@354: # Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. duke@2: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@2: # duke@2: # This code is free software; you can redistribute it and/or modify it duke@2: # under the terms of the GNU General Public License version 2 only, as ohair@182: # published by the Free Software Foundation. Oracle designates this duke@2: # particular file as subject to the "Classpath" exception as provided ohair@182: # by Oracle in the LICENSE file that accompanied this code. duke@2: # duke@2: # This code is distributed in the hope that it will be useful, but WITHOUT duke@2: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@2: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@2: # version 2 for more details (a copy is included in the LICENSE file that duke@2: # accompanied this code). duke@2: # duke@2: # You should have received a copy of the GNU General Public License version duke@2: # 2 along with this work; if not, write to the Free Software Foundation, duke@2: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@2: # ohair@182: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@182: # or visit www.oracle.com if you need additional information or have any ohair@182: # questions. duke@2: # duke@2: duke@2: ################################################################ duke@2: # SANITY duke@2: ################################################################ duke@2: duke@2: sanity:: pre-sanity settings insane environment duke@2: duke@2: ifeq ($(BUILD_HOTSPOT), true) duke@2: sanity:: hotspot-sanity duke@2: endif duke@2: duke@2: ifeq ($(BUILD_DEPLOY), true) duke@2: sanity:: deploy-sanity duke@2: endif duke@2: duke@2: ifeq ($(BUILD_JDK), true) mduigou@408: sanity:: jdk-sanity duke@2: endif duke@2: duke@2: # Only need these sanity rules when not doing a debug build duke@2: ifeq ($(DEBUG_NAME),) duke@2: duke@2: ifeq ($(BUILD_INSTALL), true) duke@2: sanity:: install-sanity duke@2: endif duke@2: duke@2: ifeq ($(BUILD_SPONSORS), true) duke@2: sanity:: sponsors-sanity duke@2: endif duke@2: duke@2: endif duke@2: duke@2: sanity:: post-sanity duke@2: jjg@354: source-sanity : pre-sanity post-sanity duke@2: duke@2: $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE): duke@2: @$(prep-target) duke@2: duke@2: purge-sanity: $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE) duke@2: -@$(RM) $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE) duke@2: mduigou@408: pre-sanity: purge-sanity duke@2: duke@2: # this should be the last rule in any target's sanity rule. duke@2: post-sanity post-sanity-hotspot post-sanity-jdk post-sanity-install post-sanity-deploy: duke@2: @if [ -r $(MESSAGE_FILE) ]; then \ duke@2: $(ECHO) "" ; \ duke@2: $(CAT) $(MESSAGE_FILE) ; \ duke@2: fi duke@2: @if [ -r $(WARNING_FILE) ]; then \ duke@2: $(CAT) $(WARNING_FILE) ; \ duke@2: fi duke@2: @if [ "x$(INSANE)" != x ]; then \ duke@2: $(ECHO) "INSANE mode requested. \n" \ duke@2: "Sanity will not force a build termination, even with errors.\n" \ duke@2: "" >> $(ERROR_FILE); \ duke@2: fi duke@2: @if [ -r $(ERROR_FILE) ]; then \ duke@2: if [ "x$(INSANE)" = x ]; then \ duke@2: $(ECHO) "Exiting because of the above error(s). \n" \ duke@2: "">> $(ERROR_FILE); \ duke@2: fi ; \ duke@2: $(CAT) $(ERROR_FILE) ; \ duke@2: if [ "x$(INSANE)" = x ]; then \ duke@2: exit 1 ; \ duke@2: fi ; \ duke@2: fi duke@2: ifdef PEDANTIC duke@2: @if [ -r $(WARNING_FILE) ]; then \ duke@2: $(ECHO) "PEDANTIC mode requested. \n" \ duke@2: "Exiting because of the above warning(s). \n" \ duke@2: "" >> $(ERROR_FILE); \ duke@2: $(CAT) $(ERROR_FILE) ; \ duke@2: exit 1 ; \ duke@2: fi duke@2: endif duke@2: @if [ ! -r $(ERROR_FILE) ]; then \ duke@2: $(ECHO) "Sanity check passed." ; \ duke@2: fi duke@2: duke@2: insane: duke@2: ifdef INSANE duke@2: @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \ duke@2: " should not use this mode, and in fact, \n" \ duke@2: " it may be removed at any time. If you \n" \ duke@2: " have build problems as a result of using \n" \ duke@2: " INSANE mode, then you should not expect \n" \ duke@2: " assistance from anyone with the problems \n" \ duke@2: " or consequences you experience. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: duke@2: # Get list of environment variables set that we do not want set duke@2: ifdef ALT_HOTSPOT_SERVER_PATH duke@2: DO_NOT_SET_LIST += ALT_HOTSPOT_SERVER_PATH duke@2: endif duke@2: ifdef ALT_HOTSPOT_CLIENT_PATH duke@2: DO_NOT_SET_LIST += ALT_HOTSPOT_CLIENT_PATH duke@2: endif duke@2: ifdef ALT_HOTSPOT_LIB_PATH duke@2: DO_NOT_SET_LIST += ALT_HOTSPOT_LIB_PATH duke@2: endif duke@2: duke@2: # Error message for environment variable set that should not be duke@2: %.do_not_set: duke@2: @$(ECHO) "ERROR: Your build environment has the variable\n" \ duke@2: " $* defined. Please unset it and restart your build. \n" \ duke@2: "" >> $(ERROR_FILE) duke@2: mduigou@408: # Check the environment variables duke@2: environment: $(DO_NOT_SET_LIST:%=%.do_not_set) duke@2: ifeq ($(LANGTOOLS_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_LANGTOOLS), true) duke@2: @$(ECHO) "WARNING: You are not building the LANGTOOLS sources.\n" \ duke@2: " Lang tools (javac) will be obtained from \n" \ duke@2: " the location set in ALT_JDK_IMPORT_PATH. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(JAXP_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_JAXP), true) duke@2: @$(ECHO) "WARNING: You are not building the JAXP sources.\n" \ duke@2: " The jaxp files will be obtained from \n" \ duke@2: " the location set in ALT_JDK_IMPORT_PATH. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(JAXWS_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_JAXWS), true) duke@2: @$(ECHO) "WARNING: You are not building the JAXWS sources.\n" \ duke@2: " The jaxws files will be obtained from \n" \ duke@2: " the location set in ALT_JDK_IMPORT_PATH. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(CORBA_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_CORBA), true) duke@2: @$(ECHO) "WARNING: You are not building the CORBA sources.\n" \ duke@2: " The corba files will be obtained from \n" \ duke@2: " the location set in ALT_JDK_IMPORT_PATH. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(HOTSPOT_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_HOTSPOT), true) duke@2: @$(ECHO) "WARNING: You are not building the HOTSPOT sources.\n" \ duke@2: " Hotspot libs will be obtained from \n" \ duke@2: " the location set in ALT_HOTSPOT_IMPORT_PATH. \n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(JDK_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_JDK), true) duke@2: @$(ECHO) "WARNING: You are not building the JDK sources.\n" \ duke@2: " This will result in a development-only\n" \ duke@2: " build of the JDK , lacking the jdk binaries.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif jjg@645: ifeq ($(NASHORN_SRC_AVAILABLE), true) jjg@645: ifneq ($(BUILD_NASHORN), true) jjg@645: @$(ECHO) "WARNING: You are not building the NASHORN sources.\n" \ jjg@645: " The nashorn files will be obtained from \n" \ jjg@645: " the location set in ALT_JDK_IMPORT_PATH. \n" \ jjg@645: "" >> $(WARNING_FILE) jjg@645: endif jjg@645: endif duke@2: ifeq ($(DEPLOY_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_DEPLOY), true) duke@2: @$(ECHO) "WARNING: You are not building the DEPLOY sources.\n" \ duke@2: " This will result in a development-only\n" \ duke@2: " build of the JDK, lacking the plugin and javaws binaries.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(INSTALL_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_INSTALL), true) duke@2: @$(ECHO) "WARNING: You are not building the INSTALL sources.\n" \ duke@2: " This will result in a development-only\n" \ duke@2: " build of the JDK, lacking the installation bundles\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif duke@2: ifeq ($(SPONSORS_SRC_AVAILABLE), true) duke@2: ifneq ($(BUILD_SPONSORS), true) duke@2: @$(ECHO) "WARNING: You are not building the SPONSORS sources.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: endif ohair@144: ifeq ($(GENERATE_DOCS),false) mduigou@408: @$(ECHO) "WARNING: This build does not include generating javadoc.\n" \ mduigou@408: "" >> $(WARNING_FILE) mduigou@408: endif mduigou@408: ifdef NO_DEMOS mduigou@408: @$(ECHO) "WARNING: This build and any install images will not include demos.\n" \ mduigou@408: "" >> $(WARNING_FILE) mduigou@408: endif mduigou@408: ifdef NO_SAMPLES mduigou@408: @$(ECHO) "WARNING: This build and any install images will not include samples.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: ifdef NO_IMAGES duke@2: @$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \ duke@2: " defined. This will result in a development-only\n" \ duke@2: " build of the JDK, lacking the install images\n" \ duke@2: " and bundles.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: ifdef DEV_ONLY duke@2: @$(ECHO) "WARNING: Your build environment has the variable DEV_ONLY\n" \ duke@2: " defined. This will result in a development-only\n" \ duke@2: " build of the JDK, lacking the documentation\n" \ duke@2: " build and installation bundles.\n" \ duke@2: "" >> $(WARNING_FILE) duke@2: endif duke@2: duke@2: ###################################################### duke@2: # dump out the variable settings... duke@2: ###################################################### duke@2: ifneq ($(PLATFORM), windows) duke@2: ifndef HOSTNAME duke@2: HOSTNAME := $(shell hostname) duke@2: endif duke@2: endif mduigou@408: settings:: duke@2: @$(ECHO) "Build Machine Information:" >> $(MESSAGE_FILE) duke@2: ifeq ($(PLATFORM), windows) duke@2: @$(ECHO) " build machine = $(COMPUTERNAME)" >> $(MESSAGE_FILE) duke@2: else duke@2: @$(ECHO) " build machine = $(HOSTNAME)" >> $(MESSAGE_FILE) duke@2: endif duke@2: @$(ECHO) "" >> $(MESSAGE_FILE) duke@2: @$(ECHO) "Build Directory Structure:" >> $(MESSAGE_FILE) duke@2: @$(ECHO) " CWD = `$(PWD)`" >> $(MESSAGE_FILE) duke@2: @$(ECHO) " TOPDIR = $(TOPDIR)" >> $(MESSAGE_FILE) duke@2: ifeq ($(LANGTOOLS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " LANGTOOLS_TOPDIR = $(LANGTOOLS_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JAXP_SRC_AVAILABLE), true) duke@2: @$(ECHO) " JAXP_TOPDIR = $(JAXP_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JAXWS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " JAXWS_TOPDIR = $(JAXWS_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(CORBA_SRC_AVAILABLE), true) duke@2: @$(ECHO) " CORBA_TOPDIR = $(CORBA_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(HOTSPOT_SRC_AVAILABLE), true) duke@2: @$(ECHO) " HOTSPOT_TOPDIR = $(HOTSPOT_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JDK_SRC_AVAILABLE), true) duke@2: @$(ECHO) " JDK_TOPDIR = $(JDK_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif jjg@645: ifeq ($(NASHORN_SRC_AVAILABLE), true) jjg@645: @$(ECHO) " NASHORN_TOPDIR = $(NASHORN_TOPDIR)" >> $(MESSAGE_FILE) jjg@645: endif duke@2: ifeq ($(DEPLOY_SRC_AVAILABLE), true) duke@2: @$(ECHO) " DEPLOY_TOPDIR = $(DEPLOY_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(INSTALL_SRC_AVAILABLE), true) duke@2: @$(ECHO) " INSTALL_TOPDIR = $(INSTALL_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(SPONSORS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " SPONSORS_TOPDIR = $(SPONSORS_TOPDIR)" >> $(MESSAGE_FILE) duke@2: endif duke@2: @$(ECHO) "" >> $(MESSAGE_FILE) duke@2: ifneq ($(SKIP_COMPARE_IMAGES), true) duke@2: @$(ECHO) "External File/Binary Locations:" >> $(MESSAGE_FILE) duke@2: @$(ECHO) " PREVIOUS_JRE_BUNDLE = $(PREVIOUS_JRE_BUNDLE) " >> $(MESSAGE_FILE) duke@2: @$(ECHO) " PREVIOUS_JDK_BUNDLE = $(PREVIOUS_JDK_BUNDLE) " >> $(MESSAGE_FILE) duke@2: @$(ECHO) "" >> $(MESSAGE_FILE) duke@2: endif duke@2: @$(ECHO) "Build Directives:" >> $(MESSAGE_FILE) duke@2: ifeq ($(LANGTOOLS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_LANGTOOLS = $(BUILD_LANGTOOLS) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JAXP_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_JAXP = $(BUILD_JAXP) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JAXWS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_JAXWS = $(BUILD_JAXWS) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(CORBA_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_CORBA = $(BUILD_CORBA) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(HOTSPOT_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_HOTSPOT = $(BUILD_HOTSPOT) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(JDK_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_JDK = $(BUILD_JDK) " >> $(MESSAGE_FILE) duke@2: endif jjg@645: ifeq ($(NASHORN_SRC_AVAILABLE), true) jjg@645: @$(ECHO) " BUILD_NASHORN = $(BUILD_NASHORN) " >> $(MESSAGE_FILE) jjg@645: endif duke@2: ifeq ($(DEPLOY_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_DEPLOY = $(BUILD_DEPLOY) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(INSTALL_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_INSTALL = $(BUILD_INSTALL) " >> $(MESSAGE_FILE) duke@2: endif duke@2: ifeq ($(SPONSORS_SRC_AVAILABLE), true) duke@2: @$(ECHO) " BUILD_SPONSORS = $(BUILD_SPONSORS) " >> $(MESSAGE_FILE) duke@2: endif aph@80: @$(ECHO) " DEBUG_CLASSFILES = $(DEBUG_CLASSFILES) " >> $(MESSAGE_FILE) aph@80: @$(ECHO) " DEBUG_BINARIES = $(DEBUG_BINARIES) " >> $(MESSAGE_FILE) duke@2: @$(ECHO) "" >> $(MESSAGE_FILE) duke@2: duke@2: .PHONY: sanity settings pre-sanity insane \ duke@2: post-sanity post-sanity-hotspot post-sanity-jdk \ duke@2: post-sanity-install post-sanity-deploy \ jjg@354: environment