annotate Makefile @ 469:8d24def5ceb3

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