make/ReleaseFile.gmk
author ihse
Mon, 27 Nov 2017 12:29:28 +0100
branchihse-testmakefiles-branch
changeset 55882 79c94bfb654e
parent 47314 743814386712
child 48327 d2a837cf9ff1
permissions -rw-r--r--
Use OUTPUTDIR instead of OUTPUT_ROOT.
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)")
44985
54f298f9766a 8178380: Module system implementation refresh (5/2017)
alanb
parents: 42516
diff changeset
    51
  $(call info-file-item, "OS_NAME", "$(RELEASE_FILE_OS_NAME)")
54f298f9766a 8178380: Module system implementation refresh (5/2017)
alanb
parents: 42516
diff changeset
    52
  $(call info-file-item, "OS_ARCH", "$(RELEASE_FILE_OS_ARCH)")
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    53
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    54
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    55
# Param 1 - The file containing the MODULES list
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    56
define prepare-info-file
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 44985
diff changeset
    57
  $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%,%,$@))
42292
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    58
  $(call MakeDir, $(@D))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    59
  $(RM) $@
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    60
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    61
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    62
define info-file
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    63
  $(call prepare-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    64
  $(call create-info-file)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    65
endef
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    66
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    67
# Create a variable dependency file common for all release info files.
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    68
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
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
SOURCE_REVISION = $(shell \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    71
    if [ -f $(SOURCE_REVISION_TRACKER) ] ; then \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    72
      $(CAT) $(SOURCE_REVISION_TRACKER) ; \
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    73
    fi)
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    74
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    75
# 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
    76
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(wildcard $(SOURCE_REVISION_TRACKER))
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    77
	$(info-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
TARGETS += $(BASE_RELEASE_FILE)
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
################################################################################
11f0a32a38f0 8170528: Race condition with release file creation
erikj
parents:
diff changeset
    82
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47253
diff changeset
    83
$(eval $(call IncludeCustomExtension, ReleaseFile.gmk))
42292
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
################################################################################
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
all: $(TARGETS)
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
.PHONY: all default