make/Bundles.gmk
author coffeys
Wed, 13 Nov 2019 11:27:50 +0000
changeset 59055 57ad70bcf06c
parent 58846 f9ac726ab347
permissions -rw-r--r--
8233731: repeated typo "fro" for "for" Reviewed-by: dfuchs Contributed-by: kiran.sidhartha.ravikumar@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     1
#
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
     2
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     4
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    10
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    15
# accompanied this code).
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    16
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    20
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    23
# questions.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    24
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    25
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    26
default: all
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    27
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    28
include $(SPEC)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    29
include MakeBase.gmk
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    30
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    31
PRODUCT_TARGETS :=
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
    32
LEGACY_TARGETS :=
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    33
TEST_TARGETS :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    34
DOCS_TARGETS :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    35
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    36
# On Windows tar frequently complains that "file changed as we read it" for
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    37
# some random source files. This seems to be cause by anti virus scanners and
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    38
# is most likely safe to ignore. When it happens, tar returns '1'.
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52804
diff changeset
    39
ifeq ($(call isBuildOs, windows), true)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    40
  TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    41
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    42
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    43
# Hook to include the corresponding custom file, if present.
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47253
diff changeset
    44
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    45
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    46
# BUNDLE : Name of bundle to create
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    47
# FILES : Files in BASE_DIRS to add to bundle
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    48
# SPECIAL_INCLUDES : List of directories inside BASE_DIRS to look for additional
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    49
#     files in. These files will not get proper dependency handling. Use when
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    50
#     files or directories may contain spaces.
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    51
# BASE_DIRS : Base directories for the root dir in the bundle.
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    52
# SUBDIR : Optional name of root dir in bundle.
58720
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
    53
# OUTPUTDIR : Optionally override output dir
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    54
SetupBundleFile = $(NamedParamsMacroTemplate)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    55
define SetupBundleFileBody
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    56
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    57
  $$(foreach d, $$($1_BASE_DIRS), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    58
    $$(eval $1_$$d_RELATIVE_FILES := $$$$(patsubst $$d/%, %, \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    59
        $$$$(filter $$d/%, $$$$($1_FILES)))) \
42507
a3499e58c108 8171167: Build fails in Mach 5 with "File name too long."
erikj
parents: 42506
diff changeset
    60
    $$(eval $1_$$d_LIST_FILE := \
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47217
diff changeset
    61
        $(SUPPORT_OUTPUTDIR)/bundles/_$1_$$$$(subst /,_,$$$$(patsubst $(OUTPUTDIR)/%,%,$$d)_files)) \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    62
  )
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    63
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    64
  ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    65
    $1_TYPE := tar.gz
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    66
  else ifneq ($$(filter %.zip, $$($1_BUNDLE_NAME)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    67
    $1_TYPE := zip
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    68
  else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    69
    $$(error Unknown bundle type $$($1_BUNDLE_NAME))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    70
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    71
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    72
  $$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    73
58720
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
    74
  $$(call SetIfEmpty, $1_OUTPUTDIR, $$(BUNDLES_OUTPUTDIR))
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
    75
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
    76
  $$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
52065
dea8a62cdfc3 8211724: Change mkdir -p to MakeDir macro where possible
erikj
parents: 50490
diff changeset
    77
	$$(call MakeTargetDir)
58720
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
    78
	$$(call LogWarn, Creating $$($1_BUNDLE_NAME))
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
    79
        # If any of the files contain a space in the file name, FindFiles
47334
09d386ddaa42 8189095: Import JMC from artifactory using Jib and main makefiles
erikj
parents: 47314
diff changeset
    80
        # will have replaced it with ?. Tar does not accept that so need to
09d386ddaa42 8189095: Import JMC from artifactory using Jib and main makefiles
erikj
parents: 47314
diff changeset
    81
        # switch it back.
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    82
	$$(foreach d, $$($1_BASE_DIRS), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    83
	  $$(eval $$(call ListPathsSafely, \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    84
	      $1_$$d_RELATIVE_FILES, $$($1_$$d_LIST_FILE))) \
47334
09d386ddaa42 8189095: Import JMC from artifactory using Jib and main makefiles
erikj
parents: 47314
diff changeset
    85
	  $$(CAT) $$($1_$$d_LIST_FILE) | $$(TR) '?' ' ' > $$($1_$$d_LIST_FILE).tmp \
09d386ddaa42 8189095: Import JMC from artifactory using Jib and main makefiles
erikj
parents: 47314
diff changeset
    86
	      && $(MV) $$($1_$$d_LIST_FILE).tmp $$($1_$$d_LIST_FILE) $$(NEWLINE) \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    87
	)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    88
        ifneq ($$($1_SPECIAL_INCLUDES), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    89
	  $$(foreach i, $$($1_SPECIAL_INCLUDES), \
43051
6b8a8764b1fe 8172577: Builds for OS X after build 149 does not include Java Mission Control.app
erikj
parents: 43043
diff changeset
    90
	    $$(foreach d, $$($1_BASE_DIRS), \
6b8a8764b1fe 8172577: Builds for OS X after build 149 does not include Java Mission Control.app
erikj
parents: 43043
diff changeset
    91
	      ($(CD) $$d && $(FIND) $$i >> $$($1_$$d_LIST_FILE)) ; ))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    92
        endif
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    93
        ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO), .-zip-false)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    94
          # If no subdir is specified, zip can be done directly from BASE_DIRS.
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    95
	  $$(foreach d, $$($1_BASE_DIRS), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    96
	    ( $(CD) $$d \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    97
	    && $(ZIPEXE) -qru $$@ . -i@$$($1_$$d_LIST_FILE) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    98
	    || test "$$$$?" = "12" )$$(NEWLINE))
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
    99
        else ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   100
            .-tar.gz-false-1)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   101
          # If no subdir is specified and only one BASE_DIR, tar.gz can be done
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   102
          # directly from BASE_DIR.
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   103
	  $(CD) $$($1_BASE_DIRS) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   104
	      && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   105
	          -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   106
	          $(TAR_IGNORE_EXIT_VALUE) ) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   107
	      | $(GZIP) > $$@
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   108
        else ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   109
            tar.gz-true-false-1)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   110
          # If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   111
          # transform option to create bundle directly from the BASE_DIR.
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   112
	  $(CD) $$($1_BASE_DIRS) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   113
	      && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   114
	          -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
