Makefile 28.6 KB
Newer Older
D
duke 已提交
1
#
Z
zgu 已提交
2
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
19 20 21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
drchase 已提交
22
#
D
duke 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#

# Top level gnumake file for hotspot builds
#
# Default is to build the both product images and construct an export dir.
#  The default export directory name is `pwd`/export-$(PLATFORM).
#
#   Use: 'gnumake help' for more information.
#
# This makefile uses the default settings for where to find compilers and
#    tools, and obeys the ALT_* variable settings used by the other JDK
#    workspaces.
#

# Expected/optional make variables defined on make command line:
#  LP64=1 or ARCH_DATA_MODEL=64 for 64bit build
#
# Expected/optional make variables or environment variables:
#  ALT_SLASH_JAVA             Location of /java or J:
#  ALT_BOOTDIR                Previous JDK home directory for javac compiler
#  ALT_OUTPUTDIR              Output directory to use for hotspot build
#  ALT_EXPORT_PATH            Directory to export hotspot build to
#  ALT_JDK_IMPORT_PATH        Current JDK build (only for create_jdk rules)
46
#  ALT_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling
D
duke 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
#  ALT_BUILD_WIN_SA           Building SA on Windows is disabled by default.
#                             Set ALT_BUILD_WIN_SA=1 to enable building SA on
#                             Windows.
# Version strings and numbers:
#  JDK_VERSION                Current JDK version (e.g. 1.6.0)
#  PREVIOUS_JDK_VERSION       Previous (bootdir) JDK version (e.g. 1.5.0)
#  FULL_VERSION               Full version string to use (e.g. "1.6.0-ea-b42")
#
# Version strings and numbers especially needed on Windows:
#  COOKED_JDK_UPDATE_VERSION  Just the update release number (e.g. 02)
#  COOKED_BUILD_NUMBER        Just the build number (e.g. 42)
#  JDK_MKTG_VERSION           Marketing JDK version (e.g. 6.0)
#  JDK_MAJOR_VERSION          Major number for version (e.g. 1) always 1?
#  JDK_MINOR_VERSION          Minor number for version (e.g. 6)
#  JDK_MICRO_VERSION          Micro number for version (e.g. 0)
#

# Default is build both product fastdebug and create export area

# Allow to build HotSpot in local directory from sources specified by GAMMADIR.
# After make/defs.make GAMMADIR is defined.
ifdef GAMMADIR
  ifndef ALT_OUTPUTDIR
    ALT_OUTPUTDIR := $(shell pwd)
  endif
  include $(GAMMADIR)/make/defs.make
else
  include defs.make
endif

77
include $(GAMMADIR)/make/altsrc.make
D
duke 已提交
78

79 80
-include $(HS_ALT_MAKE)/Makefile.make

D
duke 已提交
81 82 83 84 85 86 87
ifneq ($(ALT_OUTPUTDIR),)
  ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
else
  ALT_OUT=
endif

# Typical C1/C2 targets made available with this Makefile
D
drchase 已提交
88 89
C1_VM_TARGETS=product1 fastdebug1 optimized1 debug1
C2_VM_TARGETS=product  fastdebug  optimized  debug
90
CORE_VM_TARGETS=productcore fastdebugcore optimizedcore debugcore
D
drchase 已提交
91 92 93
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero debugzero
SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark debugshark
MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 debugminimal1
D
duke 已提交
94

95 96
COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product
COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug
D
drchase 已提交
97
COMMON_VM_DEBUG_TARGETS=debug debug1 docs export_debug
98
COMMON_VM_OPTIMIZED_TARGETS=optimized optimized1 docs export_optimized
99

100 101 102
# JDK directory list
JDK_DIRS=bin include jre lib demo

D
duke 已提交
103
all:           all_product all_fastdebug
104

105 106 107
ifeq ($(JVM_VARIANT_MINIMAL1),true)
all_product:	productminimal1
all_fastdebug:	fastdebugminimal1
D
drchase 已提交
108
all_debug:	debugminimal1
109 110
endif

111
ifdef BUILD_CLIENT_ONLY
112 113
all_product:   product1 docs export_product
all_fastdebug: fastdebug1 docs export_fastdebug
D
drchase 已提交
114
all_debug:     debug1 docs export_debug
115
all_optimized: optimized1 docs export_optimized
116 117 118 119 120
else
ifeq ($(MACOSX_UNIVERSAL),true)
all_product:   universal_product
all_fastdebug: universal_fastdebug
all_debug:     universal_debug
121
all_optimized: universal_optimized
122 123 124 125
else
all_product:   $(COMMON_VM_PRODUCT_TARGETS)
all_fastdebug: $(COMMON_VM_FASTDEBUG_TARGETS)
all_debug:     $(COMMON_VM_DEBUG_TARGETS)
126
all_optimized: $(COMMON_VM_OPTIMIZED_TARGETS)
127
endif
128 129
endif

