annotate make/Makefile @ 2042:0a8e0d4345b3

7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass Summary: Update the copyright to be 2010 on all changed files in OpenJDK Reviewed-by: jcoomes
author trims
date Mon, 03 Jan 2011 15:30:05 -0800
parents 126ea7725993
children 2d26b0046e0d b92c45f2bc75
rev   line source
duke@0 1 #
trims@1552 2 # Copyright (c) 2005, 2010, 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
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 #
trims@1552 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1552 20 # or visit www.oracle.com if you need additional information or have any
trims@1552 21 # 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@1010 87 ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
twisti@1692 88 SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
duke@0 89
coleenp@113 90 # JDK directory list
coleenp@113 91 JDK_DIRS=bin include jre lib demo
coleenp@113 92
duke@0 93 all: all_product all_fastdebug
bobv@1681 94 ifndef BUILD_CLIENT_ONLY
duke@0 95 all_product: product product1 productkernel docs export_product
duke@0 96 all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
duke@0 97 all_debug: jvmg jvmg1 jvmgkernel docs export_debug
bobv@1681 98 else
bobv@1681 99 all_product: product1 docs export_product
bobv@1681 100 all_fastdebug: fastdebug1 docs export_fastdebug
bobv@1681 101 all_debug: jvmg1 docs export_debug
bobv@1681 102 endif
duke@0 103 all_optimized: optimized optimized1 optimizedkernel docs export_optimized
duke@0 104
never@1010 105 allzero: all_productzero all_fastdebugzero
never@1010 106 all_productzero: productzero docs export_product
never@1010 107 all_fastdebugzero: fastdebugzero docs export_fastdebug
never@1010 108 all_debugzero: jvmgzero docs export_debug
never@1010 109 all_optimizedzero: optimizedzero docs export_optimized
never@1010 110
twisti@1692 111 allshark: all_productshark all_fastdebugshark
twisti@1692 112 all_productshark: productshark docs export_product
twisti@1692 113 all_fastdebugshark: fastdebugshark docs export_fastdebug
twisti@1692 114 all_debugshark: jvmgshark docs export_debug
twisti@1692 115 all_optimizedshark: optimizedshark docs export_optimized
twisti@1692 116
duke@0 117 # Do everything
duke@0 118 world: all create_jdk
duke@0 119
duke@0 120 # Build or export docs
duke@0 121 docs:
duke@0 122 ifeq ($(OSNAME),windows)
duke@0 123 @$(ECHO) "No docs ($(VM_TARGET)) for windows"
duke@0 124 else
duke@0 125 $(CD) $(OUTPUTDIR); \
duke@0 126 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 127 $(MAKE_ARGS) docs
duke@0 128 endif
duke@0 129
duke@0 130 # Build variation of hotspot
duke@0 131 $(C1_VM_TARGETS):
duke@0 132 $(CD) $(GAMMADIR)/make; \
duke@0 133 $(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
duke@0 134
duke@0 135 $(C2_VM_TARGETS):
duke@0 136 $(CD) $(GAMMADIR)/make; \
duke@0 137 $(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
duke@0 138
duke@0 139 $(KERNEL_VM_TARGETS):
duke@0 140 $(CD) $(GAMMADIR)/make; \
duke@0 141 $(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
duke@0 142
never@1010 143 $(ZERO_VM_TARGETS):
never@1010 144 $(CD) $(GAMMADIR)/make; \
never@1010 145 $(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
never@1010 146
twisti@1692 147 $(SHARK_VM_TARGETS):
twisti@1692 148 $(CD) $(GAMMADIR)/make; \
twisti@1692 149 $(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
twisti@1692 150
duke@0 151 # Build compiler1 (client) rule, different for platforms
duke@0 152 generic_build1:
duke@0 153 $(MKDIR) -p $(OUTPUTDIR)
duke@0 154 ifeq ($(OSNAME),windows)
duke@0 155 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 156 $(CD) $(OUTPUTDIR); \
duke@0 157 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 158 Variant=compiler1 \
duke@0 159 WorkSpace=$(ABS_GAMMADIR) \
duke@0 160 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 161 BuildUser=$(USERNAME) \
duke@0 162 $(MAKE_ARGS) $(VM_TARGET:%1=%)
duke@0 163 else
duke@0 164 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 165 endif
duke@0 166 else
duke@0 167 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 168 $(CD) $(OUTPUTDIR); \
duke@0 169 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 170 $(MAKE_ARGS) $(VM_TARGET)
duke@0 171 else
duke@0 172 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 173 endif
duke@0 174 endif
duke@0 175
duke@0 176 # Build compiler2 (server) rule, different for platforms
duke@0 177 generic_build2:
duke@0 178 $(MKDIR) -p $(OUTPUTDIR)
duke@0 179 ifeq ($(OSNAME),windows)
duke@0 180 $(CD) $(OUTPUTDIR); \
duke@0 181 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 182 Variant=compiler2 \
duke@0 183 WorkSpace=$(ABS_GAMMADIR) \
duke@0 184 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 185 BuildUser=$(USERNAME) \
duke@0 186 $(MAKE_ARGS) $(VM_TARGET)
duke@0 187 else
duke@0 188 $(CD) $(OUTPUTDIR); \
duke@0 189 $(MAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 190 $(MAKE_ARGS) $(VM_TARGET)
duke@0 191 endif
duke@0 192
duke@0 193 generic_buildkernel:
duke@0 194 $(MKDIR) -p $(OUTPUTDIR)
duke@0 195 ifeq ($(OSNAME),windows)
duke@0 196 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 197 $(CD) $(OUTPUTDIR); \
duke@0 198 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
duke@0 199 Variant=kernel \
duke@0 200 WorkSpace=$(ABS_GAMMADIR) \
duke@0 201 BootStrapDir=$(ABS_BOOTDIR) \
duke@0 202 BuildUser=$(USERNAME) \
duke@0 203 $(MAKE_ARGS) $(VM_TARGET:%kernel=%)
duke@0 204 else
duke@0 205 @$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
duke@0 206 endif
duke@0 207 else
duke@0 208 @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
duke@0 209 endif
duke@0 210
never@1010 211 generic_buildzero:
never@1010 212 $(MKDIR) -p $(OUTPUTDIR)
never@1010 213 $(CD) $(OUTPUTDIR); \
never@1010 214 $(MAKE) -f $(ABS_OS_MAKEFILE) \
never@1010 215 $(MAKE_ARGS) $(VM_TARGET)
never@1010 216
twisti@1692 217 generic_buildshark:
twisti@1692 218 $(MKDIR) -p $(OUTPUTDIR)
twisti@1692 219 $(CD) $(OUTPUTDIR); \
twisti@1692 220 $(MAKE) -f $(ABS_OS_MAKEFILE) \
twisti@1692 221 $(MAKE_ARGS) $(VM_TARGET)
twisti@1692 222
duke@0 223 # Export file rule
duke@0 224 generic_export: $(EXPORT_LIST)
duke@0 225 export_product:
duke@0 226 $(MAKE) VM_SUBDIR=product generic_export
duke@0 227 export_fastdebug:
duke@0 228 $(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
duke@0 229 export_debug:
duke@0 230 $(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug generic_export
duke@0 231 export_optimized:
duke@0 232 $(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
duke@0 233 export_product_jdk:
duke@0 234 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
duke@0 235 VM_SUBDIR=product generic_export
duke@0 236 export_optimized_jdk:
duke@0 237 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
duke@0 238 VM_SUBDIR=optimized generic_export
duke@0 239 export_fastdebug_jdk:
duke@0 240 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
duke@0 241 VM_SUBDIR=fastdebug generic_export
duke@0 242 export_debug_jdk:
duke@0 243 $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
duke@0 244 VM_SUBDIR=${VM_DEBUG} generic_export
duke@0 245
duke@0 246
duke@0 247 # Export file copy rules
duke@0 248 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
duke@0 249 DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
duke@0 250 C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
duke@0 251 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
duke@0 252 KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
never@1010 253 ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
twisti@1692 254 SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
duke@0 255 C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
duke@0 256 C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
duke@0 257 KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
never@1010 258 ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
twisti@1692 259 SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
duke@0 260
duke@0 261 # Misc files and generated files need to come from C1 or C2 area
never@1010 262 ifeq ($(ZERO_BUILD), true)
twisti@1692 263 ifeq ($(SHARK_BUILD), true)
twisti@1692 264 MISC_DIR=$(SHARK_DIR)
twisti@1692 265 GEN_DIR=$(SHARK_BASE_DIR)/generated
twisti@1692 266 else
never@1010 267 MISC_DIR=$(ZERO_DIR)
never@1010 268 GEN_DIR=$(ZERO_BASE_DIR)/generated
twisti@1692 269 endif
never@1010 270 else
duke@0 271 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 272 MISC_DIR=$(C1_DIR)
duke@0 273 GEN_DIR=$(C1_BASE_DIR)/generated
duke@0 274 else
duke@0 275 MISC_DIR=$(C2_DIR)
duke@0 276 GEN_DIR=$(C2_BASE_DIR)/generated
duke@0 277 endif
never@1010 278 endif
duke@0 279
duke@0 280 # Bin files (windows)
duke@0 281 ifeq ($(OSNAME),windows)
duke@0 282
duke@0 283 # Get jvm.lib
duke@0 284 $(EXPORT_LIB_DIR)/%.lib: $(MISC_DIR)/%.lib
duke@0 285 $(install-file)
duke@0 286
duke@0 287 # Other libraries (like SA)
duke@0 288 $(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
duke@0 289 $(install-file)
duke@0 290 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
duke@0 291 $(install-file)
duke@0 292 $(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
duke@0 293 $(install-file)
duke@0 294
duke@0 295 # Client files always come from C1 area
duke@0 296 $(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
duke@0 297 $(install-file)
duke@0 298 $(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
duke@0 299 $(install-file)
duke@0 300 $(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
duke@0 301 $(install-file)
duke@0 302
duke@0 303 # Server files always come from C2 area
duke@0 304 $(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
duke@0 305 $(install-file)
duke@0 306 $(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb
duke@0 307 $(install-file)
duke@0 308 $(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map
duke@0 309 $(install-file)
duke@0 310
duke@0 311 # Kernel files always come from kernel area
duke@0 312 $(EXPORT_KERNEL_DIR)/%.dll: $(KERNEL_DIR)/%.dll
duke@0 313 $(install-file)
duke@0 314 $(EXPORT_KERNEL_DIR)/%.pdb: $(KERNEL_DIR)/%.pdb
duke@0 315 $(install-file)
duke@0 316 $(EXPORT_KERNEL_DIR)/%.map: $(KERNEL_DIR)/%.map
duke@0 317 $(install-file)
duke@0 318 endif
duke@0 319
duke@0 320 # Shared Library
duke@0 321 ifneq ($(OSNAME),windows)
never@1010 322 ifeq ($(ZERO_BUILD), true)
twisti@1692 323 ifeq ($(SHARK_BUILD), true)
twisti@1692 324 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
twisti@1692 325 $(install-file)
twisti@1692 326 $(EXPORT_SERVER_DIR)/%.so: $(SHARK_DIR)/%.so
twisti@1692 327 $(install-file)
twisti@1692 328 else
never@1010 329 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
never@1010 330 $(install-file)
never@1010 331 $(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
never@1010 332 $(install-file)
twisti@1692 333 endif
never@1010 334 else
bobv@1681 335 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
bobv@1681 336 $(install-file)
duke@0 337 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
duke@0 338 $(install-file)
duke@0 339 $(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
duke@0 340 $(install-file)
duke@0 341 $(EXPORT_CLIENT_DIR)/64/%.so: $(C1_DIR)/%.so
duke@0 342 $(install-file)
duke@0 343 $(EXPORT_SERVER_DIR)/%.so: $(C2_DIR)/%.so
duke@0 344 $(install-file)
duke@0 345 $(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
duke@0 346 $(install-file)
never@1010 347 endif
duke@0 348 endif
duke@0 349
duke@0 350 # Jar file (sa-jdi.jar)
duke@0 351 $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
duke@0 352 $(install-file)
duke@0 353
dcubed@1184 354 # Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
duke@0 355 $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
duke@0 356 $(install-file)
duke@0 357
dcubed@1184 358 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
dcubed@1184 359 $(install-file)
dcubed@1184 360
duke@0 361 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
duke@0 362 $(install-file)
duke@0 363
duke@0 364 $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h
duke@0 365 $(install-file)
duke@0 366
duke@0 367 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
duke@0 368 $(install-file)
duke@0 369
duke@0 370 # Doc files (jvmti.html)
duke@0 371 $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
duke@0 372 $(install-file)
duke@0 373
duke@0 374 # Xusage file
duke@0 375 $(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
duke@0 376 $(prep-target)
duke@0 377 $(RM) $@.temp
duke@0 378 $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
duke@0 379 $(MV) $@.temp $@
duke@0 380
duke@0 381 #
duke@0 382 # Clean rules
duke@0 383 #
duke@0 384 clobber clean: clean_build clean_export clean_jdk
duke@0 385 clean_build:
duke@0 386 $(RM) -r $(C1_DIR)
duke@0 387 $(RM) -r $(C2_DIR)
duke@0 388 $(RM) -r $(KERNEL_DIR)
never@1010 389 $(RM) -r $(ZERO_DIR)
twisti@1692 390 $(RM) -r $(SHARK_DIR)
duke@0 391 clean_export:
duke@0 392 $(RM) -r $(EXPORT_PATH)
duke@0 393 clean_jdk:
duke@0 394 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 395
duke@0 396 #
duke@0 397 # Create JDK and place this build into it
duke@0 398 #
duke@0 399 create_jdk: copy_jdk update_jdk
duke@0 400
duke@0 401 update_jdk: export_product_jdk export_fastdebug_jdk test_jdk
duke@0 402
duke@0 403 copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar
duke@0 404
duke@0 405 $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
duke@0 406 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 407 $(MKDIR) -p $(JDK_IMAGE_DIR)
duke@0 408 ($(CD) $(JDK_IMPORT_PATH) && \
duke@0 409 $(TAR) -cf - *) | \
duke@0 410 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
duke@0 411
duke@0 412 test_jdk:
never@1010 413 ifneq ($(ZERO_BUILD), true)
never@1010 414 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 415 $(JDK_IMAGE_DIR)/bin/java -client -version
never@1010 416 endif
duke@0 417 endif
duke@0 418 $(JDK_IMAGE_DIR)/bin/java -server -version
duke@0 419
duke@0 420 copy_product_jdk:
duke@0 421 $(RM) -r $(JDK_IMAGE_DIR)
duke@0 422 $(MKDIR) -p $(JDK_IMAGE_DIR)
duke@0 423 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 424 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 425 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
duke@0 426
duke@0 427 copy_fastdebug_jdk:
duke@0 428 $(RM) -r $(JDK_IMAGE_DIR)/fastdebug
duke@0 429 $(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
duke@0 430 if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
duke@0 431 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
coleenp@113 432 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 433 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
duke@0 434 else \
duke@0 435 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 436 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 437 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
duke@0 438 fi
duke@0 439
duke@0 440 copy_debug_jdk:
duke@0 441 $(RM) -r $(JDK_IMAGE_DIR)/debug
duke@0 442 $(MKDIR) -p $(JDK_IMAGE_DIR)/debug
duke@0 443 if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
duke@0 444 ($(CD) $(JDK_IMPORT_PATH)/debug && \
coleenp@113 445 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 446 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 447 elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
duke@0 448 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
coleenp@113 449 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 450 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 451 else \
duke@0 452 ($(CD) $(JDK_IMPORT_PATH) && \
coleenp@113 453 $(TAR) -cf - $(JDK_DIRS)) | \
duke@0 454 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
duke@0 455 fi
duke@0 456
duke@0 457 #
duke@0 458 # Check target
duke@0 459 #
duke@0 460 check: variable_check
duke@0 461
duke@0 462 #
duke@0 463 # Help target
duke@0 464 #
duke@0 465 help: intro_help target_help variable_help notes_help examples_help
duke@0 466
duke@0 467 # Intro help message
duke@0 468 intro_help:
duke@0 469 @$(ECHO) \
duke@0 470 "Makefile for the Hotspot workspace."
duke@0 471 @$(ECHO) \
duke@0 472 "Default behavior is to build and create an export area for the j2se builds."
duke@0 473
duke@0 474 # Target help
duke@0 475 target_help:
duke@0 476 @$(ECHO) "help: This help message"
duke@0 477 @$(ECHO) "all: Same as: all_product all_fastdebug"
duke@0 478 @$(ECHO) "world: Same as: all create_jdk"
duke@0 479 @$(ECHO) "all_product: Same as: product product1 export_product"
duke@0 480 @$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug"
duke@0 481 @$(ECHO) "all_debug: Same as: jvmg jvmg1 export_debug"
duke@0 482 @$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized"
duke@0 483 @$(ECHO) "clean: Clean all areas"
duke@0 484 @$(ECHO) "export_product: Export product files to EXPORT_PATH"
duke@0 485 @$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
duke@0 486 @$(ECHO) "export_debug: Export debug files to EXPORT_PATH"
duke@0 487 @$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
duke@0 488 @$(ECHO) "create_jdk: Create JDK image, export all files into it"
duke@0 489 @$(ECHO) "update_jdk: Update JDK image with fresh exported files"
duke@0 490 @$(ECHO) " "
duke@0 491 @$(ECHO) "Others targets are:"
duke@0 492 @$(ECHO) " $(C1_VM_TARGETS)"
duke@0 493 @$(ECHO) " $(C2_VM_TARGETS)"
duke@0 494 @$(ECHO) " $(KERNEL_VM_TARGETS)"
duke@0 495
duke@0 496 # Variable help (only common ones used by this workspace)
duke@0 497 variable_help: variable_help_intro variable_list variable_help_end
duke@0 498 variable_help_intro:
duke@0 499 @$(ECHO) "--- Common Variables ---"
duke@0 500 variable_help_end:
duke@0 501 @$(ECHO) " "
duke@0 502 @$(ECHO) "--- Make Arguments ---"
duke@0 503 @$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"
duke@0 504
duke@0 505 # One line descriptions for the variables
duke@0 506 SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
duke@0 507 OUTPUTDIR.desc = Output directory, default is build/<osname>
duke@0 508 BOOTDIR.desc = JDK used to compile agent java source and test with
duke@0 509 JDK_IMPORT_PATH.desc = Promoted JDK to copy for 'create_jdk'
duke@0 510 EXPORT_PATH.desc = Directory to place files to export for JDK build
duke@0 511
duke@0 512 # Make variables to print out (description and value)
duke@0 513 VARIABLE_PRINTVAL_LIST += \
duke@0 514 SLASH_JAVA \
duke@0 515 OUTPUTDIR \
duke@0 516 BOOTDIR \
duke@0 517 JDK_IMPORT_PATH \
duke@0 518 EXPORT_PATH
duke@0 519
duke@0 520 # Make variables that should refer to directories that exist
duke@0 521 VARIABLE_CHECKDIR_LIST += \
duke@0 522 SLASH_JAVA \
duke@0 523 BOOTDIR \
duke@0 524 JDK_IMPORT_PATH
duke@0 525
duke@0 526 # For pattern rules below, so all are treated the same
duke@0 527 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
duke@0 528 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
duke@0 529
duke@0 530 # Complete variable check
duke@0 531 variable_check: $(DO_CHECKDIR_LIST)
duke@0 532 variable_list: $(DO_PRINTVAL_LIST) variable_check
duke@0 533
duke@0 534 # Pattern rule for printing out a variable
duke@0 535 %.printval:
duke@0 536 @$(ECHO) " ALT_$* - $($*.desc)"
duke@0 537 @$(ECHO) " $*=$($*)"
duke@0 538
duke@0 539 # Pattern rule for checking to see if a variable with a directory exists
duke@0 540 %.checkdir:
duke@0 541 @if [ ! -d $($*) ] ; then \
duke@0 542 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@0 543 fi
duke@0 544
duke@0 545 # Pattern rule for checking to see if a variable with a file exists
duke@0 546 %.checkfil:
duke@0 547 @if [ ! -f $($*) ] ; then \
duke@0 548 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
duke@0 549 fi
duke@0 550
duke@0 551 # Misc notes on help
duke@0 552 notes_help:
duke@0 553 @$(ECHO) \
duke@0 554 "--- Notes --- "
duke@0 555 @$(ECHO) \
duke@0 556 "- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
duke@0 557 @$(ECHO) \
duke@0 558 " builds or previous release JDK builds will work."
duke@0 559 @$(ECHO) \
duke@0 560 "- The fastest builds have been when the workspace and the BOOTDIR are on"
duke@0 561 @$(ECHO) \
duke@0 562 " local disk."
duke@0 563
duke@0 564 examples_help:
duke@0 565 @$(ECHO) \
duke@0 566 "--- Examples --- "
duke@0 567 @$(ECHO) \
duke@0 568 " $(MAKE) all"
duke@0 569 @$(ECHO) \
duke@0 570 " $(MAKE) world"
duke@0 571 @$(ECHO) \
duke@0 572 " $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)"
duke@0 573 @$(ECHO) \
duke@0 574 " $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"
duke@0 575
duke@0 576 # JPRT rule to build this workspace
duke@0 577 include $(GAMMADIR)/make/jprt.gmk
duke@0 578
duke@0 579 .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
duke@0 580 $(KERNEL_VM_TARGETS) \
duke@0 581 generic_build1 generic_build2 generic_buildkernel generic_export \
duke@0 582 export_product export_fastdebug export_debug export_optimized \
duke@0 583 export_jdk_product export_jdk_fastdebug export_jdk_debug \
duke@0 584 create_jdk copy_jdk update_jdk test_jdk \
duke@0 585 copy_product_jdk copy_fastdebug_jdk copy_debug_jdk
duke@0 586