make/RunTestsPrebuilt.gmk
author ihse
Tue, 05 Dec 2017 12:57:48 +0100
branchihse-testmakefiles-branch
changeset 55954 59d51a521c64
parent 55931 76a784951142
child 55967 e2c47e2db0a5
permissions -rw-r--r--
Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     1
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     2
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     4
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    10
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    15
# accompanied this code).
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    16
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    20
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    23
# questions.
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    24
#
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    25
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    26
################################################################################
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    27
# Initial bootstrapping, copied and stripped down from Makefile and Init.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    28
################################################################################
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    29
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    30
# In Cygwin, the MAKE variable gets prepended with the current directory if the
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    31
# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    32
ifneq ($(findstring :, $(MAKE)), )
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    33
  export MAKE := $(patsubst $(CURDIR)%, %, $(patsubst $(CURDIR)/%, %, $(MAKE)))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    34
endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    35
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    36
# Locate this Makefile
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    37
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    38
  makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    39
else
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    40
  makefile_path := $(lastword $(MAKEFILE_LIST))
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    41
endif
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    42
TOPDIR := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    43
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    44
################################################################################
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    45
# Functions
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    46
################################################################################
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    47
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    48
# Setup a required or optional variable, and/or check that it is properly
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    49
# given.
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    50
# Note: No spaces are allowed around the arguments.
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    51
#
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    52
# $1: The name of the argument
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    53
# $2: The default value, if any, or OPTIONAL (do not provide a default but
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    54
#     do not exit if it is missing)
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    55
# $3: If NO_CHECK, disable checking for target file/directory existence
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    56
define SetupVariable
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    57
  ifeq ($$($1), )
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    58
    ifeq ($2, )
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    59
      $$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt)
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    60
      $$(error Cannot continue.)
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    61
    else ifeq ($2, OPTIONAL)
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    62
      ifneq ($$(findstring $$(LOG), info debug trace), )
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    63
        $$(info Prebuilt variable $1 is not provided)
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    64
      endif
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    65
    else
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    66
      ifneq ($$(findstring $$(LOG), info debug trace), )
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    67
        $$(info Prebuilt variable $1=$2 (default value))
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    68
      endif
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    69
      $1:=$2
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    70
    endif
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    71
  else
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    72
      ifneq ($$(findstring $$(LOG), info debug trace), )
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    73
      $$(info Prebuilt variable $1=$$($1))
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    74
    endif
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    75
  endif
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    76
  # If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    77
  # and if wildcard is empty, then complain that the file is missing.
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    78
  ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
    79
    $$(info Error: Prebuilt variable $1 points to missing file/directory:)
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    80
    $$(info '$$($1)')
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    81
    $$(error Cannot continue.)
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    82
  endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    83
