make/RunTestsPrebuilt.gmk
author ihse
Wed, 29 Nov 2017 22:02:21 +0100
branchihse-testmakefiles-branch
changeset 55914 dda999e8814c
parent 55899 789766475fe4
child 55919 0ffb2cce1b19
permissions -rw-r--r--
Setup target os/cpu for prebuilt.
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, )
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    59
      $$(info Error: Variable $1 is missing, needed for run-tests-prebuilt)
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)
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    62
      ifneq ($$(findstring $$(LOG), debug trace), )
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    63
        $$(info Optional prebuilt variable $1 not provided)
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
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    66
      $$(info Variable $1 is missing, using default $2)
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    67
      $1:=$2
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    68
    endif
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    69
  else
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    70
    ifneq ($$(findstring $$(LOG), debug trace), )
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    71
      $$(info Prebuilt variable $1=$$($1))
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    72
    endif
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
    73
  endif
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    74
  # 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
    75
  # and if wildcard is empty, then complain that the file is missing.
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    76
  ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    77
    $$(info Error: Variable $1 points to missing file/directory:)
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    78
    $$(info '$$($1)')
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    79
    $$(error Cannot continue.)
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    80
  endif
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    81
endef
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
    82
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    83
# Create an ephemeral spec file
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    84
#
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    85
# $1: The output file name
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
    86
