Makefile

Wed, 06 Aug 2008 14:57:13 -0700

author
ohair
date
Wed, 06 Aug 2008 14:57:13 -0700
changeset 29
55b2666e52e1
parent 20
2dab2f712e18
child 34
46a989ab9329
permissions
-rw-r--r--

6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
Reviewed-by: tbell

duke@2 1 #
xdono@20 2 # Copyright 1995-2008 Sun Microsystems, Inc. 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
duke@2 7 # published by the Free Software Foundation. Sun designates this
duke@2 8 # particular file as subject to the "Classpath" exception as provided
duke@2 9 # by Sun 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 #
duke@2 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@2 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@2 23 # have any 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
duke@2 32 ifndef CONTROL_TOPDIR
ohair@10 33 CONTROL_TOPDIR=$(TOPDIR)
duke@2 34 endif
duke@2 35
ohair@6 36 # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
ohair@6 37 OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
ohair@6 38 OPENJDK_BUILDDIR:=$(shell \
ohair@10 39 if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
ohair@6 40 echo "$(OPENJDK_SOURCETREE)"; \
ohair@6 41 else \
ohair@6 42 echo "."; \
ohair@6 43 fi)
ohair@6 44
duke@2 45 ifndef JDK_TOPDIR
duke@2 46 JDK_TOPDIR=$(TOPDIR)/jdk
duke@2 47 endif
duke@2 48 ifndef JDK_MAKE_SHARED_DIR
duke@2 49 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
duke@2 50 endif
duke@2 51
ohair@29 52 # For start and finish echo lines
ohair@29 53 TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
ohair@29 54 DAYE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
ohair@29 55 START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
ohair@29 56 FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
ohair@29 57
ohair@29 58 default: all
ohair@29 59
duke@2 60 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
duke@2 61 include ./make/Defs-internal.gmk
duke@2 62 include ./make/sanity-rules.gmk
duke@2 63 include ./make/hotspot-rules.gmk
duke@2 64 include ./make/langtools-rules.gmk
duke@2 65 include ./make/corba-rules.gmk
duke@2 66 include ./make/jaxp-rules.gmk
duke@2 67 include ./make/jaxws-rules.gmk
duke@2 68 include ./make/jdk-rules.gmk
duke@2 69 include ./make/install-rules.gmk
duke@2 70 include ./make/sponsors-rules.gmk
duke@2 71 include ./make/deploy-rules.gmk
duke@2 72
ohair@29 73 # What "all" means
ohair@29 74 all::
ohair@29 75 @$(START_ECHO)
duke@2 76
ohair@29 77 all:: openjdk_check sanity all_product_build
ohair@29 78
ohair@29 79 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
ohair@29 80 all:: fastdebug_build
ohair@29 81 endif
ohair@29 82
ohair@29 83 ifeq ($(SKIP_DEBUG_BUILD), false)
ohair@29 84 all:: debug_build
ohair@29 85 endif
ohair@29 86
ohair@29 87 ifneq ($(SKIP_OPENJDK_BUILD), true)
ohair@29 88 all:: openjdk_build
ohair@29 89 endif
ohair@29 90
ohair@29 91 all::
ohair@29 92 @$(FINISH_ECHO)
ohair@29 93
ohair@29 94 # Everything for a full product build
ohair@29 95 all_product_build::
ohair@29 96 @$(START_ECHO)
ohair@29 97
ohair@29 98 ifeq ($(SKIP_PRODUCT_BUILD), false)
ohair@29 99
ohair@29 100 all_product_build:: product_build
ohair@29 101
ohair@29 102 ifeq ($(BUILD_INSTALL), true)
ohair@29 103 all_product_build:: $(INSTALL)
ohair@29 104 clobber:: install-clobber
ohair@29 105 endif
ohair@29 106
ohair@29 107 ifeq ($(BUILD_SPONSORS), true)
ohair@29 108 all_product_build:: $(SPONSORS)
ohair@29 109 clobber:: sponsors-clobber
ohair@29 110 endif
ohair@29 111
ohair@29 112 ifneq ($(SKIP_COMPARE_IMAGES), true)
ohair@29 113 all_product_build:: compare-image
ohair@29 114 endif
ohair@29 115
ohair@29 116 endif
ohair@29 117
ohair@29 118 all_product_build::
ohair@29 119 @$(FINISH_ECHO)
ohair@29 120
ohair@29 121 # Generis build of basic repo series
ohair@29 122 generic_build_repo_series::
ohair@29 123 $(MKDIR) -p $(OUTPUTDIR)
duke@2 124 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
duke@2 125
ohair@29 126 ifeq ($(BUILD_LANGTOOLS), true)
ohair@29 127 generic_build_repo_series:: langtools
ohair@29 128 clobber:: langtools-clobber
ohair@29 129 endif
ohair@29 130
ohair@29 131 ifeq ($(BUILD_CORBA), true)
ohair@29 132 generic_build_repo_series:: corba
ohair@29 133 clobber:: corba-clobber
ohair@29 134 endif
ohair@29 135
ohair@29 136 ifeq ($(BUILD_JAXP), true)
ohair@29 137 generic_build_repo_series:: jaxp
ohair@29 138 clobber:: jaxp-clobber
ohair@29 139 endif
ohair@29 140
ohair@29 141 ifeq ($(BUILD_JAXWS), true)
ohair@29 142 generic_build_repo_series:: jaxws
ohair@29 143 clobber:: jaxws-clobber
ohair@29 144 endif
ohair@29 145
ohair@29 146 ifeq ($(BUILD_HOTSPOT), true)
ohair@29 147 generic_build_repo_series:: $(HOTSPOT)
ohair@29 148 clobber:: hotspot-clobber
ohair@29 149 endif
ohair@29 150
ohair@29 151 ifeq ($(BUILD_JDK), true)
ohair@29 152 generic_build_repo_series:: $(JDK_JAVA_EXE)
ohair@29 153 clobber:: jdk-clobber
ohair@29 154 endif
ohair@29 155
ohair@29 156 ifeq ($(BUILD_DEPLOY), true)
ohair@29 157 generic_build_repo_series:: $(DEPLOY)
ohair@29 158 clobber:: deploy-clobber
ohair@29 159 endif
ohair@29 160
ohair@29 161 ifeq ($(BUILD_JDK), true)
ohair@29 162 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
ohair@29 163 generic_build_repo_series:: openjdk-binary-plugs-bundles
ohair@29 164 endif
ohair@29 165 endif
ohair@29 166
ohair@29 167 # The debug build, fastdebug or debug. Needs special handling.
ohair@29 168 # Note that debug builds do NOT do INSTALL steps, but must be done
ohair@29 169 # after the product build and before the INSTALL step of the product build.
ohair@29 170 #
ohair@29 171 # DEBUG_NAME is fastdebug or debug
ohair@29 172 # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
ohair@29 173 # The resulting j2sdk-image is used by the install makefiles to create a
ohair@29 174 # debug install bundle jdk-*-debug-** bundle (tar or zip)
ohair@29 175 # which will install in the debug or fastdebug subdirectory of the
ohair@29 176 # normal product install area.
ohair@29 177 # The install process needs to know what the DEBUG_NAME is, so
ohair@29 178 # look for INSTALL_DEBUG_NAME in the install rules.
ohair@29 179 #
ohair@29 180
ohair@29 181 # Location of fresh bootdir output
ohair@29 182 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
ohair@29 183 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
ohair@29 184 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
ohair@29 185
ohair@29 186 create_fresh_product_bootdir: FRC
ohair@29 187 @$(START_ECHO)
ohair@29 188 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
ohair@29 189 NO_DOCS=true \
ohair@29 190 BOOT_CYCLE_SETTINGS= \
ohair@29 191 build_product_image
ohair@29 192 @$(FINISH_ECHO)
ohair@29 193
ohair@29 194 create_fresh_debug_bootdir: FRC
ohair@29 195 @$(START_ECHO)
ohair@29 196 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
ohair@29 197 NO_DOCS=true \
ohair@29 198 BOOT_CYCLE_DEBUG_SETTINGS= \
ohair@29 199 build_debug_image
ohair@29 200 @$(FINISH_ECHO)
ohair@29 201
ohair@29 202 create_fresh_fastdebug_bootdir: FRC
ohair@29 203 @$(START_ECHO)
ohair@29 204 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
ohair@29 205 NO_DOCS=true \
ohair@29 206 BOOT_CYCLE_DEBUG_SETTINGS= \
ohair@29 207 build_fastdebug_image
ohair@29 208 @$(FINISH_ECHO)
ohair@29 209
ohair@29 210 # Create boot image?
ohair@29 211 ifeq ($(SKIP_BOOT_CYCLE),false)
ohair@29 212 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
ohair@29 213 DO_BOOT_CYCLE=true
ohair@29 214 endif
ohair@29 215 endif
ohair@29 216
ohair@29 217 ifeq ($(DO_BOOT_CYCLE),true)
ohair@29 218
ohair@29 219 # Create the bootdir to use in the build
ohair@29 220 product_build:: create_fresh_product_bootdir
ohair@29 221 debug_build:: create_fresh_debug_bootdir
ohair@29 222 fastdebug_build:: create_fresh_fastdebug_bootdir
ohair@29 223
ohair@29 224 # Define variables to be used now for the boot jdk
ohair@29 225 BOOT_CYCLE_SETTINGS= \
ohair@29 226 ALT_BOOTDIR=$(FRESH_BOOTDIR) \
ohair@29 227 ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
ohair@29 228 BOOT_CYCLE_DEBUG_SETTINGS= \
ohair@29 229 ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
ohair@29 230 ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
ohair@29 231
ohair@29 232 else
ohair@29 233
ohair@29 234 # Use the supplied ALT_BOOTDIR as the boot
ohair@29 235 BOOT_CYCLE_SETTINGS=
ohair@29 236 BOOT_CYCLE_DEBUG_SETTINGS=
ohair@29 237
ohair@29 238 endif
ohair@29 239
ohair@29 240 build_product_image:
ohair@29 241 @$(START_ECHO)
ohair@29 242 $(MAKE) \
ohair@29 243 SKIP_FASTDEBUG_BUILD=true \
ohair@29 244 SKIP_DEBUG_BUILD=true \
ohair@29 245 $(BOOT_CYCLE_SETTINGS) \
ohair@29 246 generic_build_repo_series
ohair@29 247 @$(FINISH_ECHO)
ohair@29 248
ohair@29 249 generic_debug_build:
ohair@29 250 @$(START_ECHO)
ohair@29 251 $(MAKE) \
ohair@29 252 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
ohair@29 253 DEBUG_NAME=$(DEBUG_NAME) \
ohair@29 254 NO_DOCS=true \
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_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
ohair@6 299 OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
ohair@6 300 OPENJDK_BUILD_NAME \
ohair@6 301 = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
ohair@6 302 OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
ohair@6 303 BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image
ohair@6 304 ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
ohair@6 305 OPENJDK_BOOTDIR=$(BOOTDIR)
ohair@6 306 OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH)
ohair@6 307 else
ohair@6 308 OPENJDK_BOOTDIR=$(BUILT_IMAGE)
ohair@6 309 OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
ohair@6 310 endif
ohair@6 311
ohair@6 312 openjdk_build:
ohair@29 313 @$(START_ECHO)
duke@2 314 @$(ECHO) " "
duke@2 315 @$(ECHO) "================================================="
duke@2 316 @$(ECHO) "Starting openjdk build"
ohair@6 317 @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
duke@2 318 @$(ECHO) "================================================="
duke@2 319 @$(ECHO) " "
ohair@6 320 $(RM) -r $(OPENJDK_OUTPUTDIR)
ohair@6 321 $(MKDIR) -p $(OPENJDK_OUTPUTDIR)
ohair@6 322 ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
ohair@6 323 OPENJDK=true \
ohair@29 324 NO_DOCS=true \
ohair@6 325 ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
ohair@6 326 ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
ohair@6 327 ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \
ohair@6 328 ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
ohair@6 329 ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
ohair@6 330 product_build )
duke@2 331 $(RM) $(OPENJDK_BUILD_BINARY_ZIP)
ohair@6 332 ( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
duke@2 333 $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
ohair@6 334 $(RM) -r $(OPENJDK_OUTPUTDIR)
ohair@6 335 @$(ECHO) " "
ohair@6 336 @$(ECHO) "================================================="
ohair@6 337 @$(ECHO) "Finished openjdk build"
ohair@6 338 @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
ohair@6 339 @$(ECHO) "================================================="
ohair@6 340 @$(ECHO) " "
ohair@29 341 @$(FINISH_ECHO)
ohair@6 342
duke@2 343 endif
duke@2 344 endif
duke@2 345 endif
duke@2 346
duke@2 347 clobber::
duke@2 348 $(RM) -r $(OUTPUTDIR)/*
duke@2 349 $(RM) -r $(OUTPUTDIR)-debug/*
duke@2 350 $(RM) -r $(OUTPUTDIR)-fastdebug/*
duke@2 351 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
duke@2 352
duke@2 353 clean: clobber
duke@2 354
ohair@29 355 #
ohair@29 356 # Dev builds
ohair@29 357 #
ohair@29 358
ohair@29 359 dev : dev-build
ohair@29 360
ohair@29 361 dev-build:
ohair@29 362 $(MAKE) DEV_ONLY=true all
ohair@29 363 dev-sanity:
ohair@29 364 $(MAKE) DEV_ONLY=true sanity
ohair@29 365 dev-clobber:
ohair@29 366 $(MAKE) DEV_ONLY=true clobber
duke@2 367
duke@2 368 #
duke@2 369 # Quick jdk verification build
duke@2 370 #
duke@2 371 jdk_only:
duke@2 372 $(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
duke@2 373
duke@2 374
duke@2 375 #
duke@2 376 # Quick jdk verification fastdebug build
duke@2 377 #
duke@2 378 jdk_fastdebug_only:
duke@2 379 $(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
duke@2 380 BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
duke@2 381
duke@2 382 #
duke@2 383 # Quick deploy verification fastdebug build
duke@2 384 #
duke@2 385 deploy_fastdebug_only:
duke@2 386 $(MAKE) \
duke@2 387 DEBUG_NAME=fastdebug \
duke@2 388 BUILD_HOTSPOT=false \
duke@2 389 BUILD_JDK=false \
duke@2 390 BUILD_LANGTOOLS=false \
duke@2 391 BUILD_CORBA=false \
duke@2 392 BUILD_JAXP=false \
duke@2 393 BUILD_JAXWS=false \
duke@2 394 BUILD_INSTALL=false \
duke@2 395 BUILD_SPONSORS=false \
duke@2 396 generic_debug_build
duke@2 397
duke@2 398 #
duke@2 399 # Product build (skip debug builds)
duke@2 400 #
duke@2 401 product_only:
duke@2 402 $(MAKE) SKIP_FASTDEBUG_BUILD=true all
duke@2 403
duke@2 404 #
duke@2 405 # Check target
duke@2 406 #
duke@2 407
duke@2 408 check: variable_check
duke@2 409
duke@2 410 #
duke@2 411 # Help target
duke@2 412 #
duke@2 413 help: intro_help target_help variable_help notes_help examples_help
duke@2 414
duke@2 415 # Intro help message
duke@2 416 intro_help:
duke@2 417 @$(ECHO) "\
duke@2 418 Makefile for the JDK builds (all the JDK). \n\
duke@2 419 "
duke@2 420
duke@2 421 # Target help
duke@2 422 target_help:
duke@2 423 @$(ECHO) "\
duke@2 424 --- Common Targets --- \n\
duke@2 425 all -- build the core JDK (default target) \n\
duke@2 426 help -- Print out help information \n\
duke@2 427 check -- Check make variable values for correctness \n\
duke@2 428 sanity -- Perform detailed sanity checks on system and settings \n\
duke@2 429 fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
duke@2 430 debug_build -- build the core JDK in 'debug' mode (-g) \n\
duke@2 431 clean -- remove all built and imported files \n\
duke@2 432 clobber -- same as clean \n\
duke@2 433 "
duke@2 434
duke@2 435 # Variable help (only common ones used by this Makefile)
duke@2 436 variable_help: variable_help_intro variable_list variable_help_end
duke@2 437 variable_help_intro:
duke@2 438 @$(ECHO) "--- Common Variables ---"
duke@2 439 variable_help_end:
duke@2 440 @$(ECHO) " "
duke@2 441
duke@2 442 # One line descriptions for the variables
duke@2 443 OUTPUTDIR.desc = Output directory
duke@2 444 PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
duke@2 445 SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
duke@2 446 BOOTDIR.desc = JDK used to boot the build
duke@2 447 JDK_IMPORT_PATH.desc = JDK used to import components of the build
duke@2 448 COMPILER_PATH.desc = Compiler install directory
duke@2 449 CACERTS_FILE.desc = Location of certificates file
duke@2 450 DEVTOOLS_PATH.desc = Directory containing zip and gnumake
duke@2 451 CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
duke@2 452 DXSDK_PATH.desc = Root directory of DirectX SDK
duke@2 453 MSDEVTOOLS_PATH.desc = Root directory of VC++ tools (e.g. rc.exe)
duke@2 454 MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
duke@2 455
duke@2 456 # Make variables to print out (description and value)
duke@2 457 VARIABLE_PRINTVAL_LIST += \
duke@2 458 OUTPUTDIR \
duke@2 459 PARALLEL_COMPILE_JOBS \
duke@2 460 SLASH_JAVA \
duke@2 461 BOOTDIR \
duke@2 462 JDK_IMPORT_PATH \
duke@2 463 COMPILER_PATH \
duke@2 464 CACERTS_FILE \
duke@2 465 DEVTOOLS_PATH
duke@2 466
duke@2 467 # Make variables that should refer to directories that exist
duke@2 468 VARIABLE_CHECKDIR_LIST += \
duke@2 469 SLASH_JAVA \
duke@2 470 BOOTDIR \
duke@2 471 JDK_IMPORT_PATH \
duke@2 472 COMPILER_PATH \
duke@2 473 DEVTOOLS_PATH
duke@2 474
duke@2 475 # Make variables that should refer to files that exist
duke@2 476 VARIABLE_CHECKFIL_LIST += \
duke@2 477 CACERTS_FILE
duke@2 478
duke@2 479 # Some are windows specific
duke@2 480 ifeq ($(PLATFORM), windows)
duke@2 481
duke@2 482 VARIABLE_PRINTVAL_LIST += \
duke@2 483 DXSDK_PATH \
duke@2 484 MSDEVTOOLS_PATH \
duke@2 485 MSVCRT_DLL_PATH
duke@2 486
duke@2 487 VARIABLE_CHECKDIR_LIST += \
duke@2 488 DXSDK_PATH \
duke@2 489 MSDEVTOOLS_PATH \
duke@2 490 MSVCRT_DLL_PATH
duke@2 491
duke@2 492 endif
duke@2 493
duke@2 494 # For pattern rules below, so all are treated the same
duke@2 495 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
duke@2 496 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
duke@2 497 DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
duke@2 498
duke@2 499 # Complete variable check
duke@2 500 variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
duke@2 501 variable_list: $(DO_PRINTVAL_LIST) variable_check
duke@2 502
duke@2 503 # Pattern rule for printing out a variable
duke@2 504 %.printval:
duke@2 505 @$(ECHO) " ALT_$* - $($*.desc)"
duke@2 506 @$(ECHO) " \t $*=$($*)"
duke@2 507
duke@2 508 # Pattern rule for checking to see if a variable with a directory exists
duke@2 509 %.checkdir:
duke@2 510 @if [ ! -d $($*) ] ; then \
duke@2 511 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@2 512 fi
duke@2 513
duke@2 514 # Pattern rule for checking to see if a variable with a file exists
duke@2 515 %.checkfil:
duke@2 516 @if [ ! -f $($*) ] ; then \
duke@2 517 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@2 518 fi
duke@2 519
duke@2 520 # Misc notes on help
duke@2 521 notes_help:
duke@2 522 @$(ECHO) "\
duke@2 523 --- Notes --- \n\
duke@2 524 - All builds use same output directory unless overridden with \n\
duke@2 525 \t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
duke@2 526 \t to use the clean target first. \n\
duke@2 527 - JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
duke@2 528 \t builds or previous release JDK builds will work. \n\
duke@2 529 - The fastest builds have been when the sources and the BOOTDIR are on \n\
duke@2 530 \t local disk. \n\
duke@2 531 "
duke@2 532
duke@2 533 examples_help:
duke@2 534 @$(ECHO) "\
duke@2 535 --- Examples --- \n\
duke@2 536 $(MAKE) fastdebug_build \n\
duke@2 537 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
duke@2 538 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
duke@2 539 $(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
duke@2 540 $(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
duke@2 541 $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
duke@2 542 "
duke@2 543
duke@2 544 ################################################################
duke@2 545 # Source and binary plug bundling
duke@2 546 ################################################################
duke@2 547 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
duke@2 548 include $(BUNDLE_RULES)
duke@2 549 endif
duke@2 550
duke@2 551 ################################################################
duke@2 552 # JPRT rule to build
duke@2 553 ################################################################
duke@2 554
duke@2 555 include ./make/jprt.gmk
duke@2 556
duke@2 557 ################################################################
duke@2 558 # PHONY
duke@2 559 ################################################################
duke@2 560
ohair@29 561 .PHONY: all \
ohair@29 562 generic_build_repo_series \
ohair@29 563 what clobber insane \
ohair@29 564 dev dev-build dev-sanity dev-clobber \
ohair@29 565 product_build \
ohair@29 566 fastdebug_build \
ohair@29 567 debug_build \
ohair@29 568 build_product_image \
ohair@29 569 build_debug_image \
ohair@29 570 build_fastdebug_image \
ohair@29 571 create_fresh_product_bootdir \
ohair@29 572 create_fresh_debug_bootdir \
ohair@29 573 create_fresh_fastdebug_bootdir \
ohair@29 574 generic_debug_build
duke@2 575
ohair@7 576 # Force target
ohair@7 577 FRC:
ohair@7 578

mercurial