42849
fa0a0a987432 8171548: JDK bundles changes sym links incorrectly in the legal directory
erikj
parents: 42507
diff changeset
   115
	          $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   116
	          $(TAR_IGNORE_EXIT_VALUE) ) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   117
	      | $(GZIP) > $$@
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   118
        else
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   119
          # In all other cases, need to copy all files into a temporary location
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   120
          # before creation bundle.
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   121
	  $(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   122
	  $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   123
	  $$(foreach d, $$($1_BASE_DIRS), \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   124
	    ( $(CD) $$d \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   125
	    && $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   126
	        $(TAR_IGNORE_EXIT_VALUE) ) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   127
	    | ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   128
          # Unzip any zipped debuginfo files
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   129
          ifeq ($$($1_UNZIP_DEBUGINFO), true)
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   130
	    for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   131
	      $(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   132
	    done
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   133
          endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   134
          ifeq ($$($1_TYPE), tar.gz)
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   135
	    $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   136
	    ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   137
	        $$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   138
	    | $(GZIP) > $$@
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   139
          else ifeq ($$($1_TYPE), zip)
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   140
	    $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIPEXE) -qr $$@ .
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   141
          endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   142
        endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   143
58720
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
   144
  $1 += $$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   145
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   146
endef
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   147
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   148
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   149
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   150
# On Macosx, we bundle up the macosx specific images which already have the
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   151
# correct base directories.
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52804
diff changeset
   152
ifeq ($(call isTargetOs, macosx)+$(DEBUG_LEVEL), true+release)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   153
  JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   154
  JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   155
  JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   156
  JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   157
  JDK_BUNDLE_SUBDIR :=
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   158
  JRE_BUNDLE_SUBDIR :=
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   159
else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   160
  JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   161
  JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   162
  JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   163
  JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   164
  ifneq ($(DEBUG_LEVEL), release)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   165
    JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   166
    JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   167
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   168
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   169
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   170
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   171
58720
ae0af9fb3dbb 8232572: Add hooks for custom output dir in Bundles.gmk
erikj
parents: 54380
diff changeset
   172
ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   173
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   174
  SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   175
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   176
  # There may be files with spaces in the names, so use ShellFindFiles
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   177
  # explicitly.
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   178
  ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   179
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   180
  # Create special filter rules when dealing with unzipped .dSYM directories on
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   181
  # macosx
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 52804
diff changeset
   182
  ifeq ($(call isTargetOs, macosx), true)
47933
19122c10fc52 8191205: Set native-debug-symbols default to "external"
ihse
parents: 47440
diff changeset
   183
    ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   184
      JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   185
          $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, $(ALL_JDK_FILES))))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   186
    endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   187
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   188
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   189
  JDK_BUNDLE_FILES := \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   190
      $(filter-out \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   191
          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   192
          $(JDK_EXTRA_EXCLUDES) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   193
          $(SYMBOLS_EXCLUDE_PATTERN) \
45097
607a19971bd9 8180129: Bundles.gmk:181: *** unterminated call to function 'filter-out': missing ')'. Stop.
tbell
parents: 45096
diff changeset
   194
          $(JDK_IMAGE_HOMEDIR)/demo/% \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   195
          , \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   196
          $(ALL_JDK_FILES) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   197
      )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   198
  JDK_SYMBOLS_BUNDLE_FILES := \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   199
      $(filter \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   200
          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   201
          $(SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   202
          , \
39925
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   203
          $(filter-out \
44724
8efb5c82a573 8173801: Modify makefiles to not build demos and samples bundles.
shurailine
parents: 43051
diff changeset
   204
              $(JDK_IMAGE_HOMEDIR)/demo/% \
39925
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   205
              , \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   206
              $(ALL_JDK_FILES) \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   207
          ) \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   208
      ) \
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   209
      $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   210
47440
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   211
  TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   212
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   213
  ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   214
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   215
  # Create special filter rules when dealing with unzipped .dSYM directories on
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   216
  # macosx
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   217
  ifeq ($(OPENJDK_TARGET_OS), macosx)
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   218
    ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   219
      JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   220
          $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   221
    endif
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   222
  endif
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   223
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   224
  JRE_BUNDLE_FILES := $(filter-out \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   225
      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   226
      $(SYMBOLS_EXCLUDE_PATTERN), \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   227
      $(ALL_JRE_FILES))
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   228
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   229
  $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   230
      BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   231
      FILES := $(JDK_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   232
      SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   233
      BASE_DIRS := $(JDK_IMAGE_DIR), \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   234
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   235
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   236
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   237
  PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   238
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   239
  $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   240
      BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   241
      FILES := $(JRE_BUNDLE_FILES), \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   242
      BASE_DIRS := $(JRE_IMAGE_DIR), \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   243
      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   244
  ))
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   245
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   246
  LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   247
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   248
  $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   249
      BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   250
      FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   251
      BASE_DIRS := $(JDK_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   252
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   253
      UNZIP_DEBUGINFO := true, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   254
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   255
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   256
  PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   257
47440
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   258
  # The demo bundle is only created to support client tests. Ideally it should
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   259
  # be built with the main test bundle, but since the prerequisites match
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   260
  # better with the product build, it makes more sense to keep it there for now.
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   261
  $(eval $(call SetupBundleFile, BUILD_TEST_DEMOS_BUNDLE, \
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   262
      BUNDLE_NAME := $(TEST_DEMOS_BUNDLE_NAME), \
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   263
      FILES := $(TEST_DEMOS_BUNDLE_FILES), \
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   264
      BASE_DIRS := $(JDK_IMAGE_DIR), \
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   265
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   266
  ))
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   267
963f70aa578d 8189682: JDK demos/tests should be in a separate bundle than hotspot ones
erikj
parents: 47334
diff changeset
   268
  PRODUCT_TARGETS += $(BUILD_TEST_DEMOS_BUNDLE)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   269
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   270
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   271
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   272
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   273
ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   274
  TEST_BUNDLE_FILES := $(call FindFiles, $(TEST_IMAGE_DIR))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   275
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   276
  $(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   277
      BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
41875
854ef5325653 8160491: tar.gz bundles missing files containing $
erikj
parents: 39925
diff changeset
   278
      FILES := $(TEST_BUNDLE_FILES), \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   279
      BASE_DIRS := $(TEST_IMAGE_DIR), \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   280
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   281
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   282
  TEST_TARGETS += $(BUILD_TEST_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   283
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   284
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   285
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   286
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   287
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   288
  DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   289
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   290
  $(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   291
      BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   292
      FILES := $(DOCS_BUNDLE_FILES), \
42506
54b0b4fffab5 8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents: 42136
diff changeset
   293
      BASE_DIRS := $(DOCS_IMAGE_DIR), \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   294
      SUBDIR := docs, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   295
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   296
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   297
  DOCS_TARGETS += $(BUILD_DOCS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   298
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   299
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   300
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   301
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   302
ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 54348
diff changeset
   303
  JCOV_BUNDLE_FILES := $(call FindFiles, $(JCOV_IMAGE_DIR))
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   304
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   305
  $(eval $(call SetupBundleFile, BUILD_JCOV_BUNDLE, \
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   306
      BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   307
      FILES := $(JCOV_BUNDLE_FILES), \
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   308
      BASE_DIRS := $(JCOV_IMAGE_DIR), \
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   309
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   310
  ))
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   311
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   312
  JCOV_TARGETS += $(BUILD_JCOV_BUNDLE)
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   313
endif
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   314
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   315
################################################################################
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   316
58846
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   317
ifneq ($(filter static-libs-bundles, $(MAKECMDGOALS)), )
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   318
  STATIC_LIBS_BUNDLE_FILES := $(call FindFiles, $(STATIC_LIBS_IMAGE_DIR))
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   319
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   320
  ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   321
    STATIC_LIBS_BUNDLE_SUBDIR := $(JDK_MACOSX_CONTENTS_SUBDIR)/Home
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   322
  else
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   323
    STATIC_LIBS_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   324
  endif
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   325
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   326
  $(eval $(call SetupBundleFile, BUILD_STATIC_LIBS_BUNDLE, \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   327
      BUNDLE_NAME := $(STATIC_LIBS_BUNDLE_NAME), \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   328
      FILES := $(STATIC_LIBS_BUNDLE_FILES), \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   329
      BASE_DIRS := $(STATIC_LIBS_IMAGE_DIR), \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   330
      SUBDIR := $(STATIC_LIBS_BUNDLE_SUBDIR), \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   331
  ))
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   332
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   333
  STATIC_LIBS_TARGETS += $(BUILD_STATIC_LIBS_BUNDLE)
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   334
endif
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   335
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   336
################################################################################
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   337
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   338
# Hook to include the corresponding custom file, if present.
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47253
diff changeset
   339
$(eval $(call IncludeCustomExtension, Bundles.gmk))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   340
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   341
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   342
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   343
product-bundles: $(PRODUCT_TARGETS)
54348
f062188117ad 8221610: Resurrect (legacy) JRE bundle target
clanger
parents: 53683
diff changeset
   344
legacy-bundles: $(LEGACY_TARGETS)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   345
test-bundles: $(TEST_TARGETS)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   346
docs-bundles: $(DOCS_TARGETS)
58846
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   347
static-libs-bundles: $(STATIC_LIBS_TARGETS)
52774
56ca125c973b 8214309: Enhance makefiles to allow generating JCov instrumented build
shurailine
parents: 52065
diff changeset
   348
jcov-bundles: $(JCOV_TARGETS)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   349
58846
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   350
.PHONY: all default product-bundles test-bundles docs-bundles \
f9ac726ab347 8232748: Build static versions of certain JDK libraries
erikj
parents: 58720
diff changeset
   351
    static-libs-bundles jcov-bundles