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