Makefile

Thu, 23 Dec 2010 18:41:57 -0800

author
ohair
date
Thu, 23 Dec 2010 18:41:57 -0800
changeset 278
c1af03f88627
parent 275
4346ba98938b
child 288
6db0e6f221bd
permissions
-rw-r--r--

7008723: Remove binary plugs creation and use from openjdk
Reviewed-by: mchung, andrew, aph, dholmes

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

mercurial