make/Bundles.gmk
author coleenp
Tue, 23 Aug 2016 19:20:13 +0000
changeset 40663 e62e7d68f3d2
parent 39925 719d2be9b4de
child 41875 854ef5325653
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     1
#
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
     2
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
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 :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    32
TEST_TARGETS :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    33
DOCS_TARGETS :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    34
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    35
# On Windows tar frequently complains that "file changed as we read it" for
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    36
# some random source files. This seems to be cause by anti virus scanners and
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    37
# is most likely safe to ignore. When it happens, tar returns '1'.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    38
ifeq ($(OPENJDK_BUILD_OS), windows)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    39
  TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    40
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    41
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    42
# Hook to include the corresponding custom file, if present.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    43
$(eval $(call IncludeCustomExtension, , Bundles-pre.gmk))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    44
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    45
# BUNDLE : Name of bundle to create
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    46
# FILES : Files in BASE_DIR to add to bundle
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    47
# SPECIAL_INCLUDES : List of directories inside BASE_DIR to look for additional
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    48
#     files in. These files will not get proper dependency handling. Use when
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    49
#     files or directories may contain spaces.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    50
# BASE_DIR : Base directory for the root dir in the bundle.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    51
# SUBDIR : Optional name of root dir in bundle.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    52
SetupBundleFile = $(NamedParamsMacroTemplate)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    53
define SetupBundleFileBody
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    54
39111
d3f0656636f8 8159628: Bundles contain extra /./ path element for all files
erikj
parents: 38924
diff changeset
    55
  $1_RELATIVE_FILES := $$(patsubst $$($1_BASE_DIR)/%, %, $$($1_FILES))
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    56
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    57
  ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    58
    $1_TYPE := tar.gz
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    59
  else ifneq ($$(filter %.zip, $$($1_BUNDLE_NAME)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    60
    $1_TYPE := zip
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    61
  else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    62
    $$(error Unknown bundle type $$($1_BUNDLE_NAME))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    63
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    64
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    65
  $$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    66
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    67
  $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    68
	$$(eval $$(call ListPathsSafely, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    69
	    $1_RELATIVE_FILES, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    70
	    $(SUPPORT_OUTPUTDIR)/bundles/_$1_files))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    71
	$$(call MakeDir, $$(@D))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    72
        ifneq ($$($1_SPECIAL_INCLUDES), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    73
	  $$(foreach i, $$($1_SPECIAL_INCLUDES), \
39111
d3f0656636f8 8159628: Bundles contain extra /./ path element for all files
erikj
parents: 38924
diff changeset
    74
	      ($(CD) $$($1_BASE_DIR) && $(FIND) $$i \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    75
	          >> $(SUPPORT_OUTPUTDIR)/bundles/_$1_files ) ; )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    76
        endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    77
        ifneq ($$($1_SUBDIR), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    78
          ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO), tar.gz-true-false)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    79
	    $(CD) $$($1_BASE_DIR) \
38924
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
    80
	        && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
    81
                    -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    82
	            --transform 's|^|$$($1_SUBDIR)/|' $(TAR_IGNORE_EXIT_VALUE) ) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    83
	        | $(GZIP) > $$@
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    84
          else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    85
            # If a subdir has been specified, copy all files into a temporary
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    86
            # location with this subdir before creating the tar file
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    87
	    $(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    88
	    $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    89
	    ( $(CD) $$($1_BASE_DIR) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    90
	        && $(TAR) cf - -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    91
	            $(TAR_IGNORE_EXIT_VALUE) ) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    92
	        | ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    93
            # Unzip any zipped debuginfo files
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    94
            ifeq ($$($1_UNZIP_DEBUGINFO), true)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    95
	      for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    96
	        $(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    97
	      done
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    98
            endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
    99
            ifeq ($$($1_TYPE), tar.gz)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   100
	      $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
38924
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
   101
	          ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) $$($1_SUBDIR) $(TAR_IGNORE_EXIT_VALUE) ) \
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
   102
	          | $(GZIP) > $$@
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   103
            else ifeq ($$($1_TYPE), zip)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   104
	      $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIP) -qr $$@ .
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   105
            endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   106
          endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   107
        else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   108
          ifeq ($$($1_TYPE), tar.gz)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   109
	    $(CD) $$($1_BASE_DIR) \
