annotate Makefile @ 18474:15fa9dea9764

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