130 131 132
allzero:           all_productzero all_fastdebugzero
all_productzero:   productzero docs export_product
all_fastdebugzero: fastdebugzero docs export_fastdebug
D
drchase 已提交
133
all_debugzero:     debugzero docs export_debug
134 135
all_optimizedzero: optimizedzero docs export_optimized

136 137 138
allshark:           all_productshark all_fastdebugshark
all_productshark:   productshark docs export_product
all_fastdebugshark: fastdebugshark docs export_fastdebug
D
drchase 已提交
139
all_debugshark:     debugshark docs export_debug
140 141
all_optimizedshark: optimizedshark docs export_optimized

142 143 144 145 146 147
allcore:           all_productcore all_fastdebugcore
all_productcore:   productcore docs export_product
all_fastdebugcore: fastdebugcore docs export_fastdebug
all_debugcore:     debugcore docs export_debug
all_optimizedcore: optimizedcore docs export_optimized

D
duke 已提交
148 149 150 151 152 153 154 155
# Do everything
world:         all create_jdk

# Build or export docs
docs:
ifeq ($(OSNAME),windows)
	@$(ECHO) "No docs ($(VM_TARGET)) for windows"
else
156 157
# We specify 'BUILD_FLAVOR=product' so that the proper
# ENABLE_FULL_DEBUG_SYMBOLS value is used.
D
duke 已提交
158 159
	$(CD) $(OUTPUTDIR); \
	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
160
		      $(MAKE_ARGS) BUILD_FLAVOR=product docs
D
duke 已提交
161 162
endif

T
twisti 已提交
163 164 165
# Output directories
C1_DIR      =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
C2_DIR      =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
166
CORE_DIR    =$(OUTPUTDIR)/$(VM_PLATFORM)_core
T
twisti 已提交
167 168 169 170
MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
ZERO_DIR    =$(OUTPUTDIR)/$(VM_PLATFORM)_zero
SHARK_DIR   =$(OUTPUTDIR)/$(VM_PLATFORM)_shark