38924
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
   110
	        && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
55921b080a8e 8157479: jdk-9_solaris-x64_bin-debug.tar.gz error - typeflag 'L' not recognized
erikj
parents: 37982
diff changeset
   111
	            -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   112
	            $(TAR_IGNORE_EXIT_VALUE) ) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   113
	        | $(GZIP) > $$@
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   114
          else ifeq ($$($1_TYPE), zip)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   115
	    $(CD) $$($1_BASE_DIR) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   116
	        && $(ZIP) -qr $$@ . -i@$(SUPPORT_OUTPUTDIR)/bundles/_$1_files
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   117
          endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   118
        endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   119
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   120
  $1 += $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   121
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   122
endef
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   123
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   124
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   125
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   126
# On Macosx, we bundle up the macosx specific images which already have the
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   127
# correct base directories.
37982
cd251f56161f 8157574: Mac fastdebug bundles have wrong directory layout
erikj
parents: 37972
diff changeset
   128
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   129
  JDK_IMAGE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   130
  JRE_IMAGE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   131
  JDK_IMAGE_HOMEDIR := $(JDK_MACOSX_CONTENTS_DIR)/Home
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   132
  JRE_IMAGE_HOMEDIR := $(JRE_MACOSX_CONTENTS_DIR)/Home
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   133
  JDK_BUNDLE_SUBDIR :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   134
  JRE_BUNDLE_SUBDIR :=
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   135
else
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   136
  JDK_IMAGE_HOMEDIR := $(JDK_IMAGE_DIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   137
  JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   138
  JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   139
  JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   140
  ifneq ($(DEBUG_LEVEL), release)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   141
    JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   142
    JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   143
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   144
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   145
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   146
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   147
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   148
ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   149
  $(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   150
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   151
  SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   152
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   153
  ALL_JDK_FILES := $(call CacheFind, $(JDK_IMAGE_DIR))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   154
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   155
  # Create special filter rules when dealing with unzipped .dSYM directories on
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   156
  # macosx
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   157
  ifeq ($(OPENJDK_TARGET_OS), macosx)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   158
    ifeq ($(ZIP_DEBUGINFO_FILES), false)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   159
      JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   160
          $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, $(ALL_JDK_FILES))))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   161
    endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   162
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   163
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   164
  JDK_BUNDLE_FILES := \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   165
      $(filter-out \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   166
          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   167
          $(JDK_EXTRA_EXCLUDES) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   168
          $(SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   169
          $(JDK_IMAGE_HOMEDIR)/demo/% $(JDK_IMAGE_HOMEDIR)/sample/% \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   170
          , \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   171
          $(ALL_JDK_FILES) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   172
      )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   173
  DEMOS_BUNDLE_FILES := \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   174
      $(filter-out \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   175
          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   176
          $(SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   177
          , \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   178
          $(filter \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   179
               $(JDK_IMAGE_HOMEDIR)/demo/% $(JDK_IMAGE_HOMEDIR)/sample/% \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   180
               $(JDK_IMAGE_HOMEDIR)/release \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   181
               , \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   182
               $(ALL_JDK_FILES) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   183
          ) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   184
      )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   185
  JDK_SYMBOLS_BUNDLE_FILES := \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   186
      $(filter \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   187
          $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   188
          $(SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   189
          , \
39925
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   190
          $(filter-out \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   191
              $(JDK_IMAGE_HOMEDIR)/demo/% $(JDK_IMAGE_HOMEDIR)/sample/% \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   192
              , \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   193
              $(ALL_JDK_FILES) \
719d2be9b4de 8148548: [Linux/Solaris] debuginfo and fastdebuginfo bundle contains demo info
erikj
parents: 39111
diff changeset
   194
          ) \
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   195
      ) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   196
      $(call CacheFind, $(SYMBOLS_IMAGE_DIR))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   197
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   198
  ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   199
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   200
  # Create special filter rules when dealing with unzipped .dSYM directories on
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   201
  # macosx
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   202
  ifeq ($(OPENJDK_TARGET_OS), macosx)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   203
    ifeq ($(ZIP_DEBUGINFO_FILES), false)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   204
      JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   205
          $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   206
    endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   207
  endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   208
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   209
  JRE_BUNDLE_FILES := $(filter-out \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   210
      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   211
      $(SYMBOLS_EXCLUDE_PATTERN), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   212
      $(ALL_JRE_FILES))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   213
  JRE_SYMBOLS_BUNDLE_FILES := $(filter \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   214
      $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   215
      $(SYMBOLS_EXCLUDE_PATTERN), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   216
      $(ALL_JRE_FILES))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   217
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   218
  $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   219
      BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   220
      FILES := $(JDK_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   221
      SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   222
      BASE_DIR := $(JDK_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   223
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   224
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   225
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   226
  PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   227
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   228
  $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   229
      BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   230
      FILES := $(JRE_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   231
      BASE_DIR := $(JRE_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   232
      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   233
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   234
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   235
  PRODUCT_TARGETS += $(BUILD_JRE_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   236
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   237
  $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   238
      BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   239
      FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   240
      BASE_DIR := $(JDK_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   241
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   242
      UNZIP_DEBUGINFO := true, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   243
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   244
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   245
  PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   246
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   247
  $(eval $(call SetupBundleFile, BUILD_JRE_SYMBOLS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   248
      BUNDLE_NAME := $(JRE_SYMBOLS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   249
      FILES := $(JRE_SYMBOLS_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   250
      BASE_DIR := $(JRE_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   251
      SUBDIR := $(JRE_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   252
      UNZIP_DEBUGINFO := true, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   253
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   254
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   255
  PRODUCT_TARGETS += $(BUILD_JRE_SYMBOLS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   256
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   257
  $(eval $(call SetupBundleFile, BUILD_DEMOS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   258
      BUNDLE_NAME := $(DEMOS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   259
      FILES := $(call DoubleDollar, $(DEMOS_BUNDLE_FILES)), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   260
      BASE_DIR := $(JDK_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   261
      SUBDIR := $(JDK_BUNDLE_SUBDIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   262
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   263
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   264
  PRODUCT_TARGETS += $(BUILD_DEMOS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   265
endif
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   266
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   267
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   268
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   269
ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   270
  TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   271
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   272
  $(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   273
      BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   274
      FILES := $(call DoubleDollar, $(TEST_BUNDLE_FILES)), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   275
      BASE_DIR := $(TEST_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   276
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   277
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   278
  TEST_TARGETS += $(BUILD_TEST_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   279
endif
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
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   283
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   284
  DOCS_BUNDLE_FILES := $(call CacheFind, $(DOCS_IMAGE_DIR))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   285
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   286
  $(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   287
      BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   288
      FILES := $(DOCS_BUNDLE_FILES), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   289
      BASE_DIR := $(DOCS_IMAGE_DIR), \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   290
      SUBDIR := docs, \
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   291
  ))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   292
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   293
  DOCS_TARGETS += $(BUILD_DOCS_BUNDLE)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   294
endif
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
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   298
# Hook to include the corresponding custom file, if present.
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   299
$(eval $(call IncludeCustomExtension, , Bundles.gmk))
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   300
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   301
################################################################################
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   302
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   303
product-bundles: $(PRODUCT_TARGETS)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   304
test-bundles: $(TEST_TARGETS)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   305
docs-bundles: $(DOCS_TARGETS)
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   306
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents:
diff changeset
   307
.PHONY: all default product-bundles test-bundles docs-bundles