annotate Makefile @ 323:c6f380693342

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