make/common/ZipArchive.gmk
author ihse
Fri, 11 Oct 2019 09:43:18 +0200
changeset 58549 9d9317fad3fe
parent 57635 18134c3c0780
permissions -rw-r--r--
8065704: Set LC_ALL=C for all relevant commands in the build system Reviewed-by: naoto, erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
     2
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    26
ifndef _ZIP_ARCHIVE_GMK
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    27
_ZIP_ARCHIVE_GMK := 1
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 24080
diff changeset
    28
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    29
ifeq (,$(_MAKEBASE_GMK))
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    30
  $(error You must include MakeBase.gmk prior to including ZipArchive.gmk)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    31
endif
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    32
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    33
# Setup make rules for creating a zip archive.
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    34
#
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    35
# Parameter 1 is the name of the rule. This name is used as variable prefix,
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    36
# and the targets generated are listed in a variable by that name.
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    37
#
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    38
# Remaining parameters are named arguments. These include:
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    39
#   SRC
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    40
#   ZIP
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    41
#   INCLUDES
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    42
#   INCLUDE_FILES
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    43
#   EXCLUDES
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    44
#   EXCLUDE_FILES
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
    45
#   EXCLUDE_PATTERNS - Patterns with at most one % wildcard matching filenames
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
    46
#                      and not directories.
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
    47
#   EXCLUDE_PATTERNS_$dir - Exclude patterns just like above but specific to one
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
    48
#                           src dir
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    49
#   SUFFIXES
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    50
#   EXTRA_DEPS
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    51
#   FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    52
#                     finding files.
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
    53
#   ZIP_OPTIONS extra options to pass to zip
29312
f3f859137ce6 8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents: 27602
diff changeset
    54
SetupZipArchive = $(NamedParamsMacroTemplate)
f3f859137ce6 8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents: 27602
diff changeset
    55
define SetupZipArchiveBody
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    56
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    57
  # Create a version $1_SRC with a guaranteed trailing slash
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    58
  $1_SRC_SLASH := $$(addsuffix /, $$(patsubst %/, %, $$($1_SRC)))
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    59
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    60
  # To avoid running find over too large sets of files, which causes make to crash
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    61
  # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    62
  # of directories to run find in, if available.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    63
  ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),)
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    64
    $1_FIND_LIST := $$(wildcard $$(foreach s,$$($1_SRC_SLASH), \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    65
        $$(addprefix $$s,$$($1_INCLUDES) $$($1_INCLUDE_FILES))))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    66
  else
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
    67
    $1_FIND_LIST := $$($1_SRC_SLASH)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    68
  endif
18422
8443ba629f9d 8016605: New files dont apear in src.zip
erikj
parents: 16583
diff changeset
    69
54380
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    70
  # Find all files in the source tree.
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    71
  # If asked to, follow symlinks in this find since that is what zip does. To do
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    72
  # this, we need to call ShellFindFiles directly.
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    73
  ifeq ($$($1_FOLLOW_SYMLINKS), true)
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    74
    $1_ALL_SRCS := $$(call not-containing,_the.,$$(call ShellFindFiles,$$($1_FIND_LIST), , -L))
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    75
  else
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    76
    $1_ALL_SRCS := $$(call not-containing,_the.,$$(call FindFiles,$$($1_FIND_LIST)))
e297c7bb6469 8189861: Refactor CacheFind
erikj
parents: 53829
diff changeset
    77
  endif
20645
6170a286f879 8025869: make docs doesn't regenerate docs correctly after changing API doc comments in jaxp sources
erikj
parents: 20364
diff changeset
    78
6170a286f879 8025869: make docs doesn't regenerate docs correctly after changing API doc comments in jaxp sources
erikj
parents: 20364
diff changeset
    79
  # Filter on suffixes if set
6170a286f879 8025869: make docs doesn't regenerate docs correctly after changing API doc comments in jaxp sources
erikj
parents: 20364
diff changeset
    80
  ifneq ($$($1_SUFFIXES),)
6170a286f879 8025869: make docs doesn't regenerate docs correctly after changing API doc comments in jaxp sources
erikj
parents: 20364
diff changeset
    81
    $1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS))
6170a286f879 8025869: make docs doesn't regenerate docs correctly after changing API doc comments in jaxp sources
erikj
parents: 20364
diff changeset
    82
  endif
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    83
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    84
  ifneq ($$($1_INCLUDES),)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    85
    ifneq ($$($1_SUFFIXES),)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    86
      $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    87
          $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    88
    else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    89
      $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    90
    endif
41658
14de1ab85d25 8062810: Examine src.zip in JDK image and decide if source classes should be organized by module
erikj
parents: 29312
diff changeset
    91
  else
14de1ab85d25 8062810: Examine src.zip in JDK image and decide if source classes should be organized by module
erikj
parents: 29312
diff changeset
    92
    ifneq ($$($1_SUFFIXES),)
14de1ab85d25 8062810: Examine src.zip in JDK image and decide if source classes should be organized by module
erikj
parents: 29312
diff changeset
    93
      $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
14de1ab85d25 8062810: Examine src.zip in JDK image and decide if source classes should be organized by module
erikj
parents: 29312
diff changeset
    94
          $$(addprefix -i$(SPACE)$(DQUOTE),*$$s$(DQUOTE)))
