make/sanity-rules.gmk

Fri, 04 Jan 2013 21:04:03 -0800

author
ohair
date
Fri, 04 Jan 2013 21:04:03 -0800
changeset 570
5cf7750c8c43
parent 408
28f2fe471725
child 645
5b0b6ef58dbf
permissions
-rw-r--r--

8004229: build-infra: Umbrella for switch of default "make" to new makefiles
Reviewed-by: erikj, tbell

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
duke@2 185 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 186 ifneq ($(BUILD_DEPLOY), true)
duke@2 187 @$(ECHO) "WARNING: You are not building the DEPLOY sources.\n" \
duke@2 188 " This will result in a development-only\n" \
duke@2 189 " build of the JDK, lacking the plugin and javaws binaries.\n" \
duke@2 190 "" >> $(WARNING_FILE)
duke@2 191 endif
duke@2 192 endif
duke@2 193 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 194 ifneq ($(BUILD_INSTALL), true)
duke@2 195 @$(ECHO) "WARNING: You are not building the INSTALL sources.\n" \
duke@2 196 " This will result in a development-only\n" \
duke@2 197 " build of the JDK, lacking the installation bundles\n" \
duke@2 198 "" >> $(WARNING_FILE)
duke@2 199 endif
duke@2 200 endif
duke@2 201 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 202 ifneq ($(BUILD_SPONSORS), true)
duke@2 203 @$(ECHO) "WARNING: You are not building the SPONSORS sources.\n" \
duke@2 204 "" >> $(WARNING_FILE)
duke@2 205 endif
duke@2 206 endif
ohair@144 207 ifeq ($(GENERATE_DOCS),false)
mduigou@408 208 @$(ECHO) "WARNING: This build does not include generating javadoc.\n" \
mduigou@408 209 "" >> $(WARNING_FILE)
mduigou@408 210 endif
mduigou@408 211 ifdef NO_DEMOS
mduigou@408 212 @$(ECHO) "WARNING: This build and any install images will not include demos.\n" \
mduigou@408 213 "" >> $(WARNING_FILE)
mduigou@408 214 endif
mduigou@408 215 ifdef NO_SAMPLES
mduigou@408 216 @$(ECHO) "WARNING: This build and any install images will not include samples.\n" \
duke@2 217 "" >> $(WARNING_FILE)
duke@2 218 endif
duke@2 219 ifdef NO_IMAGES
duke@2 220 @$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \
duke@2 221 " defined. This will result in a development-only\n" \
duke@2 222 " build of the JDK, lacking the install images\n" \
duke@2 223 " and bundles.\n" \
duke@2 224 "" >> $(WARNING_FILE)
duke@2 225 endif
duke@2 226 ifdef DEV_ONLY
duke@2 227 @$(ECHO) "WARNING: Your build environment has the variable DEV_ONLY\n" \
duke@2 228 " defined. This will result in a development-only\n" \
duke@2 229 " build of the JDK, lacking the documentation\n" \
duke@2 230 " build and installation bundles.\n" \
duke@2 231 "" >> $(WARNING_FILE)
duke@2 232 endif
duke@2 233
duke@2 234 ######################################################
duke@2 235 # dump out the variable settings...
duke@2 236 ######################################################
duke@2 237 ifneq ($(PLATFORM), windows)
duke@2 238 ifndef HOSTNAME
duke@2 239 HOSTNAME := $(shell hostname)
duke@2 240 endif
duke@2 241 endif
mduigou@408 242 settings::
duke@2 243 @$(ECHO) "Build Machine Information:" >> $(MESSAGE_FILE)
duke@2 244 ifeq ($(PLATFORM), windows)
duke@2 245 @$(ECHO) " build machine = $(COMPUTERNAME)" >> $(MESSAGE_FILE)
duke@2 246 else
duke@2 247 @$(ECHO) " build machine = $(HOSTNAME)" >> $(MESSAGE_FILE)
duke@2 248 endif
duke@2 249 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 250 @$(ECHO) "Build Directory Structure:" >> $(MESSAGE_FILE)
duke@2 251 @$(ECHO) " CWD = `$(PWD)`" >> $(MESSAGE_FILE)
duke@2 252 @$(ECHO) " TOPDIR = $(TOPDIR)" >> $(MESSAGE_FILE)
duke@2 253 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
duke@2 254 @$(ECHO) " LANGTOOLS_TOPDIR = $(LANGTOOLS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 255 endif
duke@2 256 ifeq ($(JAXP_SRC_AVAILABLE), true)
duke@2 257 @$(ECHO) " JAXP_TOPDIR = $(JAXP_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 258 endif
duke@2 259 ifeq ($(JAXWS_SRC_AVAILABLE), true)
duke@2 260 @$(ECHO) " JAXWS_TOPDIR = $(JAXWS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 261 endif
duke@2 262 ifeq ($(CORBA_SRC_AVAILABLE), true)
duke@2 263 @$(ECHO) " CORBA_TOPDIR = $(CORBA_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 264 endif
duke@2 265 ifeq ($(HOTSPOT_SRC_AVAILABLE), true)
duke@2 266 @$(ECHO) " HOTSPOT_TOPDIR = $(HOTSPOT_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 267 endif
duke@2 268 ifeq ($(JDK_SRC_AVAILABLE), true)
duke@2 269 @$(ECHO) " JDK_TOPDIR = $(JDK_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 270 endif
duke@2 271 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 272 @$(ECHO) " DEPLOY_TOPDIR = $(DEPLOY_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 273 endif
duke@2 274 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 275 @$(ECHO) " INSTALL_TOPDIR = $(INSTALL_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 276 endif
duke@2 277 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 278 @$(ECHO) " SPONSORS_TOPDIR = $(SPONSORS_TOPDIR)" >> $(MESSAGE_FILE)
duke@2 279 endif
duke@2 280 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 281 ifneq ($(SKIP_COMPARE_IMAGES), true)
duke@2 282 @$(ECHO) "External File/Binary Locations:" >> $(MESSAGE_FILE)
duke@2 283 @$(ECHO) " PREVIOUS_JRE_BUNDLE = $(PREVIOUS_JRE_BUNDLE) " >> $(MESSAGE_FILE)
duke@2 284 @$(ECHO) " PREVIOUS_JDK_BUNDLE = $(PREVIOUS_JDK_BUNDLE) " >> $(MESSAGE_FILE)
duke@2 285 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 286 endif
duke@2 287 @$(ECHO) "Build Directives:" >> $(MESSAGE_FILE)
duke@2 288 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
duke@2 289 @$(ECHO) " BUILD_LANGTOOLS = $(BUILD_LANGTOOLS) " >> $(MESSAGE_FILE)
duke@2 290 endif
duke@2 291 ifeq ($(JAXP_SRC_AVAILABLE), true)
duke@2 292 @$(ECHO) " BUILD_JAXP = $(BUILD_JAXP) " >> $(MESSAGE_FILE)
duke@2 293 endif
duke@2 294 ifeq ($(JAXWS_SRC_AVAILABLE), true)
duke@2 295 @$(ECHO) " BUILD_JAXWS = $(BUILD_JAXWS) " >> $(MESSAGE_FILE)
duke@2 296 endif
duke@2 297 ifeq ($(CORBA_SRC_AVAILABLE), true)
duke@2 298 @$(ECHO) " BUILD_CORBA = $(BUILD_CORBA) " >> $(MESSAGE_FILE)
duke@2 299 endif
duke@2 300 ifeq ($(HOTSPOT_SRC_AVAILABLE), true)
duke@2 301 @$(ECHO) " BUILD_HOTSPOT = $(BUILD_HOTSPOT) " >> $(MESSAGE_FILE)
duke@2 302 endif
duke@2 303 ifeq ($(JDK_SRC_AVAILABLE), true)
duke@2 304 @$(ECHO) " BUILD_JDK = $(BUILD_JDK) " >> $(MESSAGE_FILE)
duke@2 305 endif
duke@2 306 ifeq ($(DEPLOY_SRC_AVAILABLE), true)
duke@2 307 @$(ECHO) " BUILD_DEPLOY = $(BUILD_DEPLOY) " >> $(MESSAGE_FILE)
duke@2 308 endif
duke@2 309 ifeq ($(INSTALL_SRC_AVAILABLE), true)
duke@2 310 @$(ECHO) " BUILD_INSTALL = $(BUILD_INSTALL) " >> $(MESSAGE_FILE)
duke@2 311 endif
duke@2 312 ifeq ($(SPONSORS_SRC_AVAILABLE), true)
duke@2 313 @$(ECHO) " BUILD_SPONSORS = $(BUILD_SPONSORS) " >> $(MESSAGE_FILE)
duke@2 314 endif
aph@80 315 @$(ECHO) " DEBUG_CLASSFILES = $(DEBUG_CLASSFILES) " >> $(MESSAGE_FILE)
aph@80 316 @$(ECHO) " DEBUG_BINARIES = $(DEBUG_BINARIES) " >> $(MESSAGE_FILE)
duke@2 317 @$(ECHO) "" >> $(MESSAGE_FILE)
duke@2 318
duke@2 319 .PHONY: sanity settings pre-sanity insane \
duke@2 320 post-sanity post-sanity-hotspot post-sanity-jdk \
duke@2 321 post-sanity-install post-sanity-deploy \
jjg@354 322 environment

mercurial