make/Makefile

Mon, 19 Mar 2012 10:09:24 +0100

author
erikj
date
Mon, 19 Mar 2012 10:09:24 +0100
changeset 3649
3d7ea1dbe0de
parent 3619
2d503de963b3
child 3726
74c359c4a9e5
permissions
-rw-r--r--

7141246: build-infra merge: Introduce new JVM_VARIANT* to control which kind of jvm gets built
Reviewed-by: dholmes, ohair

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

mercurial