make/ReleaseFile.gmk
author briangoetz
Tue, 04 Jun 2019 13:07:35 -0400
branchJDK-8193209-branch
changeset 57388 b1e6bc96af3d
parent 48327 d2a837cf9ff1
permissions -rw-r--r--
Initial commit of new RNG code from GLS
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     1
#
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47314
diff changeset
     2
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     4
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    10
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    15
# accompanied this code).
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    16
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    20
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    23
# questions.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    24
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    25
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    26
default: all
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    27
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    28
include $(SPEC)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    29
include MakeBase.gmk
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    30
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    31
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    32
# This makefile generates the "release" file into the exploded image. Jlink is
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    33
# then responsible for using this as the base for release files in each linked
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    34
# image.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    35
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    36
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    37
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    38
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    39
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    40
# Common way to emit a line into the release or info file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    41
define info-file-item # name value
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    42
  $(PRINTF) '%s="%s"\n' $1 $2 >> $@
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    43
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    44
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    45
# Param 1 - The file containing the MODULES list
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    46
define create-info-file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    47
  $(if $(JDK_ARCH_ABI_PROP_NAME), \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    48
    $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    49
  $(call info-file-item, "SOURCE", "$(strip $(SOURCE_REVISION))")
42516
238e72a732d8 8171316: Add IMPLEMENTOR property to the release file
sundar
parents: 42292
diff changeset
    50
  $(call info-file-item, "IMPLEMENTOR", "$(COMPANY_NAME)")
48327
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47314
diff changeset
    51
  $(if $(VENDOR_VERSION_STRING), \
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47314
diff changeset
    52
    $(call info-file-item, "IMPLEMENTOR_VERSION", "$(VENDOR_VERSION_STRING)"))
d2a837cf9ff1 8192833: JEP 322: Time-Based Release Versioning
mr
parents: 47314
diff changeset
    53
  $(call info-file-item, "JAVA_VERSION_DATE", "$(VERSION_DATE)")
44985
54f298f9766a 8178380: Module system implementation refresh (5/2017)
alanb
parents: 42516
diff changeset
    54
  $(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
54f298f9766a 8178380: Module system implementation refresh (5/2017)
alanb
parents: 42516
diff changeset
    55
  $(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    56
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    57
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    58
# Param 1 - The file containing the MODULES list
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    59
define prepare-info-file
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 44985
diff changeset
    60
  $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%,%,$@))
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    61
  $(call MakeDir, $(@D))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    62
  $(RM) $@
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    63
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    64
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    65
define info-file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    66
  $(call prepare-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    67
  $(call create-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    68
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    69
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    70
# Create a variable dependency file common for all release info files.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    71
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    72
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    73
SOURCE_REVISION = $(shell \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    74
    if [ -f $(SOURCE_REVISION_TRACKER) ] ; then \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    75
      $(CAT) $(SOURCE_REVISION_TRACKER) ; \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    76
    fi)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    77
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    78
# The SOURCE_REVISION_TRACKER file may not exist. Only depend on it if it does.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    79
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(wildcard $(SOURCE_REVISION_TRACKER))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    80
	$(info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    81
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    82
TARGETS += $(BASE_RELEASE_FILE)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    83
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    84
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    85
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47253
diff changeset
    86
$(eval $(call IncludeCustomExtension, ReleaseFile.gmk))
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    87
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    88
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    89
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    90
all: $(TARGETS)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    91
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    92
.PHONY: all default