D
duke 已提交
171 172 173
# Build variation of hotspot
$(C1_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
T
twisti 已提交
174
	$(MAKE) BUILD_DIR=$(C1_DIR) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
D
duke 已提交
175 176 177

$(C2_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
T
twisti 已提交
178
	$(MAKE) BUILD_DIR=$(C2_DIR) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
D
duke 已提交
179

180 181
$(CORE_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
182
	$(MAKE) BUILD_DIR=$(CORE_DIR) BUILD_FLAVOR=$(@:%core=%) VM_TARGET=$@ generic_buildcore $(ALT_OUT)
183

184 185
$(ZERO_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
T
twisti 已提交
186
	$(MAKE) BUILD_DIR=$(ZERO_DIR) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
187

188 189
$(SHARK_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
T
twisti 已提交
190
	$(MAKE) BUILD_DIR=$(SHARK_DIR) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
191

192 193
$(MINIMAL1_VM_TARGETS):
	$(CD) $(GAMMADIR)/make; \
T
twisti 已提交
194 195 196 197 198 199 200 201
	$(MAKE) BUILD_DIR=$(MINIMAL1_DIR) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ generic_buildminimal1 $(ALT_OUT)

# Install hotspot script in build directory
HOTSPOT_SCRIPT=$(BUILD_DIR)/$(BUILD_FLAVOR)/hotspot
$(HOTSPOT_SCRIPT): $(GAMMADIR)/make/hotspot.script
	$(QUIETLY) $(MKDIR) -p $(BUILD_DIR)/$(BUILD_FLAVOR)
	$(QUIETLY) cat $< | sed -e 's|@@LIBARCH@@|$(LIBARCH)|g' | sed -e 's|@@JDK_IMPORT_PATH@@|$(JDK_IMPORT_PATH)|g' > $@
	$(QUIETLY) chmod +x $@
202

D
duke 已提交
203
# Build compiler1 (client) rule, different for platforms
T
twisti 已提交
204
generic_build1: $(HOTSPOT_SCRIPT)
D
duke 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
	$(MKDIR) -p $(OUTPUTDIR)
ifeq ($(OSNAME),windows)
  ifeq ($(ARCH_DATA_MODEL), 32)
	$(CD) $(OUTPUTDIR); \
	    $(NMAKE) -f $(ABS_OS_MAKEFILE) \
		      Variant=compiler1 \
                      WorkSpace=$(ABS_GAMMADIR) \
		      BootStrapDir=$(ABS_BOOTDIR) \
                      BuildUser=$(USERNAME) \
		      $(MAKE_ARGS) $(VM_TARGET:%1=%)
  else
	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
  endif
else
  ifeq ($(ARCH_DATA_MODEL), 32)
	$(CD) $(OUTPUTDIR); \
	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
		      $(MAKE_ARGS) $(VM_TARGET)
  else
	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
  endif
endif

# Build compiler2 (server) rule, different for platforms
T
twisti 已提交
229
generic_build2: $(HOTSPOT_SCRIPT)
D
duke 已提交
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
	$(MKDIR) -p $(OUTPUTDIR)
ifeq ($(OSNAME),windows)
	$(CD) $(OUTPUTDIR); \
	    $(NMAKE) -f $(ABS_OS_MAKEFILE) \
		      Variant=compiler2 \
                      WorkSpace=$(ABS_GAMMADIR) \
		      BootStrapDir=$(ABS_BOOTDIR) \
                      BuildUser=$(USERNAME) \
		      $(MAKE_ARGS) $(VM_TARGET)
else
	$(CD) $(OUTPUTDIR); \
	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
		      $(MAKE_ARGS) $(VM_TARGET)
endif

245 246 247 248 249 250 251 252 253 254 255 256 257 258
generic_buildcore: $(HOTSPOT_SCRIPT)
ifeq ($(HS_ARCH),ppc)
  ifeq ($(ARCH_DATA_MODEL),64)
	$(MKDIR) -p $(OUTPUTDIR)
	$(CD) $(OUTPUTDIR); \
		$(MAKE) -f $(ABS_OS_MAKEFILE) \
			$(MAKE_ARGS) $(VM_TARGET)
  else
	@$(ECHO) "No ($(VM_TARGET)) for ppc ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
  endif
else
	@$(ECHO) "No ($(VM_TARGET)) for $(HS_ARCH)"
endif

T
twisti 已提交
259
generic_buildzero: $(HOTSPOT_SCRIPT)
260 261 262 263 264
	$(MKDIR) -p $(OUTPUTDIR)
	$(CD) $(OUTPUTDIR); \
		$(MAKE) -f $(ABS_OS_MAKEFILE) \
			$(MAKE_ARGS) $(VM_TARGET)

T
twisti 已提交
265
generic_buildshark: $(HOTSPOT_SCRIPT)
266 267 268
	$(MKDIR) -p $(OUTPUTDIR)
	$(CD) $(OUTPUTDIR); \
		$(MAKE) -f $(ABS_OS_MAKEFILE) \
D
drchase 已提交
269
			$(MAKE_ARGS) $(VM_TARGET)
270

T
twisti 已提交
271
generic_buildminimal1: $(HOTSPOT_SCRIPT)
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
ifeq ($(JVM_VARIANT_MINIMAL1),true)
	$(MKDIR) -p $(OUTPUTDIR)
  ifeq ($(ARCH_DATA_MODEL), 32)
    ifeq ($(OSNAME),windows)
	$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
    else
      ifeq ($(OSNAME),solaris)
	$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
      else
	$(CD) $(OUTPUTDIR); \
	$(MAKE) -f $(ABS_OS_MAKEFILE) $(MAKE_ARGS) $(VM_TARGET) ;
      endif
    endif
  else
	    @$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
  endif
else
	@$(ECHO) "Error: trying to build a minimal target but JVM_VARIANT_MINIMAL1 is not true."
endif

D
duke 已提交
292 293
# Export file rule
generic_export: $(EXPORT_LIST)
T
twisti 已提交
294

D
duke 已提交
295
export_product:
T
twisti 已提交
296
	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) generic_export
D
duke 已提交
297
export_fastdebug:
T
twisti 已提交
298
	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
D
duke 已提交
299
export_debug:
T
twisti 已提交
300
	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
D
duke 已提交
301
export_optimized:
T
twisti 已提交
302 303
	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export

304
export_product_jdk::
T
twisti 已提交
305
	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export
306
export_optimized_jdk::
307
	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
308
export_fastdebug_jdk::
T
twisti 已提交
309
	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
310
export_debug_jdk::
T
twisti 已提交
311
	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
D
duke 已提交
312 313 314

# Export file copy rules
XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
T
twisti 已提交
315 316 317
DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
C1_BUILD_DIR      =$(C1_DIR)/$(BUILD_FLAVOR)
C2_BUILD_DIR      =$(C2_DIR)/$(BUILD_FLAVOR)
318
CORE_BUILD_DIR    =$(CORE_DIR)/$(BUILD_FLAVOR)
T
twisti 已提交
319 320 321
MINIMAL1_BUILD_DIR=$(MINIMAL1_DIR)/$(BUILD_FLAVOR)
ZERO_BUILD_DIR    =$(ZERO_DIR)/$(BUILD_FLAVOR)
SHARK_BUILD_DIR   =$(SHARK_DIR)/$(BUILD_FLAVOR)
322 323

# Server (C2)
324
ifeq ($(JVM_VARIANT_SERVER), true)
325
# Common
T
twisti 已提交
326
$(EXPORT_SERVER_DIR)/%.diz:       		$(C2_BUILD_DIR)/%.diz
327
	$(install-file)
T
twisti 已提交
328
$(EXPORT_LIB_DIR)/%.jar:			$(C2_BUILD_DIR)/../generated/%.jar
329
	$(install-file)
T
twisti 已提交
330
$(EXPORT_INCLUDE_DIR)/%:			$(C2_BUILD_DIR)/../generated/jvmtifiles/%
331 332
	$(install-file)
# Windows
T
twisti 已提交
333
$(EXPORT_SERVER_DIR)/%.dll:			$(C2_BUILD_DIR)/%.dll
334
	$(install-file)
T
twisti 已提交
335
$(EXPORT_SERVER_DIR)/%.pdb:			$(C2_BUILD_DIR)/%.pdb
336
	$(install-file)
T
twisti 已提交
337
$(EXPORT_SERVER_DIR)/%.map:			$(C2_BUILD_DIR)/%.map
338
	$(install-file)
T
twisti 已提交
339
$(EXPORT_LIB_DIR)/%.lib:			$(C2_BUILD_DIR)/%.lib
340
	$(install-file)
T
twisti 已提交
341
$(EXPORT_JRE_BIN_DIR)/%.diz:			$(C2_BUILD_DIR)/%.diz
342
	$(install-file)
T
twisti 已提交
343
$(EXPORT_JRE_BIN_DIR)/%.dll:			$(C2_BUILD_DIR)/%.dll
344
	$(install-file)
T
twisti 已提交
345
$(EXPORT_JRE_BIN_DIR)/%.pdb:			$(C2_BUILD_DIR)/%.pdb
346
	$(install-file)
T
twisti 已提交
347
$(EXPORT_JRE_BIN_DIR)/%.map:			$(C2_BUILD_DIR)/%.map
348 349
	$(install-file)
# Unix
T
twisti 已提交
350
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
351
	$(install-file)
T
twisti 已提交
352
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
353
	$(install-file)
T
twisti 已提交
354
$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
355
	$(install-file)
T
twisti 已提交
356
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: 	$(C2_BUILD_DIR)/%.debuginfo
357
	$(install-file)
T
twisti 已提交
358
$(EXPORT_SERVER_DIR)/%.debuginfo:       	$(C2_BUILD_DIR)/%.debuginfo
359
	$(install-file)
T
twisti 已提交
360
$(EXPORT_SERVER_DIR)/64/%.debuginfo:    	$(C2_BUILD_DIR)/%.debuginfo
361
	$(install-file)
T
twisti 已提交
362
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: 		$(C2_BUILD_DIR)/%.diz
363
	$(install-file)
T
twisti 已提交
364
$(EXPORT_SERVER_DIR)/64/%.diz:    		$(C2_BUILD_DIR)/%.diz
365
	$(install-file)
366 367 368 369 370
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: 		$(C2_BUILD_DIR)/%.dSYM
	$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM:       		$(C2_BUILD_DIR)/%.dSYM
	$(install-dir)
371
endif
372 373

# Client (C1)
374
ifeq ($(JVM_VARIANT_CLIENT), true)
375
# Common
T
twisti 已提交
376
$(EXPORT_CLIENT_DIR)/%.diz:       		$(C1_BUILD_DIR)/%.diz
377
	$(install-file)
T
twisti 已提交
378
$(EXPORT_LIB_DIR)/%.jar:			$(C1_BUILD_DIR)/../generated/%.jar
379
	$(install-file)
T
twisti 已提交
380
$(EXPORT_INCLUDE_DIR)/%:			$(C1_BUILD_DIR)/../generated/jvmtifiles/%
381 382
	$(install-file)
# Windows
T
twisti 已提交
383
$(EXPORT_CLIENT_DIR)/%.dll:			$(C1_BUILD_DIR)/%.dll
384
	$(install-file)
T
twisti 已提交
385
$(EXPORT_CLIENT_DIR)/%.pdb:			$(C1_BUILD_DIR)/%.pdb
386
	$(install-file)
T
twisti 已提交
387
$(EXPORT_CLIENT_DIR)/%.map:			$(C1_BUILD_DIR)/%.map
388
	$(install-file)
T
twisti 已提交
389
$(EXPORT_LIB_DIR)/%.lib:			$(C1_BUILD_DIR)/%.lib
390
	$(install-file)
T
twisti 已提交
391
$(EXPORT_JRE_BIN_DIR)/%.diz:			$(C1_BUILD_DIR)/%.diz
392
	$(install-file)
T
twisti 已提交
393
$(EXPORT_JRE_BIN_DIR)/%.dll:			$(C1_BUILD_DIR)/%.dll
394
	$(install-file)
T
twisti 已提交
395
$(EXPORT_JRE_BIN_DIR)/%.pdb:			$(C1_BUILD_DIR)/%.pdb
396
	$(install-file)
T
twisti 已提交
397
$(EXPORT_JRE_BIN_DIR)/%.map:			$(C1_BUILD_DIR)/%.map
398 399
	$(install-file)
# Unix
T
twisti 已提交
400
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
401
	$(install-file)
T
twisti 已提交
402
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX):       $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
403
	$(install-file)
T
twisti 已提交
404
$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
405
	$(install-file)
T
twisti 已提交
406
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: 	$(C1_BUILD_DIR)/%.debuginfo
407
	$(install-file)
T
twisti 已提交
408
$(EXPORT_CLIENT_DIR)/%.debuginfo:       	$(C1_BUILD_DIR)/%.debuginfo
409
	$(install-file)
T
twisti 已提交
410
$(EXPORT_CLIENT_DIR)/64/%.debuginfo:    	$(C1_BUILD_DIR)/%.debuginfo
411
	$(install-file)
T
twisti 已提交
412
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: 		$(C1_BUILD_DIR)/%.diz
413
	$(install-file)
T
twisti 已提交
414
$(EXPORT_CLIENT_DIR)/64/%.diz:    		$(C1_BUILD_DIR)/%.diz
415
	$(install-file)
416 417 418 419 420
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: 		$(C1_BUILD_DIR)/%.dSYM
	$(install-dir)
$(EXPORT_CLIENT_DIR)/%.dSYM:       		$(C1_BUILD_DIR)/%.dSYM
	$(install-dir)
421
endif
D
duke 已提交
422

423 424 425
# Minimal1
ifeq ($(JVM_VARIANT_MINIMAL1), true)
# Common
T
twisti 已提交
426
$(EXPORT_MINIMAL_DIR)/%.diz:			$(MINIMAL1_BUILD_DIR)/%.diz
D
duke 已提交
427
	$(install-file)
T
twisti 已提交
428
$(EXPORT_LIB_DIR)/%.jar:			$(MINIMAL1_BUILD_DIR)/../generated/%.jar
429
	$(install-file)
T
twisti 已提交
430
$(EXPORT_INCLUDE_DIR)/%:			$(MINIMAL1_BUILD_DIR)/../generated/jvmtifiles/%
D
duke 已提交
431
	$(install-file)
432
# Windows
T
twisti 已提交
433
$(EXPORT_MINIMAL_DIR)/%.dll:			$(MINIMAL1_BUILD_DIR)/%.dll
D
duke 已提交
434
	$(install-file)
T
twisti 已提交
435
$(EXPORT_MINIMAL_DIR)/%.pdb:			$(MINIMAL1_BUILD_DIR)/%.pdb
D
duke 已提交
436
	$(install-file)
T
twisti 已提交
437
$(EXPORT_MINIMAL_DIR)/%.map:			$(MINIMAL1_BUILD_DIR)/%.map
438
	$(install-file)
T
twisti 已提交
439
$(EXPORT_LIB_DIR)/%.lib:			$(MINIMAL1_BUILD_DIR)/%.lib
D
duke 已提交
440
	$(install-file)
T
twisti 已提交
441
$(EXPORT_JRE_BIN_DIR)/%.diz:			$(MINIMAL1_BUILD_DIR)/%.diz
D
duke 已提交
442
	$(install-file)
T
twisti 已提交
443
$(EXPORT_JRE_BIN_DIR)/%.dll:			$(MINIMAL1_BUILD_DIR)/%.dll
D
duke 已提交
444
	$(install-file)
T
twisti 已提交
445
$(EXPORT_JRE_BIN_DIR)/%.pdb:			$(MINIMAL1_BUILD_DIR)/%.pdb
446
	$(install-file)
T
twisti 已提交
447
$(EXPORT_JRE_BIN_DIR)/%.map:			$(MINIMAL1_BUILD_DIR)/%.map
448 449
	$(install-file)
# Unix
T
twisti 已提交
450
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX):	$(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
451
	$(install-file)
T
twisti 已提交
452
$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX):	$(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
453
	$(install-file)
T
twisti 已提交
454
$(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX):	$(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
455
	$(install-file)
T
twisti 已提交
456
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo:		$(MINIMAL1_BUILD_DIR)/%.debuginfo
D
duke 已提交
457
	$(install-file)
T
twisti 已提交
458
$(EXPORT_MINIMAL_DIR)/%.debuginfo:		$(MINIMAL1_BUILD_DIR)/%.debuginfo
D
duke 已提交
459
	$(install-file)
T
twisti 已提交
460
$(EXPORT_MINIMAL_DIR)/64/%.debuginfo:		$(MINIMAL1_BUILD_DIR)/%.debuginfo
461
	$(install-file)
T
twisti 已提交
462
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(MINIMAL1_BUILD_DIR)/%.diz
463
	$(install-file)
T
twisti 已提交
464
$(EXPORT_MINIMAL_DIR)/64/%.diz:			$(MINIMAL1_BUILD_DIR)/%.diz
D
duke 已提交
465
	$(install-file)
466
# MacOS X does not support Minimal1 config
D
duke 已提交
467 468
endif

469 470 471
# Zero
ifeq ($(JVM_VARIANT_ZERO), true)
# Common
T
twisti 已提交
472
$(EXPORT_LIB_DIR)/%.jar:			$(ZERO_BUILD_DIR)/../generated/%.jar
473
	$(install-file)
T
twisti 已提交
474
$(EXPORT_INCLUDE_DIR)/%:			$(ZERO_BUILD_DIR)/../generated/jvmtifiles/%
475 476
	$(install-file)
# Unix
T
twisti 已提交
477
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
478
	$(install-file)
T
twisti 已提交
479
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo:		$(ZERO_BUILD_DIR)/%.debuginfo
480
	$(install-file)
T
twisti 已提交
481
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(ZERO_BUILD_DIR)/%.diz
482
	$(install-file)
T
twisti 已提交
483
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
484
	$(install-file)
T
twisti 已提交
485
$(EXPORT_SERVER_DIR)/%.debuginfo:		$(ZERO_BUILD_DIR)/%.debuginfo
486
	$(install-file)
T
twisti 已提交
487
$(EXPORT_SERVER_DIR)/%.diz:			$(ZERO_BUILD_DIR)/%.diz
488
	$(install-file)
489 490 491 492 493
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: 		$(ZERO_BUILD_DIR)/%.dSYM
	$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM:			$(ZERO_BUILD_DIR)/%.dSYM
	$(install-dir)
D
duke 已提交
494 495
endif

496 497 498
# Core
ifeq ($(JVM_VARIANT_CORE), true)
# Common
499
$(EXPORT_LIB_DIR)/%.jar:			$(CORE_BUILD_DIR)/../generated/%.jar
500
	$(install-file)
501
$(EXPORT_INCLUDE_DIR)/%:			$(CORE_BUILD_DIR)/../generated/jvmtifiles/%
502 503
	$(install-file)
# Unix
504
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX):	$(CORE_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
505
	$(install-file)
506
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo:		$(CORE_BUILD_DIR)/%.debuginfo
507
	$(install-file)
508
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(CORE_BUILD_DIR)/%.diz
509
	$(install-file)
510
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):	$(CORE_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
511
	$(install-file)
512
$(EXPORT_SERVER_DIR)/%.debuginfo:		$(CORE_BUILD_DIR)/%.debuginfo
513
	$(install-file)
514
$(EXPORT_SERVER_DIR)/%.diz:			$(CORE_BUILD_DIR)/%.diz
515 516 517
	$(install-file)
endif

518 519 520
# Shark
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
# Common
T
twisti 已提交
521
$(EXPORT_LIB_DIR)/%.jar:			$(SHARK_BUILD_DIR)/../generated/%.jar
D
duke 已提交
522
	$(install-file)
T
twisti 已提交
523
$(EXPORT_INCLUDE_DIR)/%:			$(SHARK_BUILD_DIR)/../generated/jvmtifiles/%
524 525
	$(install-file)
# Unix
T
twisti 已提交
526
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
527
	$(install-file)
T
twisti 已提交
528
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo):	$(SHARK_BUILD_DIR)/%.debuginfo
D
duke 已提交
529
	$(install-file)
T
twisti 已提交
530
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(SHARK_BUILD_DIR)/%.diz
531
	$(install-file)
T
twisti 已提交
532
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
533
	$(install-file)
T
twisti 已提交
534
$(EXPORT_SERVER_DIR)/%.debuginfo:		$(SHARK_BUILD_DIR)/%.debuginfo
535
	$(install-file)
T
twisti 已提交
536
$(EXPORT_SERVER_DIR)/%.diz:			$(SHARK_BUILD_DIR)/%.diz
537
	$(install-file)
538 539 540 541 542
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: 		$(SHARK_BUILD_DIR)/%.dSYM
	$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM:			$(SHARK_BUILD_DIR)/%.dSYM
	$(install-dir)
543
endif
D
duke 已提交
544

545 546 547
$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
	$(install-file)

D
duke 已提交
548 549 550
$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
	$(install-file)

551 552
HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h)
$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
D
duke 已提交
553 554 555 556 557
	$(install-file)

$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
	$(install-file)

558 559 560
JFR_EXISTS=$(shell if [ -d $(HS_ALT_SRC) ]; then echo 1; else echo 0; fi)
# export jfr.h
ifeq ($JFR_EXISTS,1)
S
sla 已提交
561
$(EXPORT_INCLUDE_DIR)/%: $(HS_ALT_SRC)/share/vm/jfr/%
562 563 564 565 566
	$(install-file)
else
$(EXPORT_INCLUDE_DIR)/jfr.h:
endif

D
duke 已提交
567 568 569 570 571
# Doc files (jvmti.html)
$(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
	$(install-file)

# Xusage file
Z
zgu 已提交
572
$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_MINIMAL_DIR)/Xusage.txt: $(XUSAGE)
D
duke 已提交
573 574 575 576 577 578 579 580 581 582 583 584
	$(prep-target)
	$(RM) $@.temp
	$(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
	$(MV) $@.temp $@

#
# Clean rules
#
clobber clean: clean_build clean_export clean_jdk
clean_build:
	$(RM) -r $(C1_DIR)
	$(RM) -r $(C2_DIR)
585
	$(RM) -r $(CORE_DIR)
586
	$(RM) -r $(ZERO_DIR)
587
	$(RM) -r $(SHARK_DIR)
588
	$(RM) -r $(MINIMAL1_DIR)
D
duke 已提交
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
clean_export:
	$(RM) -r $(EXPORT_PATH)
clean_jdk:
	$(RM) -r $(JDK_IMAGE_DIR)

#
# Create JDK and place this build into it
#
create_jdk: copy_jdk update_jdk

update_jdk: export_product_jdk export_fastdebug_jdk test_jdk

copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar

$(JDK_IMAGE_DIR)/jre/lib/rt.jar:
	$(RM) -r $(JDK_IMAGE_DIR)
	$(MKDIR) -p $(JDK_IMAGE_DIR)
	($(CD) $(JDK_IMPORT_PATH) && \
	 $(TAR) -cf - *) | \
	 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)

610 611 612 613 614 615 616 617 618

# Testing the built JVM
RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma
generic_test:
	@$(ECHO) "Running with: $(ALTJVM_DIR)"
	@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion
	@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help

# C2 test targets
D
drchase 已提交
619
test_product test_optimized test_fastdebug test_debug:
620 621 622
	@$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)"

# C1 test targets
D
drchase 已提交
623
test_product1 test_optimized1 test_fastdebug1 test_debug1:
624 625 626 627 628 629 630
  ifeq ($(ARCH_DATA_MODEL), 32)
	@$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)"
  else
	@$(ECHO) "No compiler1 ($(@:test_%=%)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
  endif

