J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | # |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 2 | # Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 7 | # published by the Free Software Foundation. Oracle designates this |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 8 | # particular file as subject to the "Classpath" exception as provided |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 9 | # by Oracle in the LICENSE file that accompanied this code. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | # |
Kelly O'Hair | 136614e | 2010-05-25 15:51:26 -0700 | [diff] [blame] | 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. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 24 | # |
| 25 | |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 26 | BUILD_PARENT_DIRECTORY=. |
| 27 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 28 | ifndef TOPDIR |
Kelly O'Hair | fb56a9a | 2008-03-25 14:38:56 -0700 | [diff] [blame] | 29 | TOPDIR:=. |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 30 | endif |
| 31 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 32 | ifndef JDK_TOPDIR |
| 33 | JDK_TOPDIR=$(TOPDIR)/jdk |
| 34 | endif |
| 35 | ifndef JDK_MAKE_SHARED_DIR |
| 36 | JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared |
| 37 | endif |
| 38 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 39 | # For start and finish echo lines |
| 40 | TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE) |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 41 | DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'` |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 42 | START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)" |
| 43 | FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)" |
| 44 | |
| 45 | default: all |
| 46 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 47 | include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 48 | include ./make/Defs-internal.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 49 | include ./make/sanity-rules.gmk |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 50 | include ./make/hotspot-rules.gmk |
| 51 | include ./make/langtools-rules.gmk |
| 52 | include ./make/corba-rules.gmk |
| 53 | include ./make/jaxp-rules.gmk |
| 54 | include ./make/jaxws-rules.gmk |
| 55 | include ./make/jdk-rules.gmk |
| 56 | include ./make/install-rules.gmk |
| 57 | include ./make/sponsors-rules.gmk |
| 58 | include ./make/deploy-rules.gmk |
| 59 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 60 | # What "all" means |
| 61 | all:: |
| 62 | @$(START_ECHO) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 63 | |
Kelly O'Hair | 88990fd | 2011-01-05 17:24:58 -0800 | [diff] [blame] | 64 | all:: sanity |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 65 | |
| 66 | ifeq ($(SKIP_FASTDEBUG_BUILD), false) |
| 67 | all:: fastdebug_build |
| 68 | endif |
| 69 | |
| 70 | ifeq ($(SKIP_DEBUG_BUILD), false) |
| 71 | all:: debug_build |
| 72 | endif |
| 73 | |
Kelly O'Hair | 179908e | 2008-08-17 09:56:25 -0700 | [diff] [blame] | 74 | all:: all_product_build |
| 75 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 76 | all:: |
| 77 | @$(FINISH_ECHO) |
| 78 | |
| 79 | # Everything for a full product build |
| 80 | all_product_build:: |
| 81 | @$(START_ECHO) |
| 82 | |
| 83 | ifeq ($(SKIP_PRODUCT_BUILD), false) |
| 84 | |
| 85 | all_product_build:: product_build |
| 86 | |
| 87 | ifeq ($(BUILD_INSTALL), true) |
| 88 | all_product_build:: $(INSTALL) |
| 89 | clobber:: install-clobber |
| 90 | endif |
| 91 | |
| 92 | ifeq ($(BUILD_SPONSORS), true) |
| 93 | all_product_build:: $(SPONSORS) |
| 94 | clobber:: sponsors-clobber |
| 95 | endif |
| 96 | |
| 97 | ifneq ($(SKIP_COMPARE_IMAGES), true) |
| 98 | all_product_build:: compare-image |
| 99 | endif |
| 100 | |
| 101 | endif |
| 102 | |
| 103 | all_product_build:: |
| 104 | @$(FINISH_ECHO) |
| 105 | |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 106 | # Generic build of basic repo series |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 107 | generic_build_repo_series:: |
| 108 | $(MKDIR) -p $(OUTPUTDIR) |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 109 | $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 110 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 111 | ifeq ($(BUILD_LANGTOOLS), true) |
| 112 | generic_build_repo_series:: langtools |
| 113 | clobber:: langtools-clobber |
| 114 | endif |
| 115 | |
| 116 | ifeq ($(BUILD_CORBA), true) |
| 117 | generic_build_repo_series:: corba |
| 118 | clobber:: corba-clobber |
| 119 | endif |
| 120 | |
| 121 | ifeq ($(BUILD_JAXP), true) |
| 122 | generic_build_repo_series:: jaxp |
| 123 | clobber:: jaxp-clobber |
| 124 | endif |
| 125 | |
| 126 | ifeq ($(BUILD_JAXWS), true) |
| 127 | generic_build_repo_series:: jaxws |
| 128 | clobber:: jaxws-clobber |
| 129 | endif |
| 130 | |
| 131 | ifeq ($(BUILD_HOTSPOT), true) |
| 132 | generic_build_repo_series:: $(HOTSPOT) |
| 133 | clobber:: hotspot-clobber |
| 134 | endif |
| 135 | |
| 136 | ifeq ($(BUILD_JDK), true) |
| 137 | generic_build_repo_series:: $(JDK_JAVA_EXE) |
| 138 | clobber:: jdk-clobber |
| 139 | endif |
| 140 | |
| 141 | ifeq ($(BUILD_DEPLOY), true) |
| 142 | generic_build_repo_series:: $(DEPLOY) |
| 143 | clobber:: deploy-clobber |
| 144 | endif |
| 145 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 146 | # The debug build, fastdebug or debug. Needs special handling. |
| 147 | # Note that debug builds do NOT do INSTALL steps, but must be done |
| 148 | # after the product build and before the INSTALL step of the product build. |
| 149 | # |
| 150 | # DEBUG_NAME is fastdebug or debug |
| 151 | # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix |
| 152 | # The resulting j2sdk-image is used by the install makefiles to create a |
| 153 | # debug install bundle jdk-*-debug-** bundle (tar or zip) |
| 154 | # which will install in the debug or fastdebug subdirectory of the |
| 155 | # normal product install area. |
| 156 | # The install process needs to know what the DEBUG_NAME is, so |
| 157 | # look for INSTALL_DEBUG_NAME in the install rules. |
| 158 | # |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 159 | # NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME). |
| 160 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
| 161 | # not be the same location. |
| 162 | # |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 163 | |
| 164 | # Location of fresh bootdir output |
| 165 | ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk |
| 166 | FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 167 | FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 168 | |
| 169 | create_fresh_product_bootdir: FRC |
| 170 | @$(START_ECHO) |
| 171 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 172 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 173 | BOOT_CYCLE_SETTINGS= \ |
| 174 | build_product_image |
| 175 | @$(FINISH_ECHO) |
| 176 | |
| 177 | create_fresh_debug_bootdir: FRC |
| 178 | @$(START_ECHO) |
| 179 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 180 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 181 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 182 | build_debug_image |
| 183 | @$(FINISH_ECHO) |
| 184 | |
| 185 | create_fresh_fastdebug_bootdir: FRC |
| 186 | @$(START_ECHO) |
| 187 | $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 188 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 189 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 190 | build_fastdebug_image |
| 191 | @$(FINISH_ECHO) |
| 192 | |
| 193 | # Create boot image? |
| 194 | ifeq ($(SKIP_BOOT_CYCLE),false) |
| 195 | ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
| 196 | DO_BOOT_CYCLE=true |
| 197 | endif |
| 198 | endif |
| 199 | |
| 200 | ifeq ($(DO_BOOT_CYCLE),true) |
| 201 | |
| 202 | # Create the bootdir to use in the build |
| 203 | product_build:: create_fresh_product_bootdir |
| 204 | debug_build:: create_fresh_debug_bootdir |
| 205 | fastdebug_build:: create_fresh_fastdebug_bootdir |
| 206 | |
| 207 | # Define variables to be used now for the boot jdk |
| 208 | BOOT_CYCLE_SETTINGS= \ |
| 209 | ALT_BOOTDIR=$(FRESH_BOOTDIR) \ |
| 210 | ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR) |
| 211 | BOOT_CYCLE_DEBUG_SETTINGS= \ |
| 212 | ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \ |
| 213 | ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR) |
| 214 | |
| 215 | else |
| 216 | |
| 217 | # Use the supplied ALT_BOOTDIR as the boot |
| 218 | BOOT_CYCLE_SETTINGS= |
| 219 | BOOT_CYCLE_DEBUG_SETTINGS= |
| 220 | |
| 221 | endif |
| 222 | |
| 223 | build_product_image: |
| 224 | @$(START_ECHO) |
| 225 | $(MAKE) \ |
| 226 | SKIP_FASTDEBUG_BUILD=true \ |
| 227 | SKIP_DEBUG_BUILD=true \ |
| 228 | $(BOOT_CYCLE_SETTINGS) \ |
| 229 | generic_build_repo_series |
| 230 | @$(FINISH_ECHO) |
| 231 | |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 232 | # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). |
| 233 | # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
| 234 | # not be the same location. |
| 235 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 236 | generic_debug_build: |
| 237 | @$(START_ECHO) |
| 238 | $(MAKE) \ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 239 | ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 240 | DEBUG_NAME=$(DEBUG_NAME) \ |
Kelly O'Hair | d0c9ba3 | 2009-11-18 16:41:09 -0800 | [diff] [blame] | 241 | GENERATE_DOCS=false \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 242 | $(BOOT_CYCLE_DEBUG_SETTINGS) \ |
| 243 | generic_build_repo_series |
| 244 | @$(FINISH_ECHO) |
| 245 | |
| 246 | build_debug_image: |
| 247 | $(MAKE) DEBUG_NAME=debug generic_debug_build |
| 248 | |
| 249 | build_fastdebug_image: |
| 250 | $(MAKE) DEBUG_NAME=fastdebug generic_debug_build |
| 251 | |
| 252 | # Build final image |
| 253 | product_build:: build_product_image |
| 254 | debug_build:: build_debug_image |
| 255 | fastdebug_build:: build_fastdebug_image |
| 256 | |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 257 | clobber:: |
| 258 | $(RM) -r $(OUTPUTDIR)/* |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 259 | $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* |
| 260 | $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/* |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 261 | -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) |
| 262 | |
| 263 | clean: clobber |
| 264 | |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 265 | # |
| 266 | # Dev builds |
| 267 | # |
| 268 | |
| 269 | dev : dev-build |
| 270 | |
| 271 | dev-build: |
| 272 | $(MAKE) DEV_ONLY=true all |
| 273 | dev-sanity: |
| 274 | $(MAKE) DEV_ONLY=true sanity |
| 275 | dev-clobber: |
| 276 | $(MAKE) DEV_ONLY=true clobber |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 277 | |
| 278 | # |
| 279 | # Quick jdk verification build |
| 280 | # |
| 281 | jdk_only: |
| 282 | $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all |
| 283 | |
| 284 | |
| 285 | # |
| 286 | # Quick jdk verification fastdebug build |
| 287 | # |
| 288 | jdk_fastdebug_only: |
| 289 | $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \ |
| 290 | BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build |
| 291 | |
| 292 | # |
| 293 | # Quick deploy verification fastdebug build |
| 294 | # |
| 295 | deploy_fastdebug_only: |
| 296 | $(MAKE) \ |
| 297 | DEBUG_NAME=fastdebug \ |
| 298 | BUILD_HOTSPOT=false \ |
| 299 | BUILD_JDK=false \ |
| 300 | BUILD_LANGTOOLS=false \ |
| 301 | BUILD_CORBA=false \ |
| 302 | BUILD_JAXP=false \ |
| 303 | BUILD_JAXWS=false \ |
| 304 | BUILD_INSTALL=false \ |
| 305 | BUILD_SPONSORS=false \ |
| 306 | generic_debug_build |
| 307 | |
| 308 | # |
| 309 | # Product build (skip debug builds) |
| 310 | # |
| 311 | product_only: |
| 312 | $(MAKE) SKIP_FASTDEBUG_BUILD=true all |
| 313 | |
| 314 | # |
| 315 | # Check target |
| 316 | # |
| 317 | |
| 318 | check: variable_check |
| 319 | |
| 320 | # |
| 321 | # Help target |
| 322 | # |
| 323 | help: intro_help target_help variable_help notes_help examples_help |
| 324 | |
| 325 | # Intro help message |
| 326 | intro_help: |
| 327 | @$(ECHO) "\ |
| 328 | Makefile for the JDK builds (all the JDK). \n\ |
| 329 | " |
| 330 | |
| 331 | # Target help |
| 332 | target_help: |
| 333 | @$(ECHO) "\ |
| 334 | --- Common Targets --- \n\ |
| 335 | all -- build the core JDK (default target) \n\ |
| 336 | help -- Print out help information \n\ |
| 337 | check -- Check make variable values for correctness \n\ |
| 338 | sanity -- Perform detailed sanity checks on system and settings \n\ |
| 339 | fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\ |
| 340 | debug_build -- build the core JDK in 'debug' mode (-g) \n\ |
| 341 | clean -- remove all built and imported files \n\ |
| 342 | clobber -- same as clean \n\ |
| 343 | " |
| 344 | |
| 345 | # Variable help (only common ones used by this Makefile) |
| 346 | variable_help: variable_help_intro variable_list variable_help_end |
| 347 | variable_help_intro: |
| 348 | @$(ECHO) "--- Common Variables ---" |
| 349 | variable_help_end: |
| 350 | @$(ECHO) " " |
| 351 | |
| 352 | # One line descriptions for the variables |
| 353 | OUTPUTDIR.desc = Output directory |
| 354 | PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count |
| 355 | SLASH_JAVA.desc = Root of all build tools, e.g. /java or J: |
| 356 | BOOTDIR.desc = JDK used to boot the build |
| 357 | JDK_IMPORT_PATH.desc = JDK used to import components of the build |
| 358 | COMPILER_PATH.desc = Compiler install directory |
| 359 | CACERTS_FILE.desc = Location of certificates file |
| 360 | DEVTOOLS_PATH.desc = Directory containing zip and gnumake |
| 361 | CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files |
| 362 | DXSDK_PATH.desc = Root directory of DirectX SDK |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 363 | |
| 364 | # Make variables to print out (description and value) |
| 365 | VARIABLE_PRINTVAL_LIST += \ |
| 366 | OUTPUTDIR \ |
| 367 | PARALLEL_COMPILE_JOBS \ |
| 368 | SLASH_JAVA \ |
| 369 | BOOTDIR \ |
| 370 | JDK_IMPORT_PATH \ |
| 371 | COMPILER_PATH \ |
| 372 | CACERTS_FILE \ |
| 373 | DEVTOOLS_PATH |
| 374 | |
| 375 | # Make variables that should refer to directories that exist |
| 376 | VARIABLE_CHECKDIR_LIST += \ |
| 377 | SLASH_JAVA \ |
| 378 | BOOTDIR \ |
| 379 | JDK_IMPORT_PATH \ |
| 380 | COMPILER_PATH \ |
| 381 | DEVTOOLS_PATH |
| 382 | |
| 383 | # Make variables that should refer to files that exist |
| 384 | VARIABLE_CHECKFIL_LIST += \ |
| 385 | CACERTS_FILE |
| 386 | |
| 387 | # Some are windows specific |
| 388 | ifeq ($(PLATFORM), windows) |
| 389 | |
| 390 | VARIABLE_PRINTVAL_LIST += \ |
Kelly O'Hair | 5ef33b6 | 2011-01-14 14:04:19 -0800 | [diff] [blame] | 391 | DXSDK_PATH |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 392 | |
| 393 | VARIABLE_CHECKDIR_LIST += \ |
Kelly O'Hair | 5ef33b6 | 2011-01-14 14:04:19 -0800 | [diff] [blame] | 394 | DXSDK_PATH |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 395 | |
| 396 | endif |
| 397 | |
| 398 | # For pattern rules below, so all are treated the same |
| 399 | DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval) |
| 400 | DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir) |
| 401 | DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil) |
| 402 | |
| 403 | # Complete variable check |
| 404 | variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST) |
| 405 | variable_list: $(DO_PRINTVAL_LIST) variable_check |
| 406 | |
| 407 | # Pattern rule for printing out a variable |
| 408 | %.printval: |
| 409 | @$(ECHO) " ALT_$* - $($*.desc)" |
| 410 | @$(ECHO) " \t $*=$($*)" |
| 411 | |
| 412 | # Pattern rule for checking to see if a variable with a directory exists |
| 413 | %.checkdir: |
| 414 | @if [ ! -d $($*) ] ; then \ |
| 415 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 416 | fi |
| 417 | |
| 418 | # Pattern rule for checking to see if a variable with a file exists |
| 419 | %.checkfil: |
| 420 | @if [ ! -f $($*) ] ; then \ |
| 421 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \ |
| 422 | fi |
| 423 | |
| 424 | # Misc notes on help |
| 425 | notes_help: |
| 426 | @$(ECHO) "\ |
| 427 | --- Notes --- \n\ |
| 428 | - All builds use same output directory unless overridden with \n\ |
| 429 | \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\ |
| 430 | \t to use the clean target first. \n\ |
| 431 | - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\ |
| 432 | \t builds or previous release JDK builds will work. \n\ |
| 433 | - The fastest builds have been when the sources and the BOOTDIR are on \n\ |
| 434 | \t local disk. \n\ |
| 435 | " |
| 436 | |
| 437 | examples_help: |
| 438 | @$(ECHO) "\ |
| 439 | --- Examples --- \n\ |
| 440 | $(MAKE) fastdebug_build \n\ |
| 441 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 442 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\ |
| 443 | $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\ |
| 444 | $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\ |
| 445 | $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\ |
| 446 | " |
| 447 | |
| 448 | ################################################################ |
Kelly O'Hair | d77b051 | 2010-12-23 18:41:57 -0800 | [diff] [blame] | 449 | # Source bundling |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 450 | ################################################################ |
| 451 | ifeq ($(BUNDLE_RULES_AVAILABLE), true) |
| 452 | include $(BUNDLE_RULES) |
| 453 | endif |
| 454 | |
| 455 | ################################################################ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 456 | # rule to test |
| 457 | ################################################################ |
| 458 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 459 | .NOTPARALLEL: test_run |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 460 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 461 | test: |
| 462 | $(MAKE) test_run |
| 463 | |
| 464 | test_run: test_clean test_start test_summary |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 465 | |
| 466 | test_start: |
| 467 | @$(ECHO) "Tests started at `$(DATE)`" |
| 468 | |
| 469 | test_clean: |
| 470 | $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt |
| 471 | |
| 472 | test_summary: $(OUTPUTDIR)/test_failures.txt |
| 473 | @$(ECHO) "#################################################" |
| 474 | @$(ECHO) "Tests completed at `$(DATE)`" |
| 475 | @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \ |
| 476 | || $(ECHO) "No TEST STATS seen in log" ) |
| 477 | @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt" |
| 478 | @$(ECHO) "#################################################" |
| 479 | @if [ -s $< ] ; then \ |
| 480 | $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \ |
| 481 | $(CAT) $<; \ |
| 482 | exit 1; \ |
| 483 | else \ |
| 484 | $(ECHO) "Success! No failures detected"; \ |
| 485 | fi |
| 486 | |
| 487 | # Get failure list from log |
| 488 | $(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt |
| 489 | @$(RM) $@ |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 490 | @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 491 | |
| 492 | # Get log file of all tests run |
| 493 | JDK_TO_TEST := $(shell \ |
| 494 | if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \ |
| 495 | $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \ |
| 496 | elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \ |
| 497 | $(ECHO) "$(ABS_OUTPUTDIR)"; \ |
| 498 | elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \ |
| 499 | $(ECHO) "$(PRODUCT_HOME)"; \ |
| 500 | fi \ |
| 501 | ) |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 502 | TEST_TARGETS=all |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 503 | $(OUTPUTDIR)/test_log.txt: |
| 504 | $(RM) $@ |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 505 | ( $(CD) test && \ |
| 506 | $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \ |
Kelly O'Hair | 0eca63f | 2010-06-21 11:00:15 -0700 | [diff] [blame] | 507 | ) | tee $@ |
| 508 | |
| 509 | ################################################################ |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 510 | # JPRT rule to build |
| 511 | ################################################################ |
| 512 | |
| 513 | include ./make/jprt.gmk |
| 514 | |
| 515 | ################################################################ |
| 516 | # PHONY |
| 517 | ################################################################ |
| 518 | |
Kelly O'Hair | e0c099c | 2010-09-24 14:03:33 -0700 | [diff] [blame] | 519 | .PHONY: all test test_run test_start test_summary test_clean \ |
Kelly O'Hair | fa892cf | 2008-08-06 14:57:13 -0700 | [diff] [blame] | 520 | generic_build_repo_series \ |
| 521 | what clobber insane \ |
| 522 | dev dev-build dev-sanity dev-clobber \ |
| 523 | product_build \ |
| 524 | fastdebug_build \ |
| 525 | debug_build \ |
| 526 | build_product_image \ |
| 527 | build_debug_image \ |
| 528 | build_fastdebug_image \ |
| 529 | create_fresh_product_bootdir \ |
| 530 | create_fresh_debug_bootdir \ |
| 531 | create_fresh_fastdebug_bootdir \ |
| 532 | generic_debug_build |
J. Duke | 686d76f | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 533 | |
Kelly O'Hair | 6377bd6 | 2008-03-09 15:47:58 -0700 | [diff] [blame] | 534 | # Force target |
| 535 | FRC: |
| 536 | |