annotate Makefile @ 311:a1c8b847b753

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