# $2..$N: The lines to output to the file
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    87
define CreateNewSpec
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
    88
  $(if $(strip $(16)), \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    89
    $(error Internal makefile error: \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    90
      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
    91
  ) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    92
  $(shell rm -f $1) \
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
    93
  $(foreach i, 2 3 4 5 6 7 8 9 10 11 12 13 14 15, \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    94
    $(if $(strip $($i)), \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    95
      $(call AppendFile, $(strip $($i)), $1) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    96
    ) \
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    97
  )
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
    98
endef
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
################################################################################
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   101
# Check input and setup basic buildsystem support
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   102
################################################################################
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   103
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   104
# Verify that user has given correct additional input.
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
# These variables are absolutely necessary
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   107
$(eval $(call SetupVariable,OUTPUTDIR))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   108
$(eval $(call SetupVariable,BOOT_JDK))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   109
$(eval $(call SetupVariable,JT_HOME))
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   110
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   111
# These can have default values based on the ones above
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   112
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   113
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   114
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   115
# Provide default values for tools that we need
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   116
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   117
$(eval $(call SetupVariable,BASH,bash,NO_CHECK))
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   118
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   119
# Check optional variables
55899
789766475fe4 * Properly check provided variables.
ihse
parents: 55889
diff changeset
   120
$(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   121
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   122
# 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
   123
# 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
   124
# 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
   125
# CreateNewSpec.
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   126
SPEC := $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   127
include $(SPEC)
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   128
include $(TOPDIR)/make/common/MakeBase.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   129
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   130
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   131
# Determine what platform we're running on
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   132
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   133
UNAME := uname
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   134
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   135
# Get OS name from uname (Cygwin inexplicably adds _NT-x.x)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   136
UNAME_OS := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   137
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   138
ifeq ($(UNAME_OS), CYGWIN)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   139
  OPENJDK_TARGET_OS := windows
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   140
  OPENJDK_TARGET_OS_TYPE := windows
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   141
  OPENJDK_TARGET_OS_ENV := windows.cygwin
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   142
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   143
  OPENJDK_TARGET_OS_TYPE:=unix
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   144
  ifeq ($(UNAME_OS), Linux)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   145
    OPENJDK_TARGET_OS := linux
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   146
  else ifeq ($(UNAME_OS), Darwin)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   147
    OPENJDK_TARGET_OS := macosx
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   148
  else ifeq ($(UNAME_OS), SunOS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   149
    OPENJDK_TARGET_OS := solaris
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   150
  else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   151
    OPENJDK_TARGET_OS := $(UNAME_OS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   152
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   153
  OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   154
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   155
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   156
# Assume little endian unless otherwise specified
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   157
OPENJDK_TARGET_CPU_ENDIAN := little
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   158
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   159
ifeq ($(OPENJDK_TARGET_OS), solaris)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   160
  # On solaris, use uname -p
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   161
  UNAME_CPU := $(shell $(UNAME) -p)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   162
  # Assume 64-bit platform
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   163
  OPENJDK_TARGET_CPU_BITS := 64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   164
  ifeq ($(UNAME_CPU), i386)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   165
    OPENJDK_TARGET_CPU := x86_64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   166
  else ifeq ($(UNAME_CPU), sparc)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   167
    OPENJDK_TARGET_CPU := sparcv9
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   168
    OPENJDK_TARGET_CPU_ENDIAN := big
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   169
  else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   170
    OPENJDK_TARGET_CPU := $(UNAME_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   171
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   172
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   173
  # ... all other user uname -m
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   174
  UNAME_CPU := $(shell $(UNAME) -m)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   175
  ifeq ($(UNAME_CPU), i686)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   176
    OPENJDK_TARGET_CPU := x86
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   177
    OPENJDK_TARGET_CPU_BITS := 32
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
    # 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
   180
    # at least x86_64 and aarch64.
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   181
    OPENJDK_TARGET_CPU := $(UNAME_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   182
    OPENJDK_TARGET_CPU_BITS := 64
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   183
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   184
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   185
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   186
OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   187
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   188
  OPENJDK_TARGET_CPU_ARCH := x86
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   189
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   190
  OPENJDK_TARGET_CPU_ARCH := sparc
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   191
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   192
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   193
ifeq ($(OPENJDK_TARGET_OS), windows)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   194
  ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   195
    $$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   196
    $$(error Cannot continue.)
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   197
  endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   198
  FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   199
  PATH_SEP:=;
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   200
else
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   201
  FIXPATH :=
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   202
  PATH_SEP:=:
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   203
endif
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   204
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   205
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   206
# Generate the ephemeral spec file
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   207
################################################################################
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   208
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   209
# Now we can include additional custom support.
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   210
# This might define CUSTOM_NEW_SPEC_LINE
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   211
ifneq ($(CUSTOM_MAKE_DIR), )
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   212
  include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   213
endif
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   214
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   215
NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   216
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   217
$(call CreateNewSpec, $(NEW_SPEC), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   218
    # Generated file -- do not edit!, \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   219
    SPEC := $(NEW_SPEC), \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   220
    TOPDIR := $(TOPDIR), \
55882
79c94bfb654e Use OUTPUTDIR instead of OUTPUT_ROOT.
ihse
parents: 55881
diff changeset
   221
    OUTPUTDIR := $(OUTPUTDIR), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   222
    BOOT_JDK := $(BOOT_JDK), \
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   223
    JT_HOME := $(JT_HOME), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   224
    JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   225
    TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
55888
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   226
    MAKE := $(MAKE), \
cd05c5ba480a Clean up some stuff in fake spec.
ihse
parents: 55886
diff changeset
   227
    BASH := $(BASH), \
55889
3934c59055ab Add support for optional JIB_JAR.
ihse
parents: 55888
diff changeset
   228
    JIB_JAR := $(JIB_JAR), \
55914
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   229
    FIXPATH := $(FIXPATH), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   230
    PATH_SEP := $(PATH_SEP), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   231
    OPENJDK_TARGET_OS := $(OPENJDK_TARGET_OS), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   232
    OPENJDK_TARGET_OS_TYPE := $(OPENJDK_TARGET_OS_TYPE), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   233
    OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS_ENV), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   234
    OPENJDK_TARGET_CPU := $(OPENJDK_TARGET_CPU), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   235
    OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU_ARCH), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   236
    OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \
dda999e8814c Setup target os/cpu for prebuilt.
ihse
parents: 55899
diff changeset
   237
    OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
55886
ff90766e3c60 Cleanup leftover custom stuff, include custom at the end.
ihse
parents: 55884
diff changeset
   238
    include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   239
    $(CUSTOM_NEW_SPEC_LINE), \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   240
)
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   241
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   242
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   243
################################################################################
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   244
# The run-test-prebuilt target
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   245
################################################################################
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   246
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   247
default: all
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   248
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   249
run-test-prebuilt:
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   250
	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   251
	@cd $(TOPDIR) && $(MAKE) -r -R -j 1 -s -I make/common/ \
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   252
	    SPEC=$(NEW_SPEC) \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   253
	    -f make/RunTests.gmk run-test TEST="$(TEST)"
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   254
	@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   255
	  exit 1 ; \
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   256
	fi
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   257
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   258
55884
9ee155c19c6a Getting run-test-prebuilt to work quite well.
ihse
parents: 55882
diff changeset
   259
all: run-test-prebuilt
55881
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   260
dbf68259f80e Populate with latest code from jdk9 sandbox.
ihse
parents:
diff changeset
   261
.PHONY: default all