make/ReleaseFile.gmk
author jwilhelm
Tue, 25 Apr 2017 18:56:45 +0000
changeset 46412 92fd9825e468
parent 42516 238e72a732d8
child 44985 54f298f9766a
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     1
#
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
     2
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
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)")
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    51
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    52
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    53
# Param 1 - The file containing the MODULES list
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    54
define prepare-info-file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    55
  $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    56
  $(call MakeDir, $(@D))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    57
  $(RM) $@
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    58
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    59
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    60
define info-file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    61
  $(call prepare-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    62
  $(call create-info-file)
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
# Create a variable dependency file common for all release info files.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    66
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    67
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    68
SOURCE_REVISION = $(shell \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    69
    if [ -f $(SOURCE_REVISION_TRACKER) ] ; then \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    70
      $(CAT) $(SOURCE_REVISION_TRACKER) ; \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    71
    fi)
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
# 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
    74
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(wildcard $(SOURCE_REVISION_TRACKER))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    75
	$(info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    76
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    77
TARGETS += $(BASE_RELEASE_FILE)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    78
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    79
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    80
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    81
$(eval $(call IncludeCustomExtension, , ReleaseFile.gmk))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    82
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
all: $(TARGETS)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    86
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    87
.PHONY: all default