Wed, 19 Jun 2013 12:15:50 +0200
8016476: PPC64 (part 1): reenable CORE build
Summary: reenable CORE build on PPC64
Reviewed-by: dholmes, kvn, coleenp
1 #
2 # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
23 #
25 # Top level gnumake file for hotspot builds
26 #
27 # Default is to build the both product images and construct an export dir.
28 # The default export directory name is `pwd`/export-$(PLATFORM).
29 #
30 # Use: 'gnumake help' for more information.
31 #
32 # This makefile uses the default settings for where to find compilers and
33 # tools, and obeys the ALT_* variable settings used by the other JDK
34 # workspaces.
35 #
37 # Expected/optional make variables defined on make command line:
38 # LP64=1 or ARCH_DATA_MODEL=64 for 64bit build
39 #
40 # Expected/optional make variables or environment variables:
41 # ALT_SLASH_JAVA Location of /java or J:
42 # ALT_BOOTDIR Previous JDK home directory for javac compiler
43 # ALT_OUTPUTDIR Output directory to use for hotspot build
44 # ALT_EXPORT_PATH Directory to export hotspot build to
45 # ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules)
46 # ALT_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling
47 # ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
48 # Set ALT_BUILD_WIN_SA=1 to enable building SA on
49 # Windows.
50 # Version strings and numbers:
51 # JDK_VERSION Current JDK version (e.g. 1.6.0)
52 # PREVIOUS_JDK_VERSION Previous (bootdir) JDK version (e.g. 1.5.0)
53 # FULL_VERSION Full version string to use (e.g. "1.6.0-ea-b42")
54 #
55 # Version strings and numbers especially needed on Windows:
56 # COOKED_JDK_UPDATE_VERSION Just the update release number (e.g. 02)
57 # COOKED_BUILD_NUMBER Just the build number (e.g. 42)
58 # JDK_MKTG_VERSION Marketing JDK version (e.g. 6.0)
59 # JDK_MAJOR_VERSION Major number for version (e.g. 1) always 1?
60 # JDK_MINOR_VERSION Minor number for version (e.g. 6)
61 # JDK_MICRO_VERSION Micro number for version (e.g. 0)
62 #
64 # Default is build both product fastdebug and create export area
66 # Allow to build HotSpot in local directory from sources specified by GAMMADIR.
67 # After make/defs.make GAMMADIR is defined.
68 ifdef GAMMADIR
69 ifndef ALT_OUTPUTDIR
70 ALT_OUTPUTDIR := $(shell pwd)
71 endif
72 include $(GAMMADIR)/make/defs.make
73 else
74 include defs.make
75 endif
77 include $(GAMMADIR)/make/altsrc.make
79 -include $(HS_ALT_MAKE)/Makefile.make
81 ifneq ($(ALT_OUTPUTDIR),)
82 ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
83 else
84 ALT_OUT=
85 endif
87 # Typical C1/C2 targets made available with this Makefile
88 C1_VM_TARGETS=product1 fastdebug1 optimized1 debug1
89 C2_VM_TARGETS=product fastdebug optimized debug
90 CORE_VM_TARGETS=productcore fastdebugcore optimizedcore debugcore
91 ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero debugzero
92 SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark debugshark
93 MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 debugminimal1
95 COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product
96 COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug
97 COMMON_VM_DEBUG_TARGETS=debug debug1 docs export_debug
99 # JDK directory list
100 JDK_DIRS=bin include jre lib demo
102 all: all_product all_fastdebug
104 ifeq ($(JVM_VARIANT_MINIMAL1),true)
105 all_product: productminimal1
106 all_fastdebug: fastdebugminimal1
107 all_debug: debugminimal1
108 endif
110 ifdef BUILD_CLIENT_ONLY
111 all_product: product1 docs export_product
112 all_fastdebug: fastdebug1 docs export_fastdebug
113 all_debug: debug1 docs export_debug
114 else
115 ifeq ($(MACOSX_UNIVERSAL),true)
116 all_product: universal_product
117 all_fastdebug: universal_fastdebug
118 all_debug: universal_debug
119 else
120 all_product: $(COMMON_VM_PRODUCT_TARGETS)
121 all_fastdebug: $(COMMON_VM_FASTDEBUG_TARGETS)
122 all_debug: $(COMMON_VM_DEBUG_TARGETS)
123 endif
124 endif
126 all_optimized: optimized optimized1 docs export_optimized
128 allzero: all_productzero all_fastdebugzero
129 all_productzero: productzero docs export_product
130 all_fastdebugzero: fastdebugzero docs export_fastdebug
131 all_debugzero: debugzero docs export_debug
132 all_optimizedzero: optimizedzero docs export_optimized
134 allshark: all_productshark all_fastdebugshark
135 all_productshark: productshark docs export_product
136 all_fastdebugshark: fastdebugshark docs export_fastdebug
137 all_debugshark: debugshark docs export_debug
138 all_optimizedshark: optimizedshark docs export_optimized
140 allcore: all_productcore all_fastdebugcore
141 all_productcore: productcore docs export_product
142 all_fastdebugcore: fastdebugcore docs export_fastdebug
143 all_debugcore: debugcore docs export_debug
144 all_optimizedcore: optimizedcore docs export_optimized
146 # Do everything
147 world: all create_jdk
149 # Build or export docs
150 docs:
151 ifeq ($(OSNAME),windows)
152 @$(ECHO) "No docs ($(VM_TARGET)) for windows"
153 else
154 # We specify 'BUILD_FLAVOR=product' so that the proper
155 # ENABLE_FULL_DEBUG_SYMBOLS value is used.
156 $(CD) $(OUTPUTDIR); \
157 $(MAKE) -f $(ABS_OS_MAKEFILE) \
158 $(MAKE_ARGS) BUILD_FLAVOR=product docs
159 endif
161 # Output directories
162 C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
163 C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
164 CORE_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_core
165 MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
166 ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero
167 SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark
169 # Build variation of hotspot
170 $(C1_VM_TARGETS):
171 $(CD) $(GAMMADIR)/make; \
172 $(MAKE) BUILD_DIR=$(C1_DIR) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
174 $(C2_VM_TARGETS):
175 $(CD) $(GAMMADIR)/make; \
176 $(MAKE) BUILD_DIR=$(C2_DIR) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
178 $(CORE_VM_TARGETS):
179 $(CD) $(GAMMADIR)/make; \
180 $(MAKE) BUILD_DIR=$(CORE_DIR) BUILD_FLAVOR=$(@:$core=%) VM_TARGET=$@ generic_buildcore $(ALT_OUT)
182 $(ZERO_VM_TARGETS):
183 $(CD) $(GAMMADIR)/make; \
184 $(MAKE) BUILD_DIR=$(ZERO_DIR) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
186 $(SHARK_VM_TARGETS):
187 $(CD) $(GAMMADIR)/make; \
188 $(MAKE) BUILD_DIR=$(SHARK_DIR) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
190 $(MINIMAL1_VM_TARGETS):
191 $(CD) $(GAMMADIR)/make; \
192 $(MAKE) BUILD_DIR=$(MINIMAL1_DIR) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ generic_buildminimal1 $(ALT_OUT)
194 # Install hotspot script in build directory
195 HOTSPOT_SCRIPT=$(BUILD_DIR)/$(BUILD_FLAVOR)/hotspot
196 $(HOTSPOT_SCRIPT): $(GAMMADIR)/make/hotspot.script
197 $(QUIETLY) $(MKDIR) -p $(BUILD_DIR)/$(BUILD_FLAVOR)
198 $(QUIETLY) cat $< | sed -e 's|@@LIBARCH@@|$(LIBARCH)|g' | sed -e 's|@@JDK_IMPORT_PATH@@|$(JDK_IMPORT_PATH)|g' > $@
199 $(QUIETLY) chmod +x $@
201 # Build compiler1 (client) rule, different for platforms
202 generic_build1: $(HOTSPOT_SCRIPT)
203 $(MKDIR) -p $(OUTPUTDIR)
204 ifeq ($(OSNAME),windows)
205 ifeq ($(ARCH_DATA_MODEL), 32)
206 $(CD) $(OUTPUTDIR); \
207 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
208 Variant=compiler1 \
209 WorkSpace=$(ABS_GAMMADIR) \
210 BootStrapDir=$(ABS_BOOTDIR) \
211 BuildUser=$(USERNAME) \
212 $(MAKE_ARGS) $(VM_TARGET:%1=%)
213 else
214 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
215 endif
216 else
217 ifeq ($(ARCH_DATA_MODEL), 32)
218 $(CD) $(OUTPUTDIR); \
219 $(MAKE) -f $(ABS_OS_MAKEFILE) \
220 $(MAKE_ARGS) $(VM_TARGET)
221 else
222 @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
223 endif
224 endif
226 # Build compiler2 (server) rule, different for platforms
227 generic_build2: $(HOTSPOT_SCRIPT)
228 $(MKDIR) -p $(OUTPUTDIR)
229 ifeq ($(OSNAME),windows)
230 $(CD) $(OUTPUTDIR); \
231 $(NMAKE) -f $(ABS_OS_MAKEFILE) \
232 Variant=compiler2 \
233 WorkSpace=$(ABS_GAMMADIR) \
234 BootStrapDir=$(ABS_BOOTDIR) \
235 BuildUser=$(USERNAME) \
236 $(MAKE_ARGS) $(VM_TARGET)
237 else
238 $(CD) $(OUTPUTDIR); \
239 $(MAKE) -f $(ABS_OS_MAKEFILE) \
240 $(MAKE_ARGS) $(VM_TARGET)
241 endif
243 generic_buildcore: $(HOTSPOT_SCRIPT)
244 ifeq ($(HS_ARCH),ppc)
245 ifeq ($(ARCH_DATA_MODEL),64)
246 $(MKDIR) -p $(OUTPUTDIR)
247 $(CD) $(OUTPUTDIR); \
248 $(MAKE) -f $(ABS_OS_MAKEFILE) \
249 $(MAKE_ARGS) $(VM_TARGET)
250 else
251 @$(ECHO) "No ($(VM_TARGET)) for ppc ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
252 endif
253 else
254 @$(ECHO) "No ($(VM_TARGET)) for $(HS_ARCH)"
255 endif
257 generic_buildzero: $(HOTSPOT_SCRIPT)
258 $(MKDIR) -p $(OUTPUTDIR)
259 $(CD) $(OUTPUTDIR); \
260 $(MAKE) -f $(ABS_OS_MAKEFILE) \
261 $(MAKE_ARGS) $(VM_TARGET)
263 generic_buildshark: $(HOTSPOT_SCRIPT)
264 $(MKDIR) -p $(OUTPUTDIR)
265 $(CD) $(OUTPUTDIR); \
266 $(MAKE) -f $(ABS_OS_MAKEFILE) \
267 $(MAKE_ARGS) $(VM_TARGET)
269 generic_buildminimal1: $(HOTSPOT_SCRIPT)
270 ifeq ($(JVM_VARIANT_MINIMAL1),true)
271 $(MKDIR) -p $(OUTPUTDIR)
272 ifeq ($(ARCH_DATA_MODEL), 32)
273 ifeq ($(OSNAME),windows)
274 $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
275 else
276 ifeq ($(OSNAME),solaris)
277 $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
278 else
279 $(CD) $(OUTPUTDIR); \
280 $(MAKE) -f $(ABS_OS_MAKEFILE) $(MAKE_ARGS) $(VM_TARGET) ;
281 endif
282 endif
283 else
284 @$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
285 endif
286 else
287 @$(ECHO) "Error: trying to build a minimal target but JVM_VARIANT_MINIMAL1 is not true."
288 endif
290 # Export file rule
291 generic_export: $(EXPORT_LIST)
293 export_product:
294 $(MAKE) BUILD_FLAVOR=$(@:export_%=%) generic_export
295 export_fastdebug:
296 $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
297 export_debug:
298 $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
299 export_optimized:
300 $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export
302 export_product_jdk::
303 $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export
304 export_optimized_jdk::
305 $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export
306 export_fastdebug_jdk::
307 $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
308 export_debug_jdk::
309 $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export
311 # Export file copy rules
312 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
313 DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
314 C1_BUILD_DIR =$(C1_DIR)/$(BUILD_FLAVOR)
315 C2_BUILD_DIR =$(C2_DIR)/$(BUILD_FLAVOR)
316 CORE_BUILD_DIR =$(CORE_DIR)/$(BUILD_FLAVOR)
317 MINIMAL1_BUILD_DIR=$(MINIMAL1_DIR)/$(BUILD_FLAVOR)
318 ZERO_BUILD_DIR =$(ZERO_DIR)/$(BUILD_FLAVOR)
319 SHARK_BUILD_DIR =$(SHARK_DIR)/$(BUILD_FLAVOR)
321 # Server (C2)
322 ifeq ($(JVM_VARIANT_SERVER), true)
323 # Common
324 $(EXPORT_SERVER_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
325 $(install-file)
326 $(EXPORT_LIB_DIR)/%.jar: $(C2_BUILD_DIR)/../generated/%.jar
327 $(install-file)
328 $(EXPORT_INCLUDE_DIR)/%: $(C2_BUILD_DIR)/../generated/jvmtifiles/%
329 $(install-file)
330 # Windows
331 $(EXPORT_SERVER_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll
332 $(install-file)
333 $(EXPORT_SERVER_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb
334 $(install-file)
335 $(EXPORT_SERVER_DIR)/%.map: $(C2_BUILD_DIR)/%.map
336 $(install-file)
337 $(EXPORT_LIB_DIR)/%.lib: $(C2_BUILD_DIR)/%.lib
338 $(install-file)
339 $(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
340 $(install-file)
341 $(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll
342 $(install-file)
343 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb
344 $(install-file)
345 $(EXPORT_JRE_BIN_DIR)/%.map: $(C2_BUILD_DIR)/%.map
346 $(install-file)
347 # Unix
348 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
349 $(install-file)
350 $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
351 $(install-file)
352 $(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
353 $(install-file)
354 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
355 $(install-file)
356 $(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
357 $(install-file)
358 $(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo
359 $(install-file)
360 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
361 $(install-file)
362 $(EXPORT_SERVER_DIR)/64/%.diz: $(C2_BUILD_DIR)/%.diz
363 $(install-file)
364 endif
366 # Client (C1)
367 ifeq ($(JVM_VARIANT_CLIENT), true)
368 # Common
369 $(EXPORT_CLIENT_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
370 $(install-file)
371 $(EXPORT_LIB_DIR)/%.jar: $(C1_BUILD_DIR)/../generated/%.jar
372 $(install-file)
373 $(EXPORT_INCLUDE_DIR)/%: $(C1_BUILD_DIR)/../generated/jvmtifiles/%
374 $(install-file)
375 # Windows
376 $(EXPORT_CLIENT_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll
377 $(install-file)
378 $(EXPORT_CLIENT_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb
379 $(install-file)
380 $(EXPORT_CLIENT_DIR)/%.map: $(C1_BUILD_DIR)/%.map
381 $(install-file)
382 $(EXPORT_LIB_DIR)/%.lib: $(C1_BUILD_DIR)/%.lib
383 $(install-file)
384 $(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
385 $(install-file)
386 $(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll
387 $(install-file)
388 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb
389 $(install-file)
390 $(EXPORT_JRE_BIN_DIR)/%.map: $(C1_BUILD_DIR)/%.map
391 $(install-file)
392 # Unix
393 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
394 $(install-file)
395 $(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
396 $(install-file)
397 $(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
398 $(install-file)
399 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
400 $(install-file)
401 $(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
402 $(install-file)
403 $(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo
404 $(install-file)
405 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
406 $(install-file)
407 $(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_BUILD_DIR)/%.diz
408 $(install-file)
409 endif
411 # Minimal1
412 ifeq ($(JVM_VARIANT_MINIMAL1), true)
413 # Common
414 $(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
415 $(install-file)
416 $(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_BUILD_DIR)/../generated/%.jar
417 $(install-file)
418 $(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_BUILD_DIR)/../generated/jvmtifiles/%
419 $(install-file)
420 # Windows
421 $(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll
422 $(install-file)
423 $(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb
424 $(install-file)
425 $(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map
426 $(install-file)
427 $(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_BUILD_DIR)/%.lib
428 $(install-file)
429 $(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
430 $(install-file)
431 $(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll
432 $(install-file)
433 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb
434 $(install-file)
435 $(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map
436 $(install-file)
437 # Unix
438 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
439 $(install-file)
440 $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
441 $(install-file)
442 $(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
443 $(install-file)
444 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
445 $(install-file)
446 $(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
447 $(install-file)
448 $(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo
449 $(install-file)
450 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
451 $(install-file)
452 $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
453 $(install-file)
454 endif
456 # Zero
457 ifeq ($(JVM_VARIANT_ZERO), true)
458 # Common
459 $(EXPORT_LIB_DIR)/%.jar: $(ZERO_BUILD_DIR)/../generated/%.jar
460 $(install-file)
461 $(EXPORT_INCLUDE_DIR)/%: $(ZERO_BUILD_DIR)/../generated/jvmtifiles/%
462 $(install-file)
463 # Unix
464 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
465 $(install-file)
466 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
467 $(install-file)
468 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
469 $(install-file)
470 $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
471 $(install-file)
472 $(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
473 $(install-file)
474 $(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
475 $(install-file)
476 endif
478 # Core
479 ifeq ($(JVM_VARIANT_CORE), true)
480 # Common
481 $(EXPORT_LIB_DIR)/%.jar: $(CORE_DIR)/../generated/%.jar
482 $(install-file)
483 $(EXPORT_INCLUDE_DIR)/%: $(CORE_DIR)/../generated/jvmtifiles/%
484 $(install-file)
485 # Unix
486 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(CORE_DIR)/%.$(LIBRARY_SUFFIX)
487 $(install-file)
488 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(CORE_DIR)/%.debuginfo
489 $(install-file)
490 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(CORE_DIR)/%.diz
491 $(install-file)
492 $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(CORE_DIR)/%.$(LIBRARY_SUFFIX)
493 $(install-file)
494 $(EXPORT_SERVER_DIR)/%.debuginfo: $(CORE_DIR)/%.debuginfo
495 $(install-file)
496 $(EXPORT_SERVER_DIR)/%.diz: $(CORE_DIR)/%.diz
497 $(install-file)
498 endif
500 # Shark
501 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
502 # Common
503 $(EXPORT_LIB_DIR)/%.jar: $(SHARK_BUILD_DIR)/../generated/%.jar
504 $(install-file)
505 $(EXPORT_INCLUDE_DIR)/%: $(SHARK_BUILD_DIR)/../generated/jvmtifiles/%
506 $(install-file)
507 # Unix
508 $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
509 $(install-file)
510 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo
511 $(install-file)
512 $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz
513 $(install-file)
514 $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX)
515 $(install-file)
516 $(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo
517 $(install-file)
518 $(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz
519 $(install-file)
520 endif
522 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
523 $(install-file)
525 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
526 $(install-file)
528 HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h)
529 $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
530 $(install-file)
532 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
533 $(install-file)
535 JFR_EXISTS=$(shell if [ -d $(HS_ALT_SRC) ]; then echo 1; else echo 0; fi)
536 # export jfr.h
537 ifeq ($JFR_EXISTS,1)
538 $(EXPORT_INCLUDE_DIR)/%: $(HS_ALT_SRC)/share/vm/jfr/agent/%
539 $(install-file)
540 else
541 $(EXPORT_INCLUDE_DIR)/jfr.h:
542 endif
544 # Doc files (jvmti.html)
545 $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
546 $(install-file)
548 # Xusage file
549 $(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_MINIMAL_DIR)/Xusage.txt: $(XUSAGE)
550 $(prep-target)
551 $(RM) $@.temp
552 $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
553 $(MV) $@.temp $@
555 #
556 # Clean rules
557 #
558 clobber clean: clean_build clean_export clean_jdk
559 clean_build:
560 $(RM) -r $(C1_DIR)
561 $(RM) -r $(C2_DIR)
562 $(RM) -r $(CORE_DIR)
563 $(RM) -r $(ZERO_DIR)
564 $(RM) -r $(SHARK_DIR)
565 $(RM) -r $(MINIMAL1_DIR)
566 clean_export:
567 $(RM) -r $(EXPORT_PATH)
568 clean_jdk:
569 $(RM) -r $(JDK_IMAGE_DIR)
571 #
572 # Create JDK and place this build into it
573 #
574 create_jdk: copy_jdk update_jdk
576 update_jdk: export_product_jdk export_fastdebug_jdk test_jdk
578 copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar
580 $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
581 $(RM) -r $(JDK_IMAGE_DIR)
582 $(MKDIR) -p $(JDK_IMAGE_DIR)
583 ($(CD) $(JDK_IMPORT_PATH) && \
584 $(TAR) -cf - *) | \
585 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
588 # Testing the built JVM
589 RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma
590 generic_test:
591 @$(ECHO) "Running with: $(ALTJVM_DIR)"
592 @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion
593 @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help
595 # C2 test targets
596 test_product test_optimized test_fastdebug test_debug:
597 @$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)"
599 # C1 test targets
600 test_product1 test_optimized1 test_fastdebug1 test_debug1:
601 ifeq ($(ARCH_DATA_MODEL), 32)
602 @$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)"
603 else
604 @$(ECHO) "No compiler1 ($(@:test_%=%)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
605 endif
607 # Zero test targets
608 test_productzero test_optimizedzero test_fastdebugzero test_debugzero:
609 @$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)"
611 # Shark test targets
612 test_productshark test_optimizedshark test_fastdebugshark test_debugshark:
613 @$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)"
615 # Minimal1 test targets
616 test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_debugminimal1:
617 @$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)"
620 test_jdk:
621 ifeq ($(JVM_VARIANT_CLIENT), true)
622 $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
623 $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -version
624 endif
625 ifeq ($(findstring true, $(JVM_VARIANT_SERVER)\
626 $(JVM_VARIANT_ZERO)$(JVM_VARIANT_ZEROSHARK)), true)
627 $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -Xinternalversion
628 $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -version
629 endif
631 copy_product_jdk::
632 $(RM) -r $(JDK_IMAGE_DIR)
633 $(MKDIR) -p $(JDK_IMAGE_DIR)
634 ($(CD) $(JDK_IMPORT_PATH) && \
635 $(TAR) -cf - $(JDK_DIRS)) | \
636 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
638 copy_fastdebug_jdk::
639 $(RM) -r $(JDK_IMAGE_DIR)/fastdebug
640 $(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
641 if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
642 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
643 $(TAR) -cf - $(JDK_DIRS)) | \
644 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
645 else \
646 ($(CD) $(JDK_IMPORT_PATH) && \
647 $(TAR) -cf - $(JDK_DIRS)) | \
648 ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
649 fi
651 copy_debug_jdk::
652 $(RM) -r $(JDK_IMAGE_DIR)/debug
653 $(MKDIR) -p $(JDK_IMAGE_DIR)/debug
654 if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
655 ($(CD) $(JDK_IMPORT_PATH)/debug && \
656 $(TAR) -cf - $(JDK_DIRS)) | \
657 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
658 elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
659 ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
660 $(TAR) -cf - $(JDK_DIRS)) | \
661 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
662 else \
663 ($(CD) $(JDK_IMPORT_PATH) && \
664 $(TAR) -cf - $(JDK_DIRS)) | \
665 ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
666 fi
668 #
669 # Check target
670 #
671 check: variable_check
673 #
674 # Help target
675 #
676 help: intro_help target_help variable_help notes_help examples_help
678 # Intro help message
679 intro_help:
680 @$(ECHO) \
681 "Makefile for the Hotspot workspace."
682 @$(ECHO) \
683 "Default behavior is to build and create an export area for the j2se builds."
685 # Target help
686 target_help:
687 @$(ECHO) "help: This help message"
688 @$(ECHO) "all: Same as: all_product all_fastdebug"
689 @$(ECHO) "world: Same as: all create_jdk"
690 @$(ECHO) "all_product: Same as: product product1 export_product"
691 @$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug"
692 @$(ECHO) "all_debug: Same as: debug debug1 export_debug"
693 @$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized"
694 @$(ECHO) "clean: Clean all areas"
695 @$(ECHO) "export_product: Export product files to EXPORT_PATH"
696 @$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
697 @$(ECHO) "export_debug: Export debug files to EXPORT_PATH"
698 @$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
699 @$(ECHO) "create_jdk: Create JDK image, export all files into it"
700 @$(ECHO) "update_jdk: Update JDK image with fresh exported files"
701 @$(ECHO) " "
702 @$(ECHO) "Other targets are:"
703 @$(ECHO) " $(C1_VM_TARGETS)"
704 @$(ECHO) " $(C2_VM_TARGETS)"
705 @$(ECHO) " $(MINIMAL1_VM_TARGETS)"
707 # Variable help (only common ones used by this workspace)
708 variable_help: variable_help_intro variable_list variable_help_end
709 variable_help_intro:
710 @$(ECHO) "--- Common Variables ---"
711 variable_help_end:
712 @$(ECHO) " "
713 @$(ECHO) "--- Make Arguments ---"
714 @$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"
716 # One line descriptions for the variables
717 SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
718 OUTPUTDIR.desc = Output directory, default is build/<osname>
719 BOOTDIR.desc = JDK used to compile agent java source and test with
720 JDK_IMPORT_PATH.desc = Promoted JDK to copy for 'create_jdk'
721 JDK_IMAGE_DIR.desc = Directory to place JDK to copy
722 EXPORT_PATH.desc = Directory to place files to export for JDK build
724 # Make variables to print out (description and value)
725 VARIABLE_PRINTVAL_LIST += \
726 SLASH_JAVA \
727 OUTPUTDIR \
728 BOOTDIR \
729 JDK_IMPORT_PATH \
730 JDK_IMAGE_DIR \
731 EXPORT_PATH
733 # Make variables that should refer to directories that exist
734 VARIABLE_CHECKDIR_LIST += \
735 SLASH_JAVA \
736 BOOTDIR \
737 JDK_IMPORT_PATH
739 # For pattern rules below, so all are treated the same
740 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
741 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
743 # Complete variable check
744 variable_check: $(DO_CHECKDIR_LIST)
745 variable_list: $(DO_PRINTVAL_LIST) variable_check
747 # Pattern rule for printing out a variable
748 %.printval:
749 @$(ECHO) " ALT_$* - $($*.desc)"
750 @$(ECHO) " $*=$($*)"
752 # Pattern rule for checking to see if a variable with a directory exists
753 %.checkdir:
754 @if [ ! -d $($*) ] ; then \
755 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
756 fi
758 # Pattern rule for checking to see if a variable with a file exists
759 %.checkfil:
760 @if [ ! -f $($*) ] ; then \
761 $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
762 fi
764 # Misc notes on help
765 notes_help:
766 @$(ECHO) \
767 "--- Notes --- "
768 @$(ECHO) \
769 "- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
770 @$(ECHO) \
771 " builds or previous release JDK builds will work."
772 @$(ECHO) \
773 "- The fastest builds have been when the workspace and the BOOTDIR are on"
774 @$(ECHO) \
775 " local disk."
777 examples_help:
778 @$(ECHO) \
779 "--- Examples --- "
780 @$(ECHO) \
781 " $(MAKE) all"
782 @$(ECHO) \
783 " $(MAKE) world"
784 @$(ECHO) \
785 " $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)"
786 @$(ECHO) \
787 " $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"
789 # Universal build support
790 ifeq ($(OS_VENDOR), Darwin)
791 ifeq ($(MACOSX_UNIVERSAL),true)
792 include $(GAMMADIR)/make/$(OSNAME)/makefiles/universal.gmk
793 endif
794 endif
796 # Compatibility for transition to new naming
797 warn_jvmg_deprecated:
798 echo "Warning: The jvmg target has been replaced with debug"
799 echo "Warning: Please update your usage"
801 jvmg: warn_jvmg_deprecated debug
803 jvmg1: warn_jvmg_deprecated debug1
805 jvmgminimal1: warn_jvmg_deprecated debugminimal1
807 jvmgcore: warn_jvmg_deprecated debugcore
809 jvmgzero: warn_jvmg_deprecated debugzero
811 jvmgshark: warn_jvmg_deprecated debugshark
813 # JPRT rule to build this workspace
814 include $(GAMMADIR)/make/jprt.gmk
816 .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
817 $(MINIMAL1_VM_TARGETS) \
818 generic_build1 generic_build2 generic_buildminimal1 generic_export \
819 export_product export_fastdebug export_debug export_optimized \
820 export_jdk_product export_jdk_fastdebug export_jdk_debug \
821 create_jdk copy_jdk update_jdk test_jdk \
822 copy_product_jdk copy_fastdebug_jdk copy_debug_jdk \
823 $(HS_ALT_MAKE)/Makefile.make