14de1ab85d25 8062810: Examine src.zip in JDK image and decide if source classes should be organized by module
erikj
parents: 29312
diff changeset
    95
    endif
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    96
  endif
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    97
  ifneq ($$($1_INCLUDE_FILES),)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    98
    $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
    99
  endif
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   100
  ifneq ($$($1_EXCLUDES),)
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents: 26671
diff changeset
   101
    $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   102
    $1_SRC_EXCLUDES := $$(foreach s,$$($1_SRC_SLASH),$$(addprefix $$s,$$(addsuffix /%,$$($1_EXCLUDES))))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   103
    $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   104
  endif
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents: 26671
diff changeset
   105
  ifneq ($$($1_EXCLUDE_FILES),)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents: 26671
diff changeset
   106
    $1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES)
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents: 26671
diff changeset
   107
    $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS))
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   108
    $$(foreach s, $$($1_SRC_SLASH), \
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   109
      $$(eval $1_ZIP_EXCLUDES_$$s += \
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   110
          $$(addprefix -x$$(SPACE), $$(patsubst $$s%,%, $$($1_EXCLUDE_FILES))) \
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   111
      ) \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   112
    )
27560
adc258b13e2c 8049367: Modular Run-Time Images
chegar
parents: 26671
diff changeset
   113
  endif
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   114
  ifneq ($$($1_EXCLUDE_PATTERNS), )
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   115
    $1_ALL_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERNS), $$($1_ALL_SRCS))
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   116
    $1_ZIP_EXCLUDES += $$(addprefix -x$(SPACE), $$(subst %,\*,$$($1_EXCLUDE_PATTERNS)))
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   117
  endif
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   118
  # Rewrite src dir specific exclude patterns to zip excludes
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   119
  $$(foreach s, $$($1_SRC_SLASH), \
50590
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   120
    $$(if $$($1_EXCLUDE_PATTERNS_$$s), \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   121
      $$(eval $1_ZIP_EXCLUDES_$$s += \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   122
          $$(addprefix -x$$(SPACE), $$(subst %,\*,$$($1_EXCLUDE_PATTERNS_$$s))) \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   123
      ) \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   124
    ) \
5fa19bad622d 8204973: Add build support for filtering translations
erikj
parents: 47253
diff changeset
   125
  )
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   126
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   127
  # Use a slightly shorter name for logging, but with enough path to identify this zip.
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 42136
diff changeset
   128
  $1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_ZIP))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   129
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   130
  # Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   131
  # I.e. the zip -i and -x options should match the filtering done in the makefile.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   132
  # Explicitly excluded files can be given with absolute path. The patsubst solution
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   133
  # isn't perfect but the likelyhood of an absolute path to match something in a src
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   134
  # dir is very small.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   135
  # If zip has nothing to do, it returns 12 and would fail the build. Check for 12
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   136
  # and only fail if it's not.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   137
  $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
52065
dea8a62cdfc3 8211724: Change mkdir -p to MakeDir macro where possible
erikj
parents: 50590
diff changeset
   138
	$$(call LogWarn, Updating $$($1_NAME))
dea8a62cdfc3 8211724: Change mkdir -p to MakeDir macro where possible
erikj
parents: 50590
diff changeset
   139
	$$(call MakeTargetDir)
57635
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   140
        # Find duplicate file names in the SRC and generate excludes for all
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   141
        # instances that should not be included. Run this rather expensive
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   142
        # calculation as part of the recipe to avoid running it when nothing
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   143
        # needs to be rebuilt. The drawback is that we cannot exclude these
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   144
        # files from the make prerequisites list, but the number of files is
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   145
        # usually small so a very rare unnecessary rebuild is worth it.
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   146
        # (The inner most foreach here is used instead of eval to declare a
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   147
        # local variable.)
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   148
	$$(foreach root, $$($1_SRC_SLASH), \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   149
	  $$(foreach file, $$(filter $$(root)%, $$($1_ALL_SRCS)), \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   150
	    $$(foreach relfile, $$(patsubst $$(root)%, %, $$(file)), \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   151
	      $$(if $$($1_relfiles_$$(call DoubleDollar, $$(relfile))), \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   152
	        $$(eval $1_ZIP_EXCLUDES_$$(root) += -x $$(relfile)) \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   153
	      , \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   154
	        $$(eval $1_relfiles_$$(call DoubleDollar, $$(relfile)) := 1) \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   155
	      ) \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   156
	    ) \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   157
	  ) \
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   158
	)
18134c3c0780 8058539: Platform specific source files may not end up in src.zip
erikj
parents: 54380
diff changeset
   159
	$$(foreach s,$$($1_SRC_SLASH), $$(call ExecuteWithLog, \
53829
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   160
	    $$(SUPPORT_OUTPUTDIR)/zip/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   161
	    (cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   162
	        $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   163
	        $$($1_ZIP_EXCLUDES_$$s) \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   164
	        || test "$$$$?" = "12" \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   165
	    ))$$(NEWLINE) \
56dc0b27536c 8211016: make images does not update jdk/lib/src.zip with latest changes
erikj
parents: 52804
diff changeset
   166
	) true \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20273
diff changeset
   167
	$(TOUCH) $$@
22480
d1be923b168a 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 22469
diff changeset
   168
d1be923b168a 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 22469
diff changeset
   169
  # Add zip to target list
d1be923b168a 8026773: Failing compilation in Corba does not fail the build
erikj
parents: 22469
diff changeset
   170
  $1 += $$($1_ZIP)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   171
endef
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   172
27592
af7df0dd5ff7 8065911: Introduce EvalDebugWrapper for all Setup* macros
ihse
parents: 27591
diff changeset
   173
endif # _ZIP_ARCHIVE_GMK