2014-12-03 14:20:21 +00:00
|
|
|
#
|
2024-03-14 07:30:42 +00:00
|
|
|
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
2014-12-03 14:20:21 +00:00
|
|
|
# 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. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
2024-04-11 14:15:34 +00:00
|
|
|
|
|
|
|
include CopyFiles.gmk
|
2019-03-05 10:07:19 +00:00
|
|
|
include Execute.gmk
|
2015-11-24 11:18:24 +00:00
|
|
|
include Modules.gmk
|
2023-06-21 18:28:19 +00:00
|
|
|
include Utils.gmk
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2015-01-15 14:09:37 +00:00
|
|
|
JDK_TARGETS :=
|
2014-12-03 14:20:21 +00:00
|
|
|
JRE_TARGETS :=
|
|
|
|
|
|
|
|
# Hook to include the corresponding custom file, if present.
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, Images-pre.gmk))
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2018-12-12 17:50:39 +00:00
|
|
|
################################################################################
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2016-03-23 16:20:41 +00:00
|
|
|
# All modules for the current target platform.
|
2023-06-21 18:28:19 +00:00
|
|
|
ALL_MODULES := $(call FindAllModules) $(EXTRA_MODULES)
|
2016-03-23 16:20:41 +00:00
|
|
|
|
|
|
|
$(eval $(call ReadImportMetaData))
|
2016-03-17 19:03:53 +00:00
|
|
|
|
2016-05-20 08:25:40 +00:00
|
|
|
JRE_MODULES += $(filter $(ALL_MODULES), $(BOOT_MODULES) \
|
2020-12-16 21:57:32 +00:00
|
|
|
$(PLATFORM_MODULES) jdk.jdwp.agent)
|
2016-05-20 08:25:40 +00:00
|
|
|
JDK_MODULES += $(ALL_MODULES)
|
2016-03-17 19:03:53 +00:00
|
|
|
|
2016-05-06 23:21:08 +00:00
|
|
|
JRE_MODULES_LIST := $(call CommaList, $(JRE_MODULES))
|
|
|
|
JDK_MODULES_LIST := $(call CommaList, $(JDK_MODULES))
|
2016-03-17 19:03:53 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
|
|
|
|
|
2023-06-21 18:28:19 +00:00
|
|
|
JMODS_DIRS := $(EXTRA_JMODS_DIR) $(IMAGES_OUTPUTDIR)/jmods
|
|
|
|
|
|
|
|
JDK_JMODS := $(foreach m, $(JDK_MODULES), $(firstword $(wildcard $(addsuffix /$m.jmod, $(JMODS_DIRS)))))
|
|
|
|
JRE_JMODS := $(foreach m, $(JRE_MODULES), $(firstword $(wildcard $(addsuffix /$m.jmod, $(JMODS_DIRS)))))
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2016-06-09 14:12:18 +00:00
|
|
|
JLINK_ORDER_RESOURCES := **module-info.class
|
2016-08-31 12:20:00 +00:00
|
|
|
JLINK_JLI_CLASSES :=
|
2016-05-25 10:53:26 +00:00
|
|
|
ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
|
2016-11-07 12:25:18 +00:00
|
|
|
JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/link_opt/classlist
|
2017-02-17 17:12:53 +00:00
|
|
|
JLINK_JLI_CLASSES := --generate-jli-classes=@$(SUPPORT_OUTPUTDIR)/link_opt/default_jli_trace.txt
|
2016-05-25 10:53:26 +00:00
|
|
|
endif
|
|
|
|
JLINK_ORDER_RESOURCES += \
|
2016-06-09 14:12:18 +00:00
|
|
|
/java.base/java/** \
|
|
|
|
/java.base/jdk/** \
|
|
|
|
/java.base/sun/** \
|
|
|
|
/java.base/com/** \
|
|
|
|
/jdk.localedata/** \
|
2016-05-12 12:57:48 +00:00
|
|
|
#
|
|
|
|
|
2016-11-30 13:58:45 +00:00
|
|
|
JLINK_TOOL := $(JLINK) -J-Djlink.debug=true \
|
2023-06-21 18:28:19 +00:00
|
|
|
--module-path $(call PathList, $(JMODS_DIRS)) \
|
2018-04-25 12:53:35 +00:00
|
|
|
--endian $(OPENJDK_TARGET_CPU_ENDIAN) \
|
2016-05-25 10:53:26 +00:00
|
|
|
--release-info $(BASE_RELEASE_FILE) \
|
|
|
|
--order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
|
2016-12-13 02:56:32 +00:00
|
|
|
--dedup-legal-notices=error-if-not-same-content \
|
2016-08-31 12:20:00 +00:00
|
|
|
$(JLINK_JLI_CLASSES) \
|
2016-05-25 10:53:26 +00:00
|
|
|
#
|
2016-03-17 19:03:53 +00:00
|
|
|
|
2016-11-24 10:50:26 +00:00
|
|
|
JLINK_JRE_EXTRA_OPTS := --no-man-pages --no-header-files --strip-debug
|
2016-10-18 20:26:54 +00:00
|
|
|
|
2016-03-17 19:03:53 +00:00
|
|
|
ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
|
2016-10-18 20:26:54 +00:00
|
|
|
JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
|
2016-03-17 19:03:53 +00:00
|
|
|
endif
|
|
|
|
|
2020-04-28 16:12:02 +00:00
|
|
|
JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" || test "$$?" = "1" )
|
|
|
|
|
2023-06-21 18:28:19 +00:00
|
|
|
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
|
|
|
|
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre
|
|
|
|
|
2019-03-05 10:07:19 +00:00
|
|
|
$(eval $(call SetupExecute, jlink_jdk, \
|
|
|
|
WARN := Creating jdk image, \
|
2023-06-21 18:28:19 +00:00
|
|
|
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \
|
|
|
|
$(call DependOnVariable, JDK_MODULES_LIST, $(JDK_IMAGE_SUPPORT_DIR)/_jlink_jdk.vardeps), \
|
2019-03-05 10:07:19 +00:00
|
|
|
OUTPUT_DIR := $(JDK_IMAGE_DIR), \
|
2023-06-21 18:28:19 +00:00
|
|
|
SUPPORT_DIR := $(JDK_IMAGE_SUPPORT_DIR), \
|
2019-03-05 10:07:19 +00:00
|
|
|
PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
|
|
|
|
COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
|
2020-04-28 16:12:02 +00:00
|
|
|
$(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR) \
|
|
|
|
$(JLINK_DISABLE_WARNINGS), \
|
2019-03-05 10:07:19 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
JLINK_JDK_TARGETS := $(jlink_jdk)
|
|
|
|
|
|
|
|
$(eval $(call SetupExecute, jlink_jre, \
|
|
|
|
WARN := Creating legacy jre image, \
|
2023-06-21 18:28:19 +00:00
|
|
|
DEPS := $(JRE_JMODS) $(BASE_RELEASE_FILE) \
|
|
|
|
$(call DependOnVariable, JRE_MODULES_LIST, $(JRE_IMAGE_SUPPORT_DIR)/_jlink_jre.vardeps), \
|
2019-07-12 19:38:46 +00:00
|
|
|
OUTPUT_DIR := $(JRE_IMAGE_DIR), \
|
2023-06-21 18:28:19 +00:00
|
|
|
SUPPORT_DIR := $(JRE_IMAGE_SUPPORT_DIR), \
|
2019-03-05 10:07:19 +00:00
|
|
|
PRE_COMMAND := $(RM) -r $(JRE_IMAGE_DIR), \
|
|
|
|
COMMAND := $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
|
|
|
|
$(JLINK_JRE_EXTRA_OPTS) --output $(JRE_IMAGE_DIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
JLINK_JRE_TARGETS := $(jlink_jre)
|
|
|
|
|
2022-08-24 22:39:52 +00:00
|
|
|
# Optimize CDS shared heap for small heap sizes, which are typically used
|
|
|
|
# for small cloud-based apps that have the most critical start-up requirement.
|
|
|
|
# The trade-off is that when larger heap sizes are used, the shared heap
|
|
|
|
# may need to be relocated at runtime.
|
|
|
|
CDS_DUMP_FLAGS = -Xmx128M -Xms128M
|
|
|
|
|
2022-08-19 19:16:33 +00:00
|
|
|
# Helper function for creating the CDS archives for the JDK and JRE
|
|
|
|
#
|
|
|
|
# Param1 - VM variant (e.g., server, client, zero, ...)
|
8305895: Implement JEP 450: Compact Object Headers (Experimental)
Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Co-authored-by: Martin Doerr <mdoerr@openjdk.org>
Co-authored-by: Hamlin Li <mli@openjdk.org>
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org>
Co-authored-by: Amit Kumar <amitkumar@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Axel Boldt-Christmas <aboldtch@openjdk.org>
Reviewed-by: coleenp, stefank, stuefe, phh, ihse, lmesnik, tschatzl, matsaave, rcastanedalo, vpaprotski, yzheng, egahlin
2024-11-08 17:21:39 +00:00
|
|
|
# Param2 - _nocoops, _coh, _nocoops_coh, or empty
|
2022-08-19 19:16:33 +00:00
|
|
|
define CreateCDSArchive
|
8305895: Implement JEP 450: Compact Object Headers (Experimental)
Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Co-authored-by: Martin Doerr <mdoerr@openjdk.org>
Co-authored-by: Hamlin Li <mli@openjdk.org>
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org>
Co-authored-by: Amit Kumar <amitkumar@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Axel Boldt-Christmas <aboldtch@openjdk.org>
Reviewed-by: coleenp, stefank, stuefe, phh, ihse, lmesnik, tschatzl, matsaave, rcastanedalo, vpaprotski, yzheng, egahlin
2024-11-08 17:21:39 +00:00
|
|
|
$1_$2_COOPS_OPTION := $(if $(findstring _nocoops, $2),-XX:-UseCompressedOops)
|
|
|
|
# enable and also explicitly disable coh as needed.
|
|
|
|
ifeq ($(call isTargetCpuBits, 64), true)
|
|
|
|
$1_$2_COH_OPTION := -XX:+UnlockExperimentalVMOptions \
|
|
|
|
$(if $(findstring _coh, $2),-XX:+UseCompactObjectHeaders,-XX:-UseCompactObjectHeaders)
|
|
|
|
endif
|
|
|
|
$1_$2_DUMP_EXTRA_ARG := $$($1_$2_COOPS_OPTION) $$($1_$2_COH_OPTION)
|
|
|
|
$1_$2_DUMP_TYPE := $(if $(findstring _nocoops, $2),-NOCOOPS,)$(if $(findstring _coh, $2),-COH,)
|
2022-08-19 19:16:33 +00:00
|
|
|
|
2022-08-24 22:39:52 +00:00
|
|
|
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
|
2024-09-03 15:31:09 +00:00
|
|
|
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)), -XX:+UseG1GC)
|
2022-08-24 22:39:52 +00:00
|
|
|
|
2019-03-12 15:04:33 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
2022-08-19 19:16:33 +00:00
|
|
|
$1_$2_CDS_ARCHIVE := bin/$1/classes$2.jsa
|
2019-03-12 15:04:33 +00:00
|
|
|
else
|
2022-08-19 19:16:33 +00:00
|
|
|
$1_$2_CDS_ARCHIVE := lib/$1/classes$2.jsa
|
2019-03-12 15:04:33 +00:00
|
|
|
endif
|
2019-03-05 10:07:19 +00:00
|
|
|
|
2024-03-14 07:30:42 +00:00
|
|
|
ifneq ($(COMPARE_BUILD), )
|
|
|
|
DEBUG_CDS_ARCHIVE := true
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG_CDS_ARCHIVE), true)
|
|
|
|
$1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
|
|
|
|
endif
|
|
|
|
|
2022-08-19 19:16:33 +00:00
|
|
|
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \
|
|
|
|
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jdk image for $1, \
|
2022-08-24 22:39:52 +00:00
|
|
|
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
|
2022-08-19 19:16:33 +00:00
|
|
|
DEPS := $$(jlink_jdk), \
|
|
|
|
OUTPUT_FILE := $$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
|
2023-06-21 18:28:19 +00:00
|
|
|
SUPPORT_DIR := $$(JDK_IMAGE_SUPPORT_DIR), \
|
2022-08-19 19:16:33 +00:00
|
|
|
COMMAND := $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
|
|
|
|
-XX:SharedArchiveFile=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
|
2022-08-24 22:39:52 +00:00
|
|
|
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
|
2019-03-05 10:07:19 +00:00
|
|
|
))
|
|
|
|
|
2022-08-19 19:16:33 +00:00
|
|
|
JDK_TARGETS += $$($1_$2_gen_cds_archive_jdk)
|
2019-03-05 10:07:19 +00:00
|
|
|
|
2022-08-19 19:16:33 +00:00
|
|
|
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jre, \
|
|
|
|
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jre image for $1, \
|
2022-08-24 22:39:52 +00:00
|
|
|
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
|
2022-08-19 19:16:33 +00:00
|
|
|
DEPS := $$(jlink_jre), \
|
|
|
|
OUTPUT_FILE := $$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
|
2023-06-21 18:28:19 +00:00
|
|
|
SUPPORT_DIR := $$(JRE_IMAGE_SUPPORT_DIR), \
|
2022-08-19 19:16:33 +00:00
|
|
|
COMMAND := $$(FIXPATH) $$(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
|
|
|
|
-XX:SharedArchiveFile=$$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
|
2022-08-24 22:39:52 +00:00
|
|
|
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
|
2019-03-05 10:07:19 +00:00
|
|
|
))
|
|
|
|
|
2022-08-19 19:16:33 +00:00
|
|
|
JRE_TARGETS += $$($1_$2_gen_cds_archive_jre)
|
|
|
|
endef
|
|
|
|
|
|
|
|
ifeq ($(BUILD_CDS_ARCHIVE), true)
|
|
|
|
$(foreach v, $(JVM_VARIANTS), \
|
|
|
|
$(eval $(call CreateCDSArchive,$v,)) \
|
|
|
|
)
|
2020-05-14 21:24:55 +00:00
|
|
|
|
2020-05-18 16:28:06 +00:00
|
|
|
ifeq ($(call isTargetCpuBits, 64), true)
|
2022-08-19 19:16:33 +00:00
|
|
|
$(foreach v, $(JVM_VARIANTS), \
|
|
|
|
$(eval $(call CreateCDSArchive,$v,_nocoops)) \
|
|
|
|
)
|
8305895: Implement JEP 450: Compact Object Headers (Experimental)
Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Co-authored-by: Martin Doerr <mdoerr@openjdk.org>
Co-authored-by: Hamlin Li <mli@openjdk.org>
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org>
Co-authored-by: Amit Kumar <amitkumar@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Axel Boldt-Christmas <aboldtch@openjdk.org>
Reviewed-by: coleenp, stefank, stuefe, phh, ihse, lmesnik, tschatzl, matsaave, rcastanedalo, vpaprotski, yzheng, egahlin
2024-11-08 17:21:39 +00:00
|
|
|
ifeq ($(BUILD_CDS_ARCHIVE_COH), true)
|
|
|
|
$(foreach v, $(JVM_VARIANTS), \
|
|
|
|
$(eval $(call CreateCDSArchive,$v,_coh)) \
|
|
|
|
)
|
|
|
|
$(foreach v, $(JVM_VARIANTS), \
|
|
|
|
$(eval $(call CreateCDSArchive,$v,_nocoops_coh)) \
|
|
|
|
)
|
|
|
|
endif
|
2020-05-18 16:28:06 +00:00
|
|
|
endif
|
2019-03-05 10:07:19 +00:00
|
|
|
endif
|
2014-12-03 14:20:21 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# src.zip
|
|
|
|
|
2016-11-29 23:20:30 +00:00
|
|
|
$(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
|
2017-09-25 08:32:00 +00:00
|
|
|
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
|
2014-12-03 14:20:21 +00:00
|
|
|
$(install-file)
|
|
|
|
|
2016-11-29 23:20:30 +00:00
|
|
|
JDK_TARGETS += $(JDK_IMAGE_DIR)/lib/src.zip
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2016-05-06 23:21:08 +00:00
|
|
|
################################################################################
|
2014-12-03 14:20:21 +00:00
|
|
|
# /demo dir
|
2016-10-05 08:49:21 +00:00
|
|
|
# Avoid doing the expensive find unless called with "jdk" as target.
|
|
|
|
ifneq ($(filter jdk, $(MAKECMDGOALS)), )
|
|
|
|
|
|
|
|
DEMO_FILES := \
|
|
|
|
$(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \
|
|
|
|
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \
|
2017-10-17 13:46:09 +00:00
|
|
|
-type f -a ! \( -name "_the*" -o -name "javac_state" \) ) \
|
2016-10-05 08:49:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
2016-10-05 08:49:21 +00:00
|
|
|
DEMO_FILES := $(call not-containing, .dSYM, $(DEMO_FILES))
|
|
|
|
else
|
|
|
|
DEMO_FILES := $(filter-out %.debuginfo %.pdb %.map, $(DEMO_FILES))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-01-16 12:01:43 +00:00
|
|
|
$(eval $(call SetupCopyFiles, JDK_COPY_DEMOS, \
|
|
|
|
SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
|
|
|
|
DEST := $(JDK_IMAGE_DIR)/demo, \
|
2016-10-05 08:49:21 +00:00
|
|
|
FILES := $(DEMO_FILES), \
|
2016-01-16 12:01:43 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
JDK_TARGETS += $(JDK_COPY_DEMOS)
|
2014-12-03 14:20:21 +00:00
|
|
|
endif
|
|
|
|
|
2015-03-10 13:36:56 +00:00
|
|
|
################################################################################
|
|
|
|
# Code coverage data files
|
|
|
|
|
|
|
|
ifeq ($(GCOV_ENABLED), true)
|
|
|
|
|
2024-09-03 15:31:09 +00:00
|
|
|
$(eval $(call SetupCopyFiles, COPY_GCOV_GCNO, \
|
2017-09-25 08:32:00 +00:00
|
|
|
SRC := $(OUTPUTDIR), \
|
2015-03-17 13:16:30 +00:00
|
|
|
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
|
2017-10-24 08:41:45 +00:00
|
|
|
FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/native, *.gcno) \
|
|
|
|
))
|
2015-03-10 13:36:56 +00:00
|
|
|
|
2017-10-24 08:41:45 +00:00
|
|
|
SYMBOLS_TARGETS += $(COPY_GCOV_GCNO)
|
2015-03-10 13:36:56 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2016-04-28 15:33:49 +00:00
|
|
|
################################################################################
|
|
|
|
# Debug symbols
|
|
|
|
# Since debug symbols are not included in the jmod files, they need to be copied
|
|
|
|
# in manually after generating the images.
|
|
|
|
|
|
|
|
ALL_JDK_MODULES := $(JDK_MODULES)
|
|
|
|
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
|
|
|
|
$(call FindTransitiveDepsForModule, $m)))
|
2020-08-28 19:03:50 +00:00
|
|
|
ALL_SYMBOLS_MODULES := $(JDK_MODULES)
|
2016-04-28 15:33:49 +00:00
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, windows), true)
|
2016-04-28 15:33:49 +00:00
|
|
|
LIBS_TARGET_SUBDIR := bin
|
|
|
|
else
|
|
|
|
LIBS_TARGET_SUBDIR := lib
|
|
|
|
endif
|
2020-02-07 07:38:40 +00:00
|
|
|
CMDS_TARGET_SUBDIR := bin
|
2016-04-28 15:33:49 +00:00
|
|
|
|
|
|
|
# Param 1 - dir to find debuginfo files in
|
|
|
|
FindDebuginfoFiles = \
|
|
|
|
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
|
|
|
|
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
|
|
|
|
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))
|
|
|
|
|
2016-10-05 08:49:21 +00:00
|
|
|
# Pick the correct debug info files to copy, either zipped or not.
|
|
|
|
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
|
|
|
DEBUGINFO_SUFFIXES += .diz
|
|
|
|
else
|
|
|
|
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
|
|
|
|
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
|
|
|
|
# dirs.
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
2017-10-24 08:41:45 +00:00
|
|
|
$(call FillFindCache, \
|
2020-02-07 07:38:40 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
|
2016-10-05 08:49:21 +00:00
|
|
|
FindDebuginfoFiles = \
|
2017-10-24 08:41:45 +00:00
|
|
|
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
|
2016-10-05 08:49:21 +00:00
|
|
|
endif
|
2016-04-28 15:33:49 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Param 1 - either JDK or JRE
|
|
|
|
SetupCopyDebuginfo = \
|
|
|
|
$(foreach m, $(ALL_$1_MODULES), \
|
|
|
|
$(eval $(call SetupCopyFiles, COPY_$1_LIBS_DEBUGINFO_$m, \
|
|
|
|
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/$m, \
|
|
|
|
DEST := $($1_IMAGE_DIR)/$(LIBS_TARGET_SUBDIR), \
|
|
|
|
FILES := $(call FindDebuginfoFiles, \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/$m), \
|
|
|
|
)) \
|
|
|
|
$(eval $1_TARGETS += $$(COPY_$1_LIBS_DEBUGINFO_$m)) \
|
2020-02-07 07:38:40 +00:00
|
|
|
$(eval $(call SetupCopyFiles, COPY_$1_CMDS_DEBUGINFO_$m, \
|
|
|
|
SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds/$m, \
|
|
|
|
DEST := $($1_IMAGE_DIR)/$(CMDS_TARGET_SUBDIR), \
|
2023-10-25 17:30:21 +00:00
|
|
|
FILES := $(call FindDebuginfoFiles, \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_cmds/$m), \
|
2020-02-07 07:38:40 +00:00
|
|
|
)) \
|
|
|
|
$(eval $1_TARGETS += $$(COPY_$1_CMDS_DEBUGINFO_$m)) \
|
2016-04-28 15:33:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# No space before argument to avoid having to put $(strip ) everywhere in
|
|
|
|
# implementation above.
|
|
|
|
$(call SetupCopyDebuginfo,JDK)
|
|
|
|
$(call SetupCopyDebuginfo,JRE)
|
2020-08-28 19:03:50 +00:00
|
|
|
$(call SetupCopyDebuginfo,SYMBOLS)
|
2016-04-28 15:33:49 +00:00
|
|
|
|
2014-12-03 14:20:21 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Include custom post hook here to make it possible to augment the target lists
|
|
|
|
# before actual target prerequisites are declared.
|
2017-10-05 10:41:06 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, Images-post.gmk))
|
2014-12-03 14:20:21 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-03-05 10:07:19 +00:00
|
|
|
$(JRE_TARGETS): $(JLINK_JRE_TARGETS)
|
|
|
|
$(JDK_TARGETS): $(JLINK_JDK_TARGETS)
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2019-03-05 10:07:19 +00:00
|
|
|
jdk: $(JLINK_JDK_TARGETS) $(JDK_TARGETS)
|
|
|
|
jre: $(JLINK_JRE_TARGETS) $(JRE_TARGETS)
|
2016-10-05 08:49:21 +00:00
|
|
|
symbols: $(SYMBOLS_TARGETS)
|
|
|
|
|
|
|
|
all: jdk jre symbols
|
2014-12-03 14:20:21 +00:00
|
|
|
|
2018-05-04 00:36:25 +00:00
|
|
|
.PHONY: default all jdk jre symbols
|