annotate make/Makefile @ 1464:e0a1a502e402

Added tag jdk7-b90 for changeset 605c9707a766
author mikejwre
date Thu, 22 Apr 2010 16:54:23 -0700
parents 354d3184f6b2 7fbf850d87b7
children 7b37a2f64f17 c18cbe5936b8
rev   line source
duke@0 1 #
dcubed@1266 2 # Copyright 2005-2010 Sun Microsystems, Inc. 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
duke@0 7 # published by the Free Software Foundation.
duke@0 8 #
duke@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 # accompanied this code).
duke@0 14 #
duke@0 15 # You should have received a copy of the GNU General Public License version
duke@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 #
duke@0 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 20 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 21 # have any questions.
duke@0 22 #
duke@0 23 #
duke@0 24
duke@0 25 # Top level gnumake file for hotspot builds
duke@0 26 #
duke@0 27 # Default is to build the both product images and construct an export dir.
duke@0 28 # The default export directory name is `pwd`/export-$(PLATFORM).
duke@0 29 #
duke@0 30 # Use: 'gnumake help' for more information.
duke@0 31 #
duke@0 32 # This makefile uses the default settings for where to find compilers and
duke@0 33 # tools, and obeys the ALT_* variable settings used by the other JDK
duke@0 34 # workspaces.
duke@0 35 #
duke@0 36
duke@0 37 # Expected/optional make variables defined on make command line:
duke@0 38 # LP64=1 or ARCH_DATA_MODEL=64 for 64bit build
duke@0 39 #
duke@0 40 # Expected/optional make variables or environment variables:
duke@0 41 # ALT_SLASH_JAVA Location of /java or J:
duke@0 42 # ALT_BOOTDIR Previous JDK home directory for javac compiler
duke@0 43 # ALT_OUTPUTDIR Output directory to use for hotspot build
duke@0 44 # ALT_EXPORT_PATH Directory to export hotspot build to
duke@0 45 # ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules)
duke@0 46 # ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
duke@0 47 # Set ALT_BUILD_WIN_SA=1 to enable building SA on
duke@0 48 # Windows.
duke@0 49 # Version strings and numbers:
duke@0 50 # JDK_VERSION Current JDK version (e.g. 1.6.0)
duke@0 51 # PREVIOUS_JDK_VERSION Previous (bootdir) JDK version (e.g. 1.5.0)
duke@0 52 # FULL_VERSION Full version string to use (e.g. "1.6.0-ea-b42")
duke@0 53 #
duke@0 54 # Version strings and numbers especially needed on Windows:
duke@0 55 # COOKED_JDK_UPDATE_VERSION Just the update release number (e.g. 02)
duke@0 56 # COOKED_BUILD_NUMBER Just the build number (e.g. 42)
duke@0 57 # JDK_MKTG_VERSION Marketing JDK version (e.g. 6.0)
duke@0 58 # JDK_MAJOR_VERSION Major number for version (e.g. 1) always 1?
duke@0 59 # JDK_MINOR_VERSION Minor number for version (e.g. 6)
duke@0 60 # JDK_MICRO_VERSION Micro number for version (e.g. 0)
duke@0 61 #
duke@0 62
duke@0 63 # Default is build both product fastdebug and create export area
duke@0 64
duke@0 65 # Allow to build HotSpot in local directory from sources specified by GAMMADIR.
duke@0 66 # After make/defs.make GAMMADIR is defined.
duke@0 67 ifdef GAMMADIR
duke@0 68 ifndef ALT_OUTPUTDIR
duke@0 69 ALT_OUTPUTDIR := $(shell pwd)
duke@0 70 endif
duke@0 71 include $(GAMMADIR)/make/defs.make
duke@0 72 else
duke@0 73 include defs.make
duke@0 74 endif
duke@0 75
duke@0 76
duke@0 77 ifneq ($(ALT_OUTPUTDIR),)
duke@0 78 ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
duke@0 79 else
duke@0 80 ALT_OUT=
duke@0 81 endif
duke@0 82
duke@0 83 # Typical C1/C2 targets made available with this Makefile
duke@0 84 C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
duke@0 85 C2_VM_TARGETS=product fastdebug optimized jvmg
duke@0 86 KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
never@1069 87 ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
duke@0 88
coleenp@113 89 # JDK directory list
coleenp@113 90 JDK_DIRS=bin include jre lib demo
coleenp@113 91
duke@0 92 all: all_product all_fastdebug
duke@0 93 all_product: product product1 productkernel docs export_product
duke@0 94 all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
duke@0 95 all_debug: jvmg jvmg1 jvmgkernel docs export_debug
duke@0 96 all_optimized: optimized optimized1 optimizedkernel docs export_optimized
duke@0 97
never@1069 98 allzero: all_productzero all_fastdebugzero
never@1069 99 all_productzero: productzero docs export_product
never@1069 100 all_fastdebugzero: fastdebugzero docs export_fastdebug
never@1069 101 all_debugzero: jvmgzero docs export_debug
never@1069 102 all_optimizedzero: optimizedzero docs export_optimized
never@1069 103
duke@0 104 # Do everything
duke@0 105 world: all create_jdk
duke@0 106
duke@0 107 # Build or export docs
duke@0 108 docs:
duke@0 109 ifeq ($(OSNAME),windows)
duke@0 110 @$(ECHO) "No docs ($(VM_TARGET)) for windows"
duke@0 111 else
duke@0 112 $(CD) $(OUTPUTDIR); \
duke@0 113 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 114 $(MAKE_ARGS) docs
duke@0 115 endif
duke@0 116
duke@0 117 # Build variation of hotspot
duke@0 118 $(C1_VM_TARGETS):
duke@0 119 $(CD) $(GAMMADIR)/make; \
duke@0 120 $(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
duke@0 121
duke@0 122 $(C2_VM_TARGETS):
duke@0 123 $(CD) $(GAMMADIR)/make; \
duke@0 124 $(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
duke@0 125
duke@0 126 $(KERNEL_VM_TARGETS):
duke@0 127 $(CD) $(GAMMADIR)/make; \
duke@0 128 $(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
duke@0 129
never@1069 130 $(ZERO_VM_TARGETS):
never@1069 131 $(CD) $(GAMMADIR)/make; \
never@1069 132 $(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
never@1069 133
duke@0 134 # Build compiler1 (client) rule, different for platforms
duke@0 135 generic_build1:
duke@0 136 $(MKDIR) -p $(OUTPUTDIR)
duke@0 137 ifeq ($(OSNAME),windows)
duke@0 138 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 139 $(CD) $(OUTPUTDIR); \
duke@0 140 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 141 Variant=compiler1 \
duke@0 142 WorkSpace=$(ABS_GAMMADIR) \
duke@0 143 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 144 BuildUser=$(USERNAME) \
duke@0 145 $(MAKE_ARGS) $(VM_TARGET:%1=%)
duke@0 146 else
duke@0 147 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 148 endif
duke@0 149 else
duke@0 150 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 151 $(CD) $(OUTPUTDIR); \
duke@0 152 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 153 $(MAKE_ARGS) $(VM_TARGET)
duke@0 154 else
duke@0 155 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 156 endif
duke@0 157 endif
duke@0 158
duke@0 159 # Build compiler2 (server) rule, different for platforms
duke@0 160 generic_build2:
duke@0 161 $(MKDIR) -p $(OUTPUTDIR)
duke@0 162 ifeq ($(OSNAME),windows)
duke@0 163 $(CD) $(OUTPUTDIR); \
duke@0 164 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 165 Variant=compiler2 \
duke@0 166 WorkSpace=$(ABS_GAMMADIR) \
duke@0 167 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 168 BuildUser=$(USERNAME) \
duke@0 169 $(MAKE_ARGS) $(VM_TARGET)
duke@0 170 else
duke@0 171 $(CD) $(OUTPUTDIR); \
duke@0 172 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 173 $(MAKE_ARGS) $(VM_TARGET)
duke@0 174 endif
duke@0 175
duke@0 176 generic_buildkernel:
duke@0 177 $(MKDIR) -p $(OUTPUTDIR)
duke@0 178 ifeq ($(OSNAME),windows)
duke@0 179 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 180 $(CD) $(OUTPUTDIR); \
duke@0 181 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 182 Variant=kernel \
duke@0 183 WorkSpace=$(ABS_GAMMADIR) \
duke@0 184 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 185 BuildUser=$(USERNAME) \
duke@0 186 $(MAKE_ARGS) $(VM_TARGET:%kernel=%)
duke@0 187 else
duke@0 188 @$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 189 endif
duke@0 190 else
duke@0 191 @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
duke@0 192 endif
duke@0 193
never@1069 194 generic_buildzero:
never@1069 195 $(MKDIR) -p $(OUTPUTDIR)
never@1069 196 $(CD) $(OUTPUTDIR); \
never@1069 197 $(MAKE) -f $(ABS_OS_MAKEFILE) \
never@1069 198 $(MAKE_ARGS) $(VM_TARGET)
never@1069 199
duke@0 200 # Export file rule
duke@0 201 generic_export: $(EXPORT_LIST)
duke@0 202 export_product:
duke@0 203 $(MAKE) VM_SUBDIR=product generic_export
duke@0 204 export_fastdebug:
duke@0 205 $(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
duke@0 206 export_debug:
duke@0 207 $(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug generic_export
duke@0 208 export_optimized:
duke@0 209 $(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
duke@0 210 export_product_jdk:
duke@0 211 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
duke@0 212 VM_SUBDIR=product generic_export
duke@0 213 export_optimized_jdk:
duke@0 214 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
duke@0 215 VM_SUBDIR=optimized generic_export
duke@0 216 export_fastdebug_jdk:
duke@0 217 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
duke@0 218 VM_SUBDIR=fastdebug generic_export
duke@0 219 export_debug_jdk:
duke@0 220 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
duke@0 221 VM_SUBDIR=${VM_DEBUG} generic_export
duke@0 222
duke@0 223
duke@0 224 # Export file copy rules
duke@0 225 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
duke@0 226 DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
duke@0 227 C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
duke@0 228 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
duke@0 229 KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
never@1069 230 ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
duke@0 231 C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
duke@0 232 C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
duke@0 233 KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
never@1069 234 ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
duke@0 235
duke@0 236 # Misc files and generated files need to come from C1 or C2 area
never@1069 237 ifeq ($(ZERO_BUILD), true)
never@1069 238 MISC_DIR=$(ZERO_DIR)
never@1069 239 GEN_DIR=$(ZERO_BASE_DIR)/generated
never@1069 240 else
duke@0 241 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 242 MISC_DIR=$(C1_DIR)
duke@0 243 GEN_DIR=$(C1_BASE_DIR)/generated
duke@0 244 else
duke@0 245 MISC_DIR=$(C2_DIR)
duke@0 246 GEN_DIR=$(C2_BASE_DIR)/generated
duke@0 247 endif
never@1069 248 endif
duke@0 249
duke@0 250 # Bin files (windows)
duke@0 251 ifeq ($(OSNAME),windows)
duke@0 252
duke@0 253 # Get jvm.lib
duke@0 254 $(EXPORT_LIB_DIR)/%.lib: $(MISC_DIR)/%.lib
duke@0 255 $(install-file)
duke@0 256
duke@0 257 # Other libraries (like SA)
duke@0 258 $(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
duke@0 259 $(install-file)
duke@0 260 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
duke@0 261 $(install-file)
duke@0 262 $(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
duke@0 263 $(install-file)
duke@0 264
duke@0 265 # Client files always come from C1 area
duke@0 266 $(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
duke@0 267 $(install-file)
duke@0 268 $(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
duke@0 269 $(install-file)
duke@0 270 $(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
duke@0 271 $(install-file)
duke@0 272
duke@0 273 # Server files always come from C2 area
duke@0 274 $(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
duke@0 275 $(install-file)
duke@0 276 $(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb
duke@0 277 $(install-file)
duke@0 278 $(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map
duke@0 279 $(install-file)
duke@0 280
duke@0 281 # Kernel files always come from kernel area
duke@0 282 $(EXPORT_KERNEL_DIR)/%.dll: $(KERNEL_DIR)/%.dll
duke@0 283 $(install-file)
duke@0 284 $(EXPORT_KERNEL_DIR)/%.pdb: $(KERNEL_DIR)/%.pdb
duke@0 285 $(install-file)
duke@0 286 $(EXPORT_KERNEL_DIR)/%.map: $(KERNEL_DIR)/%.map
duke@0 287 $(install-file)
duke@0 288 endif
duke@0 289
duke@0 290 # Shared Library
duke@0 291 ifneq ($(OSNAME),windows)
never@1069 292 ifeq ($(ZERO_BUILD), true)
never@1069 293 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
never@1069 294 $(install-file)
never@1069 295 $(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
never@1069 296 $(install-file)
never@1069 297 else
duke@0 298 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
duke@0 299 $(install-file)
duke@0 300 $(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
duke@0 301 $(install-file)
duke@0 302 $(EXPORT_CLIENT_DIR)/64/%.so: $(C1_DIR)/%.so
duke@0 303 $(install-file)
duke@0 304 $(EXPORT_SERVER_DIR)/%.so: $(C2_DIR)/%.so
duke@0 305 $(install-file)
duke@0 306 $(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
duke@0 307 $(install-file)
never@1069 308 endif
duke@0 309 endif
duke@0 310
duke@0 311 # Jar file (sa-jdi.jar)
duke@0 312 $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
duke@0 313 $(install-file)
duke@0 314
dcubed@1266 315 # Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
duke@0 316 $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
duke@0 317 $(install-file)
duke@0 318
dcubed@1266 319 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
dcubed@1266 320 $(install-file)
dcubed@1266 321
duke@0 322 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
duke@0 323 $(install-file)
duke@0 324
duke@0 325 $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h
duke@0 326 $(install-file)
duke@0 327
duke@0 328 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
duke@0 329 $(install-file)
duke@0 330
duke@0 331 # Doc files (jvmti.html)
duke@0 332 $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
duke@0 333 $(install-file)
duke@0 334
duke@0 335 # Xusage file
duke@0 336 $(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
duke@0 337 $(prep-target)
duke@0 338 $(RM) $@.temp
duke@0 339 $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
duke@0 340 $(MV) $@.temp $@
duke@0 341
duke@0 342 #
duke@0 343 # Clean rules
duke@0 344 #
duke@0 345 clobber clean: clean_build clean_export clean_jdk
duke@0 346 clean_build:
duke@0 347 $(RM) -r $(C1_DIR)
duke@0 348 $(RM) -r $(C2_DIR)
duke@0 349 $(RM) -r $(KERNEL_DIR)
never@1069 350 $(RM) -r $(ZERO_DIR)
duke@0 351 clean_export:
duke@0 352 $(RM) -r $(EXPORT_PATH)
duke@0 353 clean_jdk:
duke@0 354 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 355
duke@0 356 #
duke@0 357 # Create JDK and place this build into it
duke@0 358 #
duke@0 359 create_jdk: copy_jdk update_jdk
duke@0 360
duke@0 361 update_jdk: export_product_jdk export_fastdebug_jdk test_jdk
duke@0 362
duke@0 363 copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar
duke@0 364
duke@0 365 $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
duke@0 366 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 367 $(MKDIR) -p $(JDK_IMAGE_DIR)
duke@0 368 ($(CD) $(JDK_IMPORT_PATH) && \
duke@0 369 $(TAR) -cf - *) | \
duke@0 370 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
duke@0 371
duke@0 372 test_jdk:
never@1069 373 ifneq ($(ZERO_BUILD), true)
never@1069 374 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 375 $(JDK_IMAGE_DIR)/bin/java -client -version
never@1069 376 endif
duke@0 377 endif
duke@0 378 $(JDK_IMAGE_DIR)/bin/java -server -version
duke@0 379
duke@0 380 copy_product_jdk:
duke@0 381 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 382 $(MKDIR) -p $(JDK_IMAGE_DIR)
duke@0 383 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 384 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 385 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
duke@0 386
duke@0 387 copy_fastdebug_jdk:
duke@0 388 $(RM) -r $(JDK_IMAGE_DIR)/fastdebug
duke@0 389 $(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
duke@0 390 if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
duke@0 391 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
coleenp@113 392 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 393 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
duke@0 394 else \
duke@0 395 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 396 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 397 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
duke@0 398 fi
duke@0 399
duke@0 400 copy_debug_jdk:
duke@0 401 $(RM) -r $(JDK_IMAGE_DIR)/debug
duke@0 402 $(MKDIR) -p $(JDK_IMAGE_DIR)/debug
duke@0 403 if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
duke@0 404 ($(CD) $(JDK_IMPORT_PATH)/debug && \
coleenp@113 405 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 406 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 407 elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
duke@0 408 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
coleenp@113 409 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 410 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 411 else \
duke@0 412 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 413 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 414 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 415 fi
duke@0 416
duke@0 417 #
duke@0 418 # Check target
duke@0 419 #
duke@0 420 check: variable_check
duke@0 421
duke@0 422 #
duke@0 423 # Help target
duke@0 424 #
duke@0 425 help: intro_help target_help variable_help notes_help examples_help
duke@0 426
duke@0 427 # Intro help message
duke@0 428 intro_help:
duke@0 429 @$(ECHO) \
duke@0 430 "Makefile for the Hotspot workspace."
duke@0 431 @$(ECHO) \
duke@0 432 "Default behavior is to build and create an export area for the j2se builds."
duke@0 433
duke@0 434 # Target help
duke@0 435 target_help:
duke@0 436 @$(ECHO) "help: This help message"
duke@0 437 @$(ECHO) "all: Same as: all_product all_fastdebug"
duke@0 438 @$(ECHO) "world: Same as: all create_jdk"
duke@0 439 @$(ECHO) "all_product: Same as: product product1 export_product"
duke@0 440 @$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug"
duke@0 441 @$(ECHO) "all_debug: Same as: jvmg jvmg1 export_debug"
duke@0 442 @$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized"
duke@0 443 @$(ECHO) "clean: Clean all areas"
duke@0 444 @$(ECHO) "export_product: Export product files to EXPORT_PATH"
duke@0 445 @$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
duke@0 446 @$(ECHO) "export_debug: Export debug files to EXPORT_PATH"
duke@0 447 @$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
duke@0 448 @$(ECHO) "create_jdk: Create JDK image, export all files into it"
duke@0 449 @$(ECHO) "update_jdk: Update JDK image with fresh exported files"
duke@0 450 @$(ECHO) " "
duke@0 451 @$(ECHO) "Others targets are:"
duke@0 452 @$(ECHO) " $(C1_VM_TARGETS)"
duke@0 453 @$(ECHO) " $(C2_VM_TARGETS)"
duke@0 454 @$(ECHO) " $(KERNEL_VM_TARGETS)"
duke@0 455
duke@0 456 # Variable help (only common ones used by this workspace)
duke@0 457 variable_help: variable_help_intro variable_list variable_help_end
duke@0 458 variable_help_intro:
duke@0 459 @$(ECHO) "--- Common Variables ---"
duke@0 460 variable_help_end:
duke@0 461 @$(ECHO) " "
duke@0 462 @$(ECHO) "--- Make Arguments ---"
duke@0 463 @$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"
duke@0 464
duke@0 465 # One line descriptions for the variables
duke@0 466 SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
duke@0 467 OUTPUTDIR.desc = Output directory, default is build/<osname>
duke@0 468 BOOTDIR.desc = JDK used to compile agent java source and test with
duke@0 469 JDK_IMPORT_PATH.desc = Promoted JDK to copy for 'create_jdk'
duke@0 470 EXPORT_PATH.desc = Directory to place files to export for JDK build
duke@0 471
duke@0 472 # Make variables to print out (description and value)
duke@0 473 VARIABLE_PRINTVAL_LIST += \
duke@0 474 SLASH_JAVA \
duke@0 475 OUTPUTDIR \
duke@0 476 BOOTDIR \
duke@0 477 JDK_IMPORT_PATH \
duke@0 478 EXPORT_PATH
duke@0 479
duke@0 480 # Make variables that should refer to directories that exist
duke@0 481 VARIABLE_CHECKDIR_LIST += \
duke@0 482 SLASH_JAVA \
duke@0 483 BOOTDIR \
duke@0 484 JDK_IMPORT_PATH
duke@0 485
duke@0 486 # For pattern rules below, so all are treated the same
duke@0 487 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
duke@0 488 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
duke@0 489
duke@0 490 # Complete variable check
duke@0 491 variable_check: $(DO_CHECKDIR_LIST)
duke@0 492 variable_list: $(DO_PRINTVAL_LIST) variable_check
duke@0 493
duke@0 494 # Pattern rule for printing out a variable
duke@0 495 %.printval:
duke@0 496 @$(ECHO) " ALT_$* - $($*.desc)"
duke@0 497 @$(ECHO) " $*=$($*)"
duke@0 498
duke@0 499 # Pattern rule for checking to see if a variable with a directory exists
duke@0 500 %.checkdir:
duke@0 501 @if [ ! -d $($*) ] ; then \
duke@0 502 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@0 503 fi
duke@0 504
duke@0 505 # Pattern rule for checking to see if a variable with a file exists
duke@0 506 %.checkfil:
duke@0 507 @if [ ! -f $($*) ] ; then \
duke@0 508 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@0 509 fi
duke@0 510
duke@0 511 # Misc notes on help
duke@0 512 notes_help:
duke@0 513 @$(ECHO) \
duke@0 514 "--- Notes --- "
duke@0 515 @$(ECHO) \
duke@0 516 "- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
duke@0 517 @$(ECHO) \
duke@0 518 " builds or previous release JDK builds will work."
duke@0 519 @$(ECHO) \
duke@0 520 "- The fastest builds have been when the workspace and the BOOTDIR are on"
duke@0 521 @$(ECHO) \
duke@0 522 " local disk."
duke@0 523
duke@0 524 examples_help:
duke@0 525 @$(ECHO) \
duke@0 526 "--- Examples --- "
duke@0 527 @$(ECHO) \
duke@0 528 " $(MAKE) all"
duke@0 529 @$(ECHO) \
duke@0 530 " $(MAKE) world"
duke@0 531 @$(ECHO) \
duke@0 532 " $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)"
duke@0 533 @$(ECHO) \
duke@0 534 " $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"
duke@0 535
duke@0 536 # JPRT rule to build this workspace
duke@0 537 include $(GAMMADIR)/make/jprt.gmk
duke@0 538
duke@0 539 .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
duke@0 540 $(KERNEL_VM_TARGETS) \
duke@0 541 generic_build1 generic_build2 generic_buildkernel generic_export \
duke@0 542 export_product export_fastdebug export_debug export_optimized \
duke@0 543 export_jdk_product export_jdk_fastdebug export_jdk_debug \
duke@0 544 create_jdk copy_jdk update_jdk test_jdk \
duke@0 545 copy_product_jdk copy_fastdebug_jdk copy_debug_jdk
duke@0 546