# Zero test targets
D
drchase 已提交
631
test_productzero test_optimizedzero test_fastdebugzero test_debugzero:
632 633 634
	@$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)"

# Shark test targets
D
drchase 已提交
635
test_productshark test_optimizedshark test_fastdebugshark test_debugshark:
636 637 638
	@$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)"

# Minimal1 test targets
D
drchase 已提交
639
test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_debugminimal1:
640 641 642
	@$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)"


D
duke 已提交
643
test_jdk:
644 645 646 647 648 649 650 651 652
  ifeq ($(JVM_VARIANT_CLIENT), true)
	$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
	$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -version
  endif
  ifeq ($(findstring true, $(JVM_VARIANT_SERVER)\
		$(JVM_VARIANT_ZERO)$(JVM_VARIANT_ZEROSHARK)), true)
	$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -Xinternalversion
	$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -version
  endif
D
duke 已提交
653

654
copy_product_jdk::
D
duke 已提交
655 656 657
	$(RM) -r $(JDK_IMAGE_DIR)
	$(MKDIR) -p $(JDK_IMAGE_DIR)
	($(CD) $(JDK_IMPORT_PATH) && \
658
	 $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
659 660
	 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)

661
copy_fastdebug_jdk::
D
duke 已提交
662 663 664 665
	$(RM) -r $(JDK_IMAGE_DIR)/fastdebug
	$(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
	if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
	  ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
666
	   $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
667 668 669
	   ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
	else \
	  ($(CD) $(JDK_IMPORT_PATH) && \
670
	   $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
671 672 673
	   ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
	fi

674
copy_debug_jdk::
D
duke 已提交
675 676 677 678
	$(RM) -r $(JDK_IMAGE_DIR)/debug
	$(MKDIR) -p $(JDK_IMAGE_DIR)/debug
	if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
	  ($(CD) $(JDK_IMPORT_PATH)/debug && \
679
	   $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
680 681 682
	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
	elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
	  ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
683
	   $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
684 685 686
	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
	else \
	  ($(CD) $(JDK_IMPORT_PATH) && \
687
	   $(TAR) -cf - $(JDK_DIRS)) | \
D
duke 已提交
688 689 690
	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
	fi

I
iignatyev 已提交
691 692 693 694 695 696 697 698 699 700 701 702 703
copy_optimized_jdk::
	$(RM) -r $(JDK_IMAGE_DIR)/optimized
	$(MKDIR) -p $(JDK_IMAGE_DIR)/optimized
	if [ -d $(JDK_IMPORT_PATH)/optimized ] ; then \
	  ($(CD) $(JDK_IMPORT_PATH)/optimized && \
	   $(TAR) -cf - $(JDK_DIRS)) | \
	   ($(CD) $(JDK_IMAGE_DIR)/optimized && $(TAR) -xf -) ; \
	else \
	  ($(CD) $(JDK_IMPORT_PATH) && \
	   $(TAR) -cf - $(JDK_DIRS)) | \
	   ($(CD) $(JDK_IMAGE_DIR)/optimized && $(TAR) -xf -) ; \
	fi

D
duke 已提交
704 705 706 707 708 709 710 711 712 713 714 715 716
#
# Check target
#
check: variable_check

#
# Help target
#
help: intro_help target_help variable_help notes_help examples_help

# Intro help message
intro_help:
	@$(ECHO) \
D
drchase 已提交
717
"Makefile for the Hotspot workspace."
D
duke 已提交
718 719 720 721 722 723 724 725 726 727
	@$(ECHO) \
"Default behavior is to build and create an export area for the j2se builds."

# Target help
target_help:
	@$(ECHO) "help:             This help message"
	@$(ECHO) "all:              Same as: all_product all_fastdebug"
	@$(ECHO) "world:            Same as: all create_jdk"
	@$(ECHO) "all_product:      Same as: product product1 export_product"
	@$(ECHO) "all_fastdebug:    Same as: fastdebug fastdebug1 export_fastdebug"
D
drchase 已提交
728
	@$(ECHO) "all_debug:        Same as: debug debug1 export_debug"
D
duke 已提交
729 730 731 732 733 734 735 736 737
	@$(ECHO) "all_optimized:    Same as: optimized optimized1 export_optimized"
	@$(ECHO) "clean:            Clean all areas"
	@$(ECHO) "export_product:   Export product files to EXPORT_PATH"
	@$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
	@$(ECHO) "export_debug:     Export debug files to EXPORT_PATH"
	@$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
	@$(ECHO) "create_jdk:       Create JDK image, export all files into it"
	@$(ECHO) "update_jdk:       Update JDK image with fresh exported files"
	@$(ECHO) " "
738
	@$(ECHO) "Other targets are:"
D
duke 已提交
739 740
	@$(ECHO) "   $(C1_VM_TARGETS)"
	@$(ECHO) "   $(C2_VM_TARGETS)"
741
	@$(ECHO) "   $(MINIMAL1_VM_TARGETS)"
D
duke 已提交
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756

# Variable help (only common ones used by this workspace)
variable_help: variable_help_intro variable_list variable_help_end
variable_help_intro:
	@$(ECHO) "--- Common Variables ---"
variable_help_end:
	@$(ECHO) " "
	@$(ECHO) "--- Make Arguments ---"
	@$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"

# One line descriptions for the variables
SLASH_JAVA.desc            = Root of all build tools, e.g. /java or J:
OUTPUTDIR.desc             = Output directory, default is build/<osname>
BOOTDIR.desc               = JDK used to compile agent java source and test with
JDK_IMPORT_PATH.desc       = Promoted JDK to copy for 'create_jdk'
757
JDK_IMAGE_DIR.desc         = Directory to place JDK to copy
D
duke 已提交
758 759 760 761 762 763 764 765
EXPORT_PATH.desc           = Directory to place files to export for JDK build

# Make variables to print out (description and value)
VARIABLE_PRINTVAL_LIST +=       \
    SLASH_JAVA                  \
    OUTPUTDIR                   \
    BOOTDIR                     \
    JDK_IMPORT_PATH             \
766
    JDK_IMAGE_DIR               \
D
duke 已提交
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820
    EXPORT_PATH

# Make variables that should refer to directories that exist
VARIABLE_CHECKDIR_LIST +=       \
    SLASH_JAVA                  \
    BOOTDIR                     \
    JDK_IMPORT_PATH

# For pattern rules below, so all are treated the same
DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)

# Complete variable check
variable_check: $(DO_CHECKDIR_LIST)
variable_list: $(DO_PRINTVAL_LIST) variable_check

# Pattern rule for printing out a variable
%.printval:
	@$(ECHO) "  ALT_$* - $($*.desc)"
	@$(ECHO) "        $*=$($*)"

# Pattern rule for checking to see if a variable with a directory exists
%.checkdir:
	@if [ ! -d $($*) ] ; then \
	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
	fi

# Pattern rule for checking to see if a variable with a file exists
%.checkfil:
	@if [ ! -f $($*) ] ; then \
	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
	fi

# Misc notes on help
notes_help:
	@$(ECHO) \
"--- Notes --- "
	@$(ECHO) \
"- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
	@$(ECHO) \
"        builds or previous release JDK builds will work."
	@$(ECHO) \
"- The fastest builds have been when the workspace and the BOOTDIR are on"
	@$(ECHO) \
"        local disk."

examples_help:
	@$(ECHO) \
"--- Examples --- "
	@$(ECHO) \
"  $(MAKE) all"
	@$(ECHO) \
"  $(MAKE) world"
	@$(ECHO) \
D
drchase 已提交
821
"  $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)"
D
duke 已提交
822 823 824
	@$(ECHO) \
"  $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"

825 826 827 828 829 830 831
# Universal build support
ifeq ($(OS_VENDOR), Darwin)
ifeq ($(MACOSX_UNIVERSAL),true)
include $(GAMMADIR)/make/$(OSNAME)/makefiles/universal.gmk
endif
endif

D
drchase 已提交
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848
# Compatibility for transition to new naming
warn_jvmg_deprecated:
	echo "Warning: The jvmg target has been replaced with debug"
	echo "Warning: Please update your usage"

jvmg: warn_jvmg_deprecated debug

jvmg1: warn_jvmg_deprecated debug1

jvmgminimal1: warn_jvmg_deprecated debugminimal1

jvmgcore: warn_jvmg_deprecated debugcore

jvmgzero: warn_jvmg_deprecated debugzero

jvmgshark: warn_jvmg_deprecated debugshark

D
duke 已提交
849 850 851 852
# JPRT rule to build this workspace
include $(GAMMADIR)/make/jprt.gmk

.PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
Z
zgu 已提交
853 854
        $(MINIMAL1_VM_TARGETS) \
	generic_build1 generic_build2 generic_buildminimal1 generic_export \
D
duke 已提交
855 856 857
	export_product export_fastdebug export_debug export_optimized \
	export_jdk_product export_jdk_fastdebug export_jdk_debug \
	create_jdk copy_jdk update_jdk test_jdk \
858 859
	copy_product_jdk copy_fastdebug_jdk copy_debug_jdk  \
	$(HS_ALT_MAKE)/Makefile.make