2016-05-04 21:29:01 +08:00
|
|
|
#
|
2020-02-13 17:07:38 +08:00
|
|
|
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
2016-05-04 21:29:01 +08: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
|
|
|
|
|
|
|
|
PRODUCT_TARGETS :=
|
2019-03-31 04:29:37 +08:00
|
|
|
LEGACY_TARGETS :=
|
2016-05-04 21:29:01 +08:00
|
|
|
TEST_TARGETS :=
|
|
|
|
DOCS_TARGETS :=
|
|
|
|
|
|
|
|
# On Windows tar frequently complains that "file changed as we read it" for
|
|
|
|
# some random source files. This seems to be cause by anti virus scanners and
|
|
|
|
# is most likely safe to ignore. When it happens, tar returns '1'.
|
2019-02-07 19:35:45 +08:00
|
|
|
ifeq ($(call isBuildOs, windows), true)
|
2016-05-04 21:29:01 +08:00
|
|
|
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Hook to include the corresponding custom file, if present.
|
2017-10-05 18:41:06 +08:00
|
|
|
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
|
2016-05-04 21:29:01 +08:00
|
|
|
################################################################################
|
|
|
|
# BUNDLE : Name of bundle to create
|
2016-12-13 19:31:43 +08:00
|
|
|
# FILES : Files in BASE_DIRS to add to bundle
|
|
|
|
# SPECIAL_INCLUDES : List of directories inside BASE_DIRS to look for additional
|
2016-05-04 21:29:01 +08:00
|
|
|
# files in. These files will not get proper dependency handling. Use when
|
|
|
|
# files or directories may contain spaces.
|
2016-12-13 19:31:43 +08:00
|
|
|
# BASE_DIRS : Base directories for the root dir in the bundle.
|
2016-05-04 21:29:01 +08:00
|
|
|
# SUBDIR : Optional name of root dir in bundle.
|
2019-10-22 00:26:14 +08:00
|
|
|
# OUTPUTDIR : Optionally override output dir
|
2016-05-04 21:29:01 +08:00
|
|
|
SetupBundleFile = $(NamedParamsMacroTemplate)
|
|
|
|
define SetupBundleFileBody
|
|
|
|
|
2016-12-13 19:31:43 +08:00
|
|
|
$$(foreach d, $$($1_BASE_DIRS), \
|
|
|
|
$$(eval $1_$$d_RELATIVE_FILES := $$$$(patsubst $$d/%, %, \
|
|
|
|
$$$$(filter $$d/%, $$$$($1_FILES)))) \
|
2016-12-13 23:19:20 +08:00
|
|
|
$$(eval $1_$$d_LIST_FILE := \
|
2017-09-25 16:32:00 +08:00
|
|
|
$(SUPPORT_OUTPUTDIR)/bundles/_$1_$$$$(subst /,_,$$$$(patsubst $(OUTPUTDIR)/%,%,$$d)_files)) \
|
2016-12-13 19:31:43 +08:00
|
|
|
)
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )
|
|
|
|
$1_TYPE := tar.gz
|
|
|
|
else ifneq ($$(filter %.zip, $$($1_BUNDLE_NAME)), )
|
|
|
|
$1_TYPE := zip
|
|
|
|
else
|
|
|
|
$$(error Unknown bundle type $$($1_BUNDLE_NAME))
|
|
|
|
endif
|
|
|
|
|
|
|
|
$$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
|
|
|
|
|
2019-10-22 00:26:14 +08:00
|
|
|
$$(call SetIfEmpty, $1_OUTPUTDIR, $$(BUNDLES_OUTPUTDIR))
|
|
|
|
|
|
|
|
$$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
|
2018-10-10 05:57:23 +08:00
|
|
|
$$(call MakeTargetDir)
|
2019-10-22 00:26:14 +08:00
|
|
|
$$(call LogWarn, Creating $$($1_BUNDLE_NAME))
|
2017-10-24 16:41:45 +08:00
|
|
|
# If any of the files contain a space in the file name, FindFiles
|
2017-10-13 19:42:10 +08:00
|
|
|
# will have replaced it with ?. Tar does not accept that so need to
|
|
|
|
# switch it back.
|
2016-12-13 19:31:43 +08:00
|
|
|
$$(foreach d, $$($1_BASE_DIRS), \
|
|
|
|
$$(eval $$(call ListPathsSafely, \
|
|
|
|
$1_$$d_RELATIVE_FILES, $$($1_$$d_LIST_FILE))) \
|
2017-10-13 19:42:10 +08:00
|
|
|
$$(CAT) $$($1_$$d_LIST_FILE) | $$(TR) '?' ' ' > $$($1_$$d_LIST_FILE).tmp \
|
|
|
|
&& $(MV) $$($1_$$d_LIST_FILE).tmp $$($1_$$d_LIST_FILE) $$(NEWLINE) \
|
2016-12-13 19:31:43 +08:00
|
|
|
)
|
2016-05-04 21:29:01 +08:00
|
|
|
ifneq ($$($1_SPECIAL_INCLUDES), )
|
|
|
|
$$(foreach i, $$($1_SPECIAL_INCLUDES), \
|
2017-01-12 21:47:38 +08:00
|
|
|
$$(foreach d, $$($1_BASE_DIRS), \
|
|
|
|
($(CD) $$d && $(FIND) $$i >> $$($1_$$d_LIST_FILE)) ; ))
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
2016-12-13 19:31:43 +08:00
|
|
|
ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO), .-zip-false)
|
|
|
|
# If no subdir is specified, zip can be done directly from BASE_DIRS.
|
|
|
|
$$(foreach d, $$($1_BASE_DIRS), \
|
|
|
|
( $(CD) $$d \
|
|
|
|
&& $(ZIPEXE) -qru $$@ . -i@$$($1_$$d_LIST_FILE) \
|
|
|
|
|| test "$$$$?" = "12" )$$(NEWLINE))
|
|
|
|
else ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
|
|
|
|
.-tar.gz-false-1)
|
|
|
|
# If no subdir is specified and only one BASE_DIR, tar.gz can be done
|
|
|
|
# directly from BASE_DIR.
|
|
|
|
$(CD) $$($1_BASE_DIRS) \
|
|
|
|
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
|
|
|
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
|
|
|
|
$(TAR_IGNORE_EXIT_VALUE) ) \
|
|
|
|
| $(GZIP) > $$@
|
|
|
|
else ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
|
|
|
|
tar.gz-true-false-1)
|
|
|
|
# If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
|
|
|
|
# transform option to create bundle directly from the BASE_DIR.
|
|
|
|
$(CD) $$($1_BASE_DIRS) \
|
|
|
|
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
|
|
|
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
|
2016-12-22 00:53:11 +08:00
|
|
|
$$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
|
2016-12-13 19:31:43 +08:00
|
|
|
$(TAR_IGNORE_EXIT_VALUE) ) \
|
|
|
|
| $(GZIP) > $$@
|
2016-05-04 21:29:01 +08:00
|
|
|
else
|
2016-12-13 19:31:43 +08:00
|
|
|
# In all other cases, need to copy all files into a temporary location
|
|
|
|
# before creation bundle.
|
|
|
|
$(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
|
|
|
|
$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
|
|
|
|
$$(foreach d, $$($1_BASE_DIRS), \
|
|
|
|
( $(CD) $$d \
|
|
|
|
&& $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
|
|
|
|
$(TAR_IGNORE_EXIT_VALUE) ) \
|
|
|
|
| ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
|
|
|
|
# Unzip any zipped debuginfo files
|
|
|
|
ifeq ($$($1_UNZIP_DEBUGINFO), true)
|
|
|
|
for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
|
|
|
|
$(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
|
|
|
|
done
|
|
|
|
endif
|
2016-05-04 21:29:01 +08:00
|
|
|
ifeq ($$($1_TYPE), tar.gz)
|
2016-12-13 19:31:43 +08:00
|
|
|
$(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
|
|
|
|
( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
|
|
|
|
$$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
|
|
|
|
| $(GZIP) > $$@
|
2016-05-04 21:29:01 +08:00
|
|
|
else ifeq ($$($1_TYPE), zip)
|
2016-12-13 19:31:43 +08:00
|
|
|
$(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIPEXE) -qr $$@ .
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-10-22 00:26:14 +08:00
|
|
|
$1 += $$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME)
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# On Macosx, we bundle up the macosx specific images which already have the
|
|
|
|
# correct base directories.
|
2019-02-07 19:35:45 +08:00
|
|
|
ifeq ($(call isTargetOs, macosx)+$(DEBUG_LEVEL), true+release)
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_BUNDLE_SUBDIR :=
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_BUNDLE_SUBDIR :=
|
2019-12-13 03:37:38 +08:00
|
|
|
# In certain situations, the JDK_IMAGE_DIR points to an image without the
|
|
|
|
# the symbols and demos. If so, the symobls and demos can be found in a
|
|
|
|
# separate image. These variables allow for overriding from a custom makefile.
|
|
|
|
JDK_SYMBOLS_IMAGE_DIR ?= $(JDK_IMAGE_DIR)
|
|
|
|
JDK_DEMOS_IMAGE_DIR ?= $(JDK_IMAGE_DIR)
|
|
|
|
JDK_DEMOS_IMAGE_HOMEDIR ?= $(JDK_DEMOS_IMAGE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR)/Home
|
2016-05-04 21:29:01 +08:00
|
|
|
else
|
|
|
|
JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
|
2016-05-04 21:29:01 +08:00
|
|
|
ifneq ($(DEBUG_LEVEL), release)
|
|
|
|
JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
|
2019-03-31 04:29:37 +08:00
|
|
|
JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
2019-12-13 03:37:38 +08:00
|
|
|
# In certain situations, the JDK_IMAGE_DIR points to an image without the
|
|
|
|
# the symbols and demos. If so, the symobls and demos can be found in a
|
|
|
|
# separate image. These variables allow for overriding from a custom makefile.
|
|
|
|
JDK_SYMBOLS_IMAGE_DIR ?= $(JDK_IMAGE_DIR)
|
|
|
|
JDK_DEMOS_IMAGE_DIR ?= $(JDK_IMAGE_DIR)
|
|
|
|
JDK_DEMOS_IMAGE_HOMEDIR ?= $(JDK_DEMOS_IMAGE_DIR)
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-10-22 00:26:14 +08:00
|
|
|
ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
|
|
|
|
|
2017-10-24 16:41:45 +08:00
|
|
|
# There may be files with spaces in the names, so use ShellFindFiles
|
|
|
|
# explicitly.
|
|
|
|
ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
|
2019-12-13 03:37:38 +08:00
|
|
|
ifneq ($(JDK_IMAGE_DIR), $(JDK_SYMBOLS_IMAGE_DIR))
|
|
|
|
ALL_JDK_SYMBOLS_FILES := $(call ShellFindFiles, $(JDK_SYMBOLS_IMAGE_DIR))
|
|
|
|
else
|
|
|
|
ALL_JDK_SYMBOLS_FILES := $(ALL_JDK_FILES)
|
|
|
|
endif
|
|
|
|
ifneq ($(JDK_IMAGE_DIR), $(JDK_DEMOS_IMAGE_DIR))
|
|
|
|
ALL_JDK_DEMOS_FILES := $(call ShellFindFiles, $(JDK_DEMOS_IMAGE_DIR))
|
|
|
|
else
|
|
|
|
ALL_JDK_DEMOS_FILES := $(ALL_JDK_FILES)
|
|
|
|
endif
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
# Create special filter rules when dealing with unzipped .dSYM directories on
|
|
|
|
# macosx
|
2019-02-07 19:35:45 +08:00
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
2017-11-24 16:45:39 +08:00
|
|
|
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
|
2016-05-04 21:29:01 +08:00
|
|
|
JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
|
2019-12-13 03:37:38 +08:00
|
|
|
$(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, \
|
|
|
|
$(ALL_JDK_SYMBOLS_FILES))))
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
JDK_BUNDLE_FILES := \
|
|
|
|
$(filter-out \
|
|
|
|
$(JDK_SYMBOLS_EXCLUDE_PATTERN) \
|
|
|
|
$(JDK_EXTRA_EXCLUDES) \
|
|
|
|
$(SYMBOLS_EXCLUDE_PATTERN) \
|
2017-05-11 05:55:31 +08:00
|
|
|
$(JDK_IMAGE_HOMEDIR)/demo/% \
|
2016-05-04 21:29:01 +08:00
|
|
|
, \
|
|
|
|
$(ALL_JDK_FILES) \
|
|
|
|
)
|
|
|
|
JDK_SYMBOLS_BUNDLE_FILES := \
|
|
|
|
$(filter \
|
|
|
|
$(JDK_SYMBOLS_EXCLUDE_PATTERN) \
|
|
|
|
$(SYMBOLS_EXCLUDE_PATTERN) \
|
|
|
|
, \
|
2016-08-03 16:37:08 +08:00
|
|
|
$(filter-out \
|
2017-04-18 10:23:42 +08:00
|
|
|
$(JDK_IMAGE_HOMEDIR)/demo/% \
|
2016-08-03 16:37:08 +08:00
|
|
|
, \
|
2019-12-13 03:37:38 +08:00
|
|
|
$(ALL_JDK_SYMBOLS_FILES) \
|
2016-08-03 16:37:08 +08:00
|
|
|
) \
|
2016-05-04 21:29:01 +08:00
|
|
|
) \
|
2017-10-24 16:41:45 +08:00
|
|
|
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2019-12-13 03:37:38 +08:00
|
|
|
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
|
|
|
|
$(ALL_JDK_DEMOS_FILES))
|
2017-10-24 21:36:56 +08:00
|
|
|
|
2017-10-24 16:41:45 +08:00
|
|
|
ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
|
2019-03-31 04:29:37 +08:00
|
|
|
|
|
|
|
# Create special filter rules when dealing with unzipped .dSYM directories on
|
|
|
|
# macosx
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
|
|
|
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
|
|
|
|
JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
|
|
|
|
$(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
JRE_BUNDLE_FILES := $(filter-out \
|
|
|
|
$(JRE_SYMBOLS_EXCLUDE_PATTERN) \
|
|
|
|
$(SYMBOLS_EXCLUDE_PATTERN), \
|
|
|
|
$(ALL_JRE_FILES))
|
|
|
|
|
2020-02-13 17:07:38 +08:00
|
|
|
# On Macosx release builds, when there is a code signing certificate available,
|
|
|
|
# the final bundle layout can be signed.
|
|
|
|
SIGN_BUNDLE := false
|
|
|
|
ifeq ($(call isTargetOs, macosx)+$(DEBUG_LEVEL), true+release)
|
|
|
|
ifneq ($(CODESIGN), )
|
|
|
|
SIGN_BUNDLE := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SIGN_BUNDLE), true)
|
|
|
|
# Macosx release build and code signing available.
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# JDK bundle
|
|
|
|
$(eval $(call SetupCopyFiles, CREATE_JDK_BUNDLE_DIR_SIGNED, \
|
|
|
|
SRC := $(JDK_IMAGE_DIR), \
|
|
|
|
FILES := $(JDK_BUNDLE_FILES), \
|
|
|
|
DEST := $(JDK_MACOSX_BUNDLE_DIR_SIGNED), \
|
|
|
|
))
|
|
|
|
|
|
|
|
JDK_SIGNED_CODE_RESOURCES := \
|
|
|
|
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_CONTENTS_SUBDIR)/_CodeSignature/CodeResources
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2020-02-13 17:07:38 +08:00
|
|
|
$(JDK_SIGNED_CODE_RESOURCES): $(CREATE_JDK_BUNDLE_DIR_SIGNED)
|
|
|
|
$(call LogWarn, Signing $(JDK_BUNDLE_NAME))
|
|
|
|
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
|
|
|
|
--timestamp --options runtime --deep --force \
|
|
|
|
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
|
|
|
|
$(TOUCH) $@
|
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
|
|
|
|
FILES := \
|
|
|
|
$(CREATE_JDK_BUNDLE_DIR_SIGNED) \
|
|
|
|
$(JDK_SIGNED_CODE_RESOURCES), \
|
|
|
|
BASE_DIRS := $(JDK_MACOSX_BUNDLE_DIR_SIGNED), \
|
|
|
|
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# JRE bundle
|
|
|
|
$(eval $(call SetupCopyFiles, CREATE_JRE_BUNDLE_DIR_SIGNED, \
|
|
|
|
SRC := $(JRE_IMAGE_DIR), \
|
|
|
|
FILES := $(JRE_BUNDLE_FILES), \
|
|
|
|
DEST := $(JRE_MACOSX_BUNDLE_DIR_SIGNED), \
|
|
|
|
))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2020-02-13 17:07:38 +08:00
|
|
|
JRE_SIGNED_CODE_RESOURCES := \
|
|
|
|
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_CONTENTS_SUBDIR)/_CodeSignature/CodeResources
|
2019-03-31 04:29:37 +08:00
|
|
|
|
2020-02-13 17:07:38 +08:00
|
|
|
$(JRE_SIGNED_CODE_RESOURCES): $(CREATE_JRE_BUNDLE_DIR_SIGNED)
|
|
|
|
$(call LogWarn, Signing $(JRE_BUNDLE_NAME))
|
|
|
|
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
|
|
|
|
--timestamp --options runtime --deep --force \
|
|
|
|
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
|
|
|
|
$(TOUCH) $@
|
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
|
|
|
|
FILES := \
|
|
|
|
$(CREATE_JRE_BUNDLE_DIR_SIGNED) \
|
|
|
|
$(JRE_SIGNED_CODE_RESOURCES), \
|
|
|
|
BASE_DIRS := $(JRE_MACOSX_BUNDLE_DIR_SIGNED), \
|
|
|
|
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
|
|
|
|
else
|
|
|
|
# Not a Macosx release build or code signing not available.
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
|
|
|
|
FILES := $(JDK_BUNDLE_FILES), \
|
|
|
|
SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
|
|
|
|
BASE_DIRS := $(JDK_IMAGE_DIR), \
|
|
|
|
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
|
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
|
|
|
|
FILES := $(JRE_BUNDLE_FILES), \
|
|
|
|
BASE_DIRS := $(JRE_IMAGE_DIR), \
|
|
|
|
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
|
|
|
|
endif
|
2019-03-31 04:29:37 +08:00
|
|
|
|
2019-12-13 03:37:38 +08:00
|
|
|
ifeq ($(COPY_DEBUG_SYMBOLS), true)
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
|
|
|
|
FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
|
|
|
|
BASE_DIRS := $(JDK_SYMBOLS_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
|
|
|
|
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
|
|
|
UNZIP_DEBUGINFO := true, \
|
|
|
|
))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2019-12-13 03:37:38 +08:00
|
|
|
PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
|
|
|
|
endif
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2017-10-24 21:36:56 +08:00
|
|
|
# The demo bundle is only created to support client tests. Ideally it should
|
|
|
|
# be built with the main test bundle, but since the prerequisites match
|
|
|
|
# better with the product build, it makes more sense to keep it there for now.
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_TEST_DEMOS_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(TEST_DEMOS_BUNDLE_NAME), \
|
|
|
|
FILES := $(TEST_DEMOS_BUNDLE_FILES), \
|
2019-12-13 03:37:38 +08:00
|
|
|
BASE_DIRS := $(JDK_DEMOS_IMAGE_DIR), \
|
2017-10-24 21:36:56 +08:00
|
|
|
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
PRODUCT_TARGETS += $(BUILD_TEST_DEMOS_BUNDLE)
|
2016-05-04 21:29:01 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
|
2017-10-24 16:41:45 +08:00
|
|
|
TEST_BUNDLE_FILES := $(call FindFiles, $(TEST_IMAGE_DIR))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
|
2016-11-07 21:15:49 +08:00
|
|
|
FILES := $(TEST_BUNDLE_FILES), \
|
2016-12-13 19:31:43 +08:00
|
|
|
BASE_DIRS := $(TEST_IMAGE_DIR), \
|
2016-05-04 21:29:01 +08:00
|
|
|
))
|
|
|
|
|
|
|
|
TEST_TARGETS += $(BUILD_TEST_BUNDLE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
|
2017-10-24 16:41:45 +08:00
|
|
|
DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
|
|
|
|
FILES := $(DOCS_BUNDLE_FILES), \
|
2016-12-13 19:31:43 +08:00
|
|
|
BASE_DIRS := $(DOCS_IMAGE_DIR), \
|
2016-05-04 21:29:01 +08:00
|
|
|
SUBDIR := docs, \
|
|
|
|
))
|
|
|
|
|
|
|
|
DOCS_TARGETS += $(BUILD_DOCS_BUNDLE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2018-11-29 22:34:46 +08:00
|
|
|
ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
|
2017-10-24 16:41:45 +08:00
|
|
|
JCOV_BUNDLE_FILES := $(call FindFiles, $(JCOV_IMAGE_DIR))
|
2018-11-29 22:34:46 +08:00
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_JCOV_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \
|
|
|
|
FILES := $(JCOV_BUNDLE_FILES), \
|
|
|
|
BASE_DIRS := $(JCOV_IMAGE_DIR), \
|
|
|
|
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
JCOV_TARGETS += $(BUILD_JCOV_BUNDLE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2019-10-30 03:01:14 +08:00
|
|
|
ifneq ($(filter static-libs-bundles, $(MAKECMDGOALS)), )
|
|
|
|
STATIC_LIBS_BUNDLE_FILES := $(call FindFiles, $(STATIC_LIBS_IMAGE_DIR))
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
|
|
|
|
STATIC_LIBS_BUNDLE_SUBDIR := $(JDK_MACOSX_CONTENTS_SUBDIR)/Home
|
|
|
|
else
|
|
|
|
STATIC_LIBS_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call SetupBundleFile, BUILD_STATIC_LIBS_BUNDLE, \
|
|
|
|
BUNDLE_NAME := $(STATIC_LIBS_BUNDLE_NAME), \
|
|
|
|
FILES := $(STATIC_LIBS_BUNDLE_FILES), \
|
|
|
|
BASE_DIRS := $(STATIC_LIBS_IMAGE_DIR), \
|
|
|
|
SUBDIR := $(STATIC_LIBS_BUNDLE_SUBDIR), \
|
|
|
|
))
|
|
|
|
|
|
|
|
STATIC_LIBS_TARGETS += $(BUILD_STATIC_LIBS_BUNDLE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2016-05-04 21:29:01 +08:00
|
|
|
# Hook to include the corresponding custom file, if present.
|
2017-10-05 18:41:06 +08:00
|
|
|
$(eval $(call IncludeCustomExtension, Bundles.gmk))
|
2016-05-04 21:29:01 +08:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
product-bundles: $(PRODUCT_TARGETS)
|
2019-03-31 04:29:37 +08:00
|
|
|
legacy-bundles: $(LEGACY_TARGETS)
|
2016-05-04 21:29:01 +08:00
|
|
|
test-bundles: $(TEST_TARGETS)
|
|
|
|
docs-bundles: $(DOCS_TARGETS)
|
2019-10-30 03:01:14 +08:00
|
|
|
static-libs-bundles: $(STATIC_LIBS_TARGETS)
|
2018-11-29 22:34:46 +08:00
|
|
|
jcov-bundles: $(JCOV_TARGETS)
|
2016-05-04 21:29:01 +08:00
|
|
|
|
2019-10-30 03:01:14 +08:00
|
|
|
.PHONY: all default product-bundles test-bundles docs-bundles \
|
|
|
|
static-libs-bundles jcov-bundles
|