endef
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    84
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    85
# Create an ephemeral spec file
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    86
#
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    87
# $1: The output file name
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    88
# $2..$N: The lines to output to the file
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    89
define CreateNewSpec
55919
0ffb2cce1b19 Fix new exitcode code. Support more arguments in CreateNewSpec.
ihse
parents: 55914
diff changeset
    90
  $(if $(strip $(26)), \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    91
    $(error Internal makefile error: \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    92
      Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    93
  ) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    94
  $(shell rm -f $1) \
55919
0ffb2cce1b19 Fix new exitcode code. Support more arguments in CreateNewSpec.
ihse
parents: 55914
diff changeset
    95
  $(foreach i, 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25, \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    96
    $(if $(strip $($i)), \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    97
      $(call AppendFile, $(strip $($i)), $1) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    98
    ) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    99
  )
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   100
endef
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   101
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   102
################################################################################
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   103
# Check input and setup basic buildsystem support
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   104
################################################################################
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   105
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   106
# Verify that user has given correct additional input.
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   107
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   108
# These variables are absolutely necessary
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   109
$(eval $(call SetupVariable,OUTPUTDIR))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   110
$(eval $(call SetupVariable,BOOT_JDK))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   111
$(eval $(call SetupVariable,JT_HOME))
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   112
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   113
# These can have default values based on the ones above
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   114
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   115
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   116
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   117
# Provide default values for tools that we need
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   118
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   119
$(eval $(call SetupVariable,BASH,bash,NO_CHECK))
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   120
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   121
# Check optional variables
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   122
$(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   123
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   124
# Now that we have verified that we have the required variables available, we
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   125
# can include the prebuilt spec file ourselves, without an ephemeral spec
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   126
# wrapper. This is required so we can include MakeBase which is needed for
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   127
# CreateNewSpec.
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   128
HAS_SPEC :=
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   129
include $(TOPDIR)/make/InitSupport.gmk
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   130
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   131
$(eval $(call CheckDeprecatedEnvironment))
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   132
$(eval $(call CheckInvalidMakeFlags))
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   133
$(eval $(call ParseLogLevel))
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   134
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   135
SPEC := $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   136
include $(SPEC)
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   137
include $(TOPDIR)/make/common/MakeBase.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   138
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   139
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   140
# Determine what platform we're running on
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   141
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   142
UNAME := uname
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   143
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   144
# Get OS name from uname (Cygwin inexplicably adds _NT-x.x)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   145
UNAME_OS := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   146
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   147
ifeq ($(UNAME_OS), CYGWIN)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   148
  OPENJDK_TARGET_OS := windows
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   149
  OPENJDK_TARGET_OS_TYPE := windows
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   150
  OPENJDK_TARGET_OS_ENV := windows.cygwin
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   151
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   152
  OPENJDK_TARGET_OS_TYPE:=unix
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   153
  ifeq ($(UNAME_OS), Linux)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   154
    OPENJDK_TARGET_OS := linux
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   155
  else ifeq ($(UNAME_OS), Darwin)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   156
    OPENJDK_TARGET_OS := macosx
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   157
  else ifeq ($(UNAME_OS), SunOS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   158
    OPENJDK_TARGET_OS := solaris
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   159
  else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   160
    OPENJDK_TARGET_OS := $(UNAME_OS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   161
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   162
  OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   163
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   164
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   165
# Assume little endian unless otherwise specified
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   166
OPENJDK_TARGET_CPU_ENDIAN := little
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   167
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   168
ifeq ($(OPENJDK_TARGET_OS), solaris)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   169
  # On solaris, use uname -p
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   170
  UNAME_CPU := $(shell $(UNAME) -p)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   171
  # Assume 64-bit platform
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   172
  OPENJDK_TARGET_CPU_BITS := 64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   173
  ifeq ($(UNAME_CPU), i386)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   174
    OPENJDK_TARGET_CPU := x86_64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   175
  else ifeq ($(UNAME_CPU), sparc)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   176
    OPENJDK_TARGET_CPU := sparcv9
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   177
    OPENJDK_TARGET_CPU_ENDIAN := big
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   178
  else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   179
    OPENJDK_TARGET_CPU := $(UNAME_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   180
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   181
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   182
  # ... all other user uname -m
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   183
  UNAME_CPU := $(shell $(UNAME) -m)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   184
  ifeq ($(UNAME_CPU), i686)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   185
    OPENJDK_TARGET_CPU := x86
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   186
    OPENJDK_TARGET_CPU_BITS := 32
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   187
  else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   188
    # Assume all others are 64-bit. We use the same CPU name as uname for
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   189
    # at least x86_64 and aarch64.
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   190
    OPENJDK_TARGET_CPU := $(UNAME_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   191
    OPENJDK_TARGET_CPU_BITS := 64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   192
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   193
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   194
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   195
OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   196
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   197
  OPENJDK_TARGET_CPU_ARCH := x86
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   198
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   199
  OPENJDK_TARGET_CPU_ARCH := sparc
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   200
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   201
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   202
ifeq ($(OPENJDK_TARGET_OS), windows)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   203
  ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   204
    $$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   205
    $$(error Cannot continue.)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   206
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   207
  FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   208
  PATH_SEP:=;
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   209
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   210
  FIXPATH :=
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   211
  PATH_SEP:=:
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   212
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   213
55954
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   214
# Check number of cores
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   215
ifeq ($(OPENJDK_TARGET_OS), linux)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   216
    NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   217
else ifeq ($(OPENJDK_TARGET_OS), macosx)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   218
    NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   219
else ifeq ($(OPENJDK_TARGET_OS), solaris)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   220
    NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   221
else ifeq ($(OPENJDK_TARGET_OS), windows)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   222
    NUM_CORES := $(NUMBER_OF_PROCESSORS)
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   223
else
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   224
    NUM_CORES := 1
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   225
endif
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   226
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   227
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   228
# Generate the ephemeral spec file
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   229
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   230
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   231
# Now we can include additional custom support.
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   232
# This might define CUSTOM_NEW_SPEC_LINE
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   233
ifneq ($(CUSTOM_MAKE_DIR), )
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   234
  include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   235
endif
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   236
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   237
NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   238
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   239
$(call CreateNewSpec, $(NEW_SPEC), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   240
    # Generated file -- do not edit!, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   241
    SPEC := $(NEW_SPEC), \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   242
    TOPDIR := $(TOPDIR), \
55882
79c94bfb654e Use OUTPUTDIR instead of OUTPUT_ROOT.
ihse
parents: 55881
diff changeset
   243
    OUTPUTDIR := $(OUTPUTDIR), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   244
    BOOT_JDK := $(BOOT_JDK), \
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   245
    JT_HOME := $(JT_HOME), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   246
    JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   247
    TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   248
    MAKE := $(MAKE), \
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   249
    BASH := $(BASH), \
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   250
    JIB_JAR := $(JIB_JAR), \
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   251
    FIXPATH := $(FIXPATH), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   252
    PATH_SEP := $(PATH_SEP), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   253
    OPENJDK_TARGET_OS := $(OPENJDK_TARGET_OS), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   254
    OPENJDK_TARGET_OS_TYPE := $(OPENJDK_TARGET_OS_TYPE), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   255
    OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS_ENV), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   256
    OPENJDK_TARGET_CPU := $(OPENJDK_TARGET_CPU), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   257
    OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU_ARCH), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   258
    OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   259
    OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
55954
59d51a521c64 Fix last FIXMEs in fake spec. Fix OPENJDK_BUILD_OS bug.
ihse
parents: 55931
diff changeset
   260
    NUM_CORES := $(NUM_CORES), \
55886
ff90766e3c60 Cleanup leftover custom stuff, include custom at the end.
ihse
parents: 55884
diff changeset
   261
    include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   262
    $(CUSTOM_NEW_SPEC_LINE), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   263
)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   264
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   265
################################################################################
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   266
# The run-test-prebuilt target
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   267
################################################################################
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   268
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   269
SPEC := $(NEW_SPEC)
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   270
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   271
default: all
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   272
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   273
run-test-prebuilt:
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   274
	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
55931
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   275
	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
76a784951142 Use InitSupport.gmk. Better prebuilt variable info.
ihse
parents: 55919
diff changeset
   276
	    TEST="$(TEST)"
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   277
	@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   278
	  exit 1 ; \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   279
	fi
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   280
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   281
all: run-test-prebuilt
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   282
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   283
.PHONY: default all