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