sanity-rules.gmk revision 278
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################
# SANITY
################################################################
# Only need these sanity rules when not doing a debug build
# this should be the last rule in any target's sanity rule.
@if [ -r $(MESSAGE_FILE) ]; then \
$(ECHO) "" ; \
$(CAT) $(MESSAGE_FILE) ; \
fi
@if [ -r $(WARNING_FILE) ]; then \
$(CAT) $(WARNING_FILE) ; \
fi
$(ECHO) "INSANE mode requested. \n" \
"Sanity will not force a build termination, even with errors.\n" \
"" >> $(ERROR_FILE); \
fi
@if [ -r $(ERROR_FILE) ]; then \
$(ECHO) "Exiting because of the above error(s). \n" \
"">> $(ERROR_FILE); \
fi ; \
$(CAT) $(ERROR_FILE) ; \
exit 1 ; \
fi ; \
fi
@if [ -r $(WARNING_FILE) ]; then \
$(ECHO) "PEDANTIC mode requested. \n" \
"Exiting because of the above warning(s). \n" \
"" >> $(ERROR_FILE); \
$(CAT) $(ERROR_FILE) ; \
exit 1 ; \
fi
@if [ ! -r $(ERROR_FILE) ]; then \
$(ECHO) "Sanity check passed." ; \
fi
@$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \
" should not use this mode, and in fact, \n" \
" it may be removed at any time. If you \n" \
" have build problems as a result of using \n" \
" INSANE mode, then you should not expect \n" \
" assistance from anyone with the problems \n" \
" or consequences you experience. \n" \
"" >> $(WARNING_FILE)
# Get list of environment variables set that we do not want set
# Error message for environment variable set that should not be
%.do_not_set:
@$(ECHO) "ERROR: Your build environment has the variable\n" \
" $* defined. Please unset it and restart your build. \n" \
"" >> $(ERROR_FILE)
# Check the environment variables
environment: $(DO_NOT_SET_LIST:%=%.do_not_set)
@$(ECHO) "WARNING: You are not building the LANGTOOLS sources.\n" \
" Lang tools (javac) will be obtained from \n" \
" the location set in ALT_JDK_IMPORT_PATH. \n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the JAXP sources.\n" \
" The jaxp files will be obtained from \n" \
" the location set in ALT_JDK_IMPORT_PATH. \n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the JAXWS sources.\n" \
" The jaxws files will be obtained from \n" \
" the location set in ALT_JDK_IMPORT_PATH. \n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the CORBA sources.\n" \
" The corba files will be obtained from \n" \
" the location set in ALT_JDK_IMPORT_PATH. \n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the HOTSPOT sources.\n" \
" Hotspot libs will be obtained from \n" \
" the location set in ALT_HOTSPOT_IMPORT_PATH. \n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the JDK sources.\n" \
" This will result in a development-only\n" \
" build of the JDK , lacking the jdk binaries.\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the DEPLOY sources.\n" \
" This will result in a development-only\n" \
" build of the JDK, lacking the plugin and javaws binaries.\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the INSTALL sources.\n" \
" This will result in a development-only\n" \
" build of the JDK, lacking the installation bundles\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: You are not building the SPONSORS sources.\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: This build does not include running javadoc.\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \
" defined. This will result in a development-only\n" \
" build of the JDK, lacking the install images\n" \
" and bundles.\n" \
"" >> $(WARNING_FILE)
@$(ECHO) "WARNING: Your build environment has the variable DEV_ONLY\n" \
" defined. This will result in a development-only\n" \
" build of the JDK, lacking the documentation\n" \
" build and installation bundles.\n" \
"" >> $(WARNING_FILE)
######################################################
# if specified, ALT_BOOTDIR must point to non-relative path if set
######################################################
$(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \
" not a Relative Path Name. \n" \
" The current value of ALT_BOOTDIR is \n" \
" Please fix this and continue your build. \n" \
"" >> $(ERROR_FILE) ; \
fi
######################################################
# BOOTDIR must point to a valid JDK.
######################################################
JAVA_VERSION := $(shell $(BOOTDIR)/bin/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }')
$(ECHO) "ERROR: Your BOOTDIR environment variable does not point \n" \
" to a valid JDK for bootstrapping this build. \n" \
" Please update your ALT_BOOTDIR setting and start your build again. \n" \
"" >> $(ERROR_FILE) ; \
fi \
else \
$(ECHO) "ERROR: BOOTDIR does not point to a valid Java 2 SDK \n" \
" Check that you have access to \n" \
"" >> $(ERROR_FILE) ; \
fi
######################################################
# dump out the variable settings...
######################################################
settings::
else