make/sanity-rules.gmk

Mon, 25 Feb 2013 15:08:11 -0800

author
jjg
date
Mon, 25 Feb 2013 15:08:11 -0800
changeset 645
5b0b6ef58dbf
parent 408
28f2fe471725
permissions
-rw-r--r--

8008914: Add nashorn to the tl build
Reviewed-by: mr, tbell, jjh
Contributed-by: erik.joelsson@oracle.com, james.laskey@oracle.com

duke@2 1 #
jjg@354 2 # Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
duke@2 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@2 4 #
duke@2 5 # This code is free software; you can redistribute it and/or modify it
duke@2 6 # under the terms of the GNU General Public License version 2 only, as
ohair@182 7 # published by the Free Software Foundation. Oracle designates this
duke@2 8 # particular file as subject to the "Classpath" exception as provided
ohair@182 9 # by Oracle in the LICENSE file that accompanied this code.
duke@2 10 #
duke@2 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@2 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@2 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@2 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@2 15 # accompanied this code).
duke@2 16 #
duke@2 17 # You should have received a copy of the GNU General Public License version
duke@2 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@2 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@2 20 #
ohair@182 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@182 22 # or visit www.oracle.com if you need additional information or have any
ohair@182 23 # questions.
duke@2 24 #
duke@2 25
duke@2 26 ################################################################
duke@2 27 # SANITY
duke@2 28 ################################################################
duke@2 29
duke@2 30 sanity:: pre-sanity settings insane environment
duke@2 31
duke@2 32 ifeq ($(BUILD_HOTSPOT), true)
duke@2 33 sanity:: hotspot-sanity
duke@2 34 endif
duke@2 35
duke@2 36 ifeq ($(BUILD_DEPLOY), true)
duke@2 37 sanity:: deploy-sanity
duke@2 38 endif
duke@2 39
duke@2 40 ifeq ($(BUILD_JDK), true)
mduigou@408 41 sanity:: jdk-sanity
duke@2 42 endif
duke@2 43
duke@2 44 # Only need these sanity rules when not doing a debug build
duke@2 45 ifeq ($(DEBUG_NAME),)
duke@2 46
duke@2 47 ifeq ($(BUILD_INSTALL), true)
duke@2 48 sanity:: install-sanity
duke@2 49 endif
duke@2 50
duke@2 51 ifeq ($(BUILD_SPONSORS), true)
duke@2 52 sanity:: sponsors-sanity
duke@2 53 endif
duke@2 54
duke@2 55 endif
duke@2 56
duke@2 57 sanity:: post-sanity
duke@2 58
jjg@354 59 source-sanity : pre-sanity post-sanity
duke@2 60
duke@2 61 $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE):
duke@2 62 @$(prep-target)
duke@2 63
duke@2 64 purge-sanity: $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
duke@2 65 -@$(RM) $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
duke@2 66
mduigou@408 67 pre-sanity: purge-sanity
duke@2 68
duke@2 69 # this should be the last rule in any target's sanity rule.
duke@2 70 post-sanity post-sanity-hotspot post-sanity-jdk post-sanity-install post-sanity-deploy:
duke@2 71 @if [ -r $(MESSAGE_FILE) ]; then \
duke@2 72 $(ECHO) "" ; \
duke@2 73 $(CAT) $(MESSAGE_FILE) ; \
duke@2 74 fi
duke@2 75 @if [ -r $(WARNING_FILE) ]; then \
duke@2 76 $(CAT) $(WARNING_FILE) ; \
duke@2 77 fi
duke@2 78 @if [ "x$(INSANE)" != x ]; then \
duke@2 79 $(ECHO) "INSANE mode requested. \n" \
duke@2 80 "Sanity will not force a build termination, even with errors.\n" \
duke@2 81 "" >> $(ERROR_FILE); \
duke@2 82 fi
duke@2 83 @if [ -r $(ERROR_FILE) ]; then \
duke@2 84 if [ "x$(INSANE)" = x ]; then \
duke@2 85 $(ECHO) "Exiting because of the above error(s). \n" \
duke@2 86 "">> $(ERROR_FILE); \
duke@2 87 fi ; \
duke@2 88 $(CAT) $(ERROR_FILE) ; \
duke@2 89 if [ "x$(INSANE)" = x ]; then \
duke@2 90 exit 1 ; \
duke@2 91 fi ; \
duke@2 92 fi
duke@2 93 ifdef PEDANTIC
duke@2 94 @if [ -r $(WARNING_FILE) ]; then \
duke@2 95 $(ECHO) "PEDANTIC mode requested. \n" \
duke@2 96 "Exiting because of the above warning(s). \n" \
duke@2 97 "" >> $(ERROR_FILE); \
duke@2 98 $(CAT) $(ERROR_FILE) ; \
duke@2 99 exit 1 ; \
duke@2 100 fi
duke@2 101 endif
duke@2 102 @if [ ! -r $(ERROR_FILE) ]; then \
duke@2 103 $(ECHO) "Sanity check passed." ; \
duke@2 104 fi
duke@2 105
duke@2 106 insane:
duke@2 107 ifdef INSANE
duke@2 108 @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \
duke@2 109 " should not use this mode, and in fact, \n" \
duke@2 110 " it may be removed at any time. If you \n" \
duke@2 111 " have build problems as a result of using \n" \
duke@2 112 " INSANE mode, then you should not expect \n" \
duke@2 113 " assistance from anyone with the problems \n" \
duke@2 114 " or consequences you experience. \n" \
duke@2 115 "" >> $(WARNING_FILE)
duke@2 116 endif
duke@2 117
duke@2 118 # Get list of environment variables set that we do not want set
duke@2 119 ifdef ALT_HOTSPOT_SERVER_PATH
duke@2 120 DO_NOT_SET_LIST += ALT_HOTSPOT_SERVER_PATH
duke@2 121 endif
duke@2 122 ifdef ALT_HOTSPOT_CLIENT_PATH
duke@2 123 DO_NOT_SET_LIST += ALT_HOTSPOT_CLIENT_PATH
duke@2 124 endif
duke@2 125 ifdef ALT_HOTSPOT_LIB_PATH
duke@2 126 DO_NOT_SET_LIST += ALT_HOTSPOT_LIB_PATH
duke@2 127 endif
duke@2 128
duke@2 129 # Error message for environment variable set that should not be
duke@2 130 %.do_not_set:
duke@2 131 @$(ECHO) "ERROR: Your build environment has the variable\n" \
duke@2 132 " $* defined. Please unset it and restart your build. \n" \
duke@2 133 "" >> $(ERROR_FILE)
duke@2 134
mduigou@408 135 # Check the environment variables
duke@2 136 environment: $(DO_NOT_SET_LIST:%=%.do_not_set)
duke@2 137 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
duke@2 138 ifneq ($(BUILD_LANGTOOLS), true)
duke@2 139 @$(ECHO) "WARNING: You are not building the LANGTOOLS sources.\n" \
duke@2 140 " Lang tools (javac) will be obtained from \n" \
duke@2 141 " the location set in ALT_JDK_IMPORT_PATH. \n" \
duke@2 142 "" >> $(WARNING_FILE)
duke@2 143 endif
duke@2 144 endif
duke@2 145 ifeq ($(JAXP_SRC_AVAILABLE), true)
duke@2 146 ifneq ($(BUILD_JAXP), true)
duke@2 147 @$(ECHO) "WARNING: You are not building the JAXP sources.\n" \
duke@2 148 " The jaxp files will be obtained from \n" \
duke@2 149 " the location set in ALT_JDK_IMPORT_PATH. \n" \
duke@2 150 "" >> $(WARNING_FILE)
duke@2 151 endif
duke@2 152 endif
duke@2 153 ifeq ($(JAXWS_SRC_AVAILABLE), true)
duke@2 154 ifneq ($(BUILD_JAXWS), true)
duke@2 155 @$(ECHO) "WARNING: You are not building the JAXWS sources.\n" \
duke@2 156 " The jaxws files will be obtained from \n" \
duke@2 157 " the location set in ALT_JDK_IMPORT_PATH. \n" \
duke@2 158 "" >> $(WARNING_FILE)
duke@2 159 endif
duke@2 160 endif
duke@2 161 ifeq ($(CORBA_SRC_AVAILABLE), true)
duke@2 162 ifneq ($(BUILD_CORBA), true)
duke@2 163 @$(ECHO) "WARNING: You are not building the CORBA sources.\n" \
duke@2 164 " The corba files will be obtained from \n" \
duke@2 165 " the location set in ALT_JDK_IMPORT_PATH. \n" \
duke@2 166 "" >> $(WARNING_FILE)
duke@2 167 endif
duke@2 168 endif
duke@2 169 ifeq ($(HOTSPOT_SRC_AVAILABLE), true)
duke@2 170 ifneq ($(BUILD_HOTSPOT), true)
duke@2 171 @$(ECHO) "WARNING: You are not building the HOTSPOT sources.\n" \
duke@2 172 " Hotspot libs will be obtained from \n" \
duke@2 173 " the location set in ALT_HOTSPOT_IMPORT_PATH. \n" \
duke@2 174 "" >> $(WARNING_FILE)
duke@2 175 endif
duke@2 176 endif
duke@2 177 ifeq ($(JDK_SRC_AVAILABLE), true)
duke@2 178 ifneq ($(BUILD_JDK), true)
duke@2 179 @$(ECHO) "WARNING: You are not building the JDK sources.\n" \
duke@2 180 " This will result in a development-only\n" \
duke@2 181 " build of the JDK , lacking the jdk binaries.\n" \
duke@2 182 "" >> $(WARNING_FILE)
duke@2 183 endif
duke@2 184 endif
jjg@645 185 ifeq ($(NASHORN_SRC_AVAILABLE), true)
jjg@645 186 ifneq ($(BUILD_NASHORN), true)
jjg@645 187 @$(ECHO) "WARNING: You are not building the NASHORN sources.\n" \
jjg@645 188 " The nashorn files will be obtained from \n" \
jjg@645 189 " the location set in ALT_JDK_IMPORT_PATH. \n" \
jjg@645 190 "" >> $(WARNING_FILE)
jjg@645 191 endif
jjg@645 192 endif
duke@2 193 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 194 ifneq ($(BUILD_DEPLOY), true)
duke@2 195 @$(ECHO) "WARNING: You are not building the DEPLOY sources.\n" \
duke@2 196 " This will result in a development-only\n" \
duke@2 197 " build of the JDK, lacking the plugin and javaws binaries.\n" \
duke@2 198 "" >> $(WARNING_FILE)
duke@2 199 endif
duke@2 200 endif
duke@2 201 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 202 ifneq ($(BUILD_INSTALL), true)
duke@2 203 @$(ECHO) "WARNING: You are not building the INSTALL sources.\n" \
duke@2 204 " This will result in a development-only\n" \
duke@2 205 " build of the JDK, lacking the installation bundles\n" \
duke@2 206 "" >> $(WARNING_FILE)
duke@2 207 endif
duke@2 208 endif
duke@2 209 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 210 ifneq ($(BUILD_SPONSORS), true)
duke@2 211 @$(ECHO) "WARNING: You are not building the SPONSORS sources.\n" \
duke@2 212 "" >> $(WARNING_FILE)
duke@2 213 endif
duke@2 214 endif
ohair@144 215 ifeq ($(GENERATE_DOCS),false)
mduigou@408 216 @$(ECHO) "WARNING: This build does not include generating javadoc.\n" \
mduigou@408 217 "" >> $(WARNING_FILE)
mduigou@408 218 endif
mduigou@408 219 ifdef NO_DEMOS
mduigou@408 220 @$(ECHO) "WARNING: This build and any install images will not include demos.\n" \
mduigou@408 221 "" >> $(WARNING_FILE)
mduigou@408 222 endif
mduigou@408 223 ifdef NO_SAMPLES
mduigou@408 224 @$(ECHO) "WARNING: This build and any install images will not include samples.\n" \
duke@2 225 "" >> $(WARNING_FILE)
duke@2 226 endif
duke@2 227 ifdef NO_IMAGES
duke@2 228 @$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \
duke@2 229 " defined. This will result in a development-only\n" \
duke@2 230 " build of the JDK, lacking the install images\n" \
duke@2 231 " and bundles.\n" \
duke@2 232 "" >> $(WARNING_FILE)
duke@2 233 endif
duke@2 234 ifdef DEV_ONLY
duke@2 235 @$(ECHO) "WARNING: Your build environment has the variable DEV_ONLY\n" \
duke@2 236 " defined. This will result in a development-only\n" \
duke@2 237 " build of the JDK, lacking the documentation\n" \
duke@2 238 " build and installation bundles.\n" \
duke@2 239 "" >> $(WARNING_FILE)
duke@2 240 endif
duke@2 241
duke@2 242 ######################################################
duke@2 243 # dump out the variable settings...
duke@2 244 ######################################################
duke@2 245 ifneq ($(PLATFORM), windows)
duke@2 246 ifndef HOSTNAME
duke@2 247 HOSTNAME := $(shell hostname)
duke@2 248 endif
duke@2 249 endif
mduigou@408 250 settings::
duke@2 251 @$(ECHO) "Build Machine Information:" >> $(MESSAGE_FILE)
duke@2 252 ifeq ($(PLATFORM), windows)
duke@2 253 @$(ECHO) " build machine = $(COMPUTERNAME)" >> $(MESSAGE_FILE)
duke@2 254 else
duke@2 255 @$(ECHO) " build machine = $(HOSTNAME)" >> $(MESSAGE_FILE)
duke@2 256 endif
duke@2 257 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 258 @$(ECHO) "Build Directory Structure:" >> $(MESSAGE_FILE)
duke@2 259 @$(ECHO) " CWD = `$(PWD)`" >> $(MESSAGE_FILE)
duke@2 260 @$(ECHO) " TOPDIR = $(TOPDIR)" >> $(MESSAGE_FILE)
duke@2 261 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
duke@2 262 @$(ECHO) " LANGTOOLS_TOPDIR = $(LANGTOOLS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 263 endif
duke@2 264 ifeq ($(JAXP_SRC_AVAILABLE), true)
duke@2 265 @$(ECHO) " JAXP_TOPDIR = $(JAXP_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 266 endif
duke@2 267 ifeq ($(JAXWS_SRC_AVAILABLE), true)
duke@2 268 @$(ECHO) " JAXWS_TOPDIR = $(JAXWS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 269 endif
duke@2 270 ifeq ($(CORBA_SRC_AVAILABLE), true)
duke@2 271 @$(ECHO) " CORBA_TOPDIR = $(CORBA_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 272 endif
duke@2 273 ifeq ($(HOTSPOT_SRC_AVAILABLE), true)
duke@2 274 @$(ECHO) " HOTSPOT_TOPDIR = $(HOTSPOT_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 275 endif
duke@2 276 ifeq ($(JDK_SRC_AVAILABLE), true)
duke@2 277 @$(ECHO) " JDK_TOPDIR = $(JDK_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 278 endif
jjg@645 279 ifeq ($(NASHORN_SRC_AVAILABLE), true)
jjg@645 280 @$(ECHO) " NASHORN_TOPDIR = $(NASHORN_TOPDIR)" >> $(MESSAGE_FILE)
jjg@645 281 endif
duke@2 282 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 283 @$(ECHO) " DEPLOY_TOPDIR = $(DEPLOY_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 284 endif
duke@2 285 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 286 @$(ECHO) " INSTALL_TOPDIR = $(INSTALL_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 287 endif
duke@2 288 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 289 @$(ECHO) " SPONSORS_TOPDIR = $(SPONSORS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 290 endif
duke@2 291 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 292 ifneq ($(SKIP_COMPARE_IMAGES), true)
duke@2 293 @$(ECHO) "External File/Binary Locations:" >> $(MESSAGE_FILE)
duke@2 294 @$(ECHO) " PREVIOUS_JRE_BUNDLE = $(PREVIOUS_JRE_BUNDLE) " >> $(MESSAGE_FILE)
duke@2 295 @$(ECHO) " PREVIOUS_JDK_BUNDLE = $(PREVIOUS_JDK_BUNDLE) " >> $(MESSAGE_FILE)
duke@2 296 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 297 endif
duke@2 298 @$(ECHO) "Build Directives:" >> $(MESSAGE_FILE)
duke@2 299 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
duke@2 300 @$(ECHO) " BUILD_LANGTOOLS = $(BUILD_LANGTOOLS) " >> $(MESSAGE_FILE)
duke@2 301 endif
duke@2 302 ifeq ($(JAXP_SRC_AVAILABLE), true)
duke@2 303 @$(ECHO) " BUILD_JAXP = $(BUILD_JAXP) " >> $(MESSAGE_FILE)
duke@2 304 endif
duke@2 305 ifeq ($(JAXWS_SRC_AVAILABLE), true)
duke@2 306 @$(ECHO) " BUILD_JAXWS = $(BUILD_JAXWS) " >> $(MESSAGE_FILE)
duke@2 307 endif
duke@2 308 ifeq ($(CORBA_SRC_AVAILABLE), true)
duke@2 309 @$(ECHO) " BUILD_CORBA = $(BUILD_CORBA) " >> $(MESSAGE_FILE)
duke@2 310 endif
duke@2 311 ifeq ($(HOTSPOT_SRC_AVAILABLE), true)
duke@2 312 @$(ECHO) " BUILD_HOTSPOT = $(BUILD_HOTSPOT) " >> $(MESSAGE_FILE)
duke@2 313 endif
duke@2 314 ifeq ($(JDK_SRC_AVAILABLE), true)
duke@2 315 @$(ECHO) " BUILD_JDK = $(BUILD_JDK) " >> $(MESSAGE_FILE)
duke@2 316 endif
jjg@645 317 ifeq ($(NASHORN_SRC_AVAILABLE), true)
jjg@645 318 @$(ECHO) " BUILD_NASHORN = $(BUILD_NASHORN) " >> $(MESSAGE_FILE)
jjg@645 319 endif
duke@2 320 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 321 @$(ECHO) " BUILD_DEPLOY = $(BUILD_DEPLOY) " >> $(MESSAGE_FILE)
duke@2 322 endif
duke@2 323 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 324 @$(ECHO) " BUILD_INSTALL = $(BUILD_INSTALL) " >> $(MESSAGE_FILE)
duke@2 325 endif
duke@2 326 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 327 @$(ECHO) " BUILD_SPONSORS = $(BUILD_SPONSORS) " >> $(MESSAGE_FILE)
duke@2 328 endif
aph@80 329 @$(ECHO) " DEBUG_CLASSFILES = $(DEBUG_CLASSFILES) " >> $(MESSAGE_FILE)
aph@80 330 @$(ECHO) " DEBUG_BINARIES = $(DEBUG_BINARIES) " >> $(MESSAGE_FILE)
duke@2 331 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 332
duke@2 333 .PHONY: sanity settings pre-sanity insane \
duke@2 334 post-sanity post-sanity-hotspot post-sanity-jdk \
duke@2 335 post-sanity-install post-sanity-deploy \
jjg@354 336 environment

mercurial