make/RunTestsPrebuiltSpec.gmk
author ihse
Mon, 27 Nov 2017 14:39:58 +0100
branchihse-testmakefiles-branch
changeset 55889 3934c59055ab
parent 55888 cd05c5ba480a
child 55914 dda999e8814c
permissions -rw-r--r--
Add support for optional JIB_JAR.

#
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# Fake minimalistic spec file for RunTestsPrebuilt.gmk.

define VerifyVariable
  ifeq ($$($1), )
    $$(info Error: Variable $1 is missing, needed for run-tests-prebuilt)
    $$(error Cannot continue.)
  else
    ifneq ($$(findstring $$(LOG_LEVEL), debug trace), )
      $$(info Prebuilt variable $1=$$($1))
    endif
  endif
endef

# It is the responsibility of the file including us to have set these up.
# Verify that this is correct.
$(eval $(call VerifyVariable,SPEC))
$(eval $(call VerifyVariable,TOPDIR))
$(eval $(call VerifyVariable,OUTPUTDIR))
$(eval $(call VerifyVariable,BOOT_JDK))
$(eval $(call VerifyVariable,JT_HOME))
$(eval $(call VerifyVariable,JDK_IMAGE_DIR))
$(eval $(call VerifyVariable,TEST_IMAGE_DIR))
$(eval $(call VerifyVariable,MAKE))
$(eval $(call VerifyVariable,BASH))

# FIXMEs

FIXPATH :=
CYGPATH := cygpath


###FIXME
# colon or semicolon
PATH_SEP:=:


LOG_LEVEL=info
#LOG_LEVEL=$(LOG_LEVEL)
#MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS)

# The built jdk will run in this target system.

OPENJDK_TARGET_OS:=linux
OPENJDK_TARGET_OS_TYPE:=unix
OPENJDK_TARGET_OS_ENV:=linux

OPENJDK_TARGET_CPU:=x86_64
OPENJDK_TARGET_CPU_ARCH:=x86
OPENJDK_TARGET_CPU_BITS:=64
OPENJDK_TARGET_CPU_ENDIAN:=little

#DEBUG_LEVEL:=@DEBUG_LEVEL@
#HOTSPOT_DEBUG_LEVEL:=@HOTSPOT_DEBUG_LEVEL@

#BUILD_GTEST := @BUILD_GTEST@

### FIXME
BUILD_FAILURE_HANDLER := true

### FIXME
# Information about the build system
NUM_CORES:=16
MEMORY_SIZE:=28130

## FIXME
# Number of parallel jobs to use for compilation
JOBS?=16
TEST_JOBS?=0

################################################################################


# SPACE and COMMA are defined in MakeBase.gmk, but they are also used in
# some definitions here, and are needed if MakeBase.gmk is not included before
# this file.
X:=
SPACE:=$(X) $(X)
COMMA:=,

# The default make arguments
MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
    MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL)

# Override the shell with bash
BASH_ARGS := -o pipefail -e
SHELL:=$(BASH) $(BASH_ARGS)

# The "human readable" name of this configuration
CONF_NAME := run-test-prebuilt

# Assume target platform is same as build platform
OPENJDK_TARGET_OS := $(OPENJDK_BUILD_OS)
OPENJDK_TARGET_OS_TYPE := $(OPENJDK_BUILD_OS_TYPE)
OPENJDK_TARGET_OS_ENV := $(OPENJDK_BUILD_OS_ENV)

OPENJDK_TARGET_CPU := $(OPENJDK_BUILD_CPU)
OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_BUILD_CPU_ARCH)
OPENJDK_TARGET_CPU_BITS := $(OPENJDK_BUILD_CPU_BITS)
OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_BUILD_CPU_ENDIAN)

SUPPORT_OUTPUTDIR := $(OUTPUTDIR)/support
BUILDTOOLS_OUTPUTDIR := $(OUTPUTDIR)/buildtools

HOTSPOT_OUTPUTDIR := $(OUTPUTDIR)/hotspot
JDK_OUTPUTDIR := $(OUTPUTDIR)/jdk
IMAGES_OUTPUTDIR := $(OUTPUTDIR)/images
BUNDLES_OUTPUTDIR := $(OUTPUTDIR)/bundles
TESTMAKE_OUTPUTDIR := $(OUTPUTDIR)/test-make
MAKESUPPORT_OUTPUTDIR := $(OUTPUTDIR)/make-support
BUILDJDK_OUTPUTDIR := $(OUTPUTDIR)/buildjdk

### FIXME?
#JAVA_FLAGS:= -Duser.language=en -Duser.country=US
#JAVA_FLAGS_BIG:= -Xms64M -Xmx1600M -XX:ThreadStackSize=1536
#JAVA_FLAGS_SMALL:= -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
#JAVA_FLAGS_JAVAC:= -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
#JAVA_TOOL_FLAGS_SMALL:= -J-XX:+UseSerialGC -J-Xms32M -J-Xmx512M -J-XX:TieredStopAtLevel=1

JAVA_CMD:=$(BOOT_JDK)/bin/java
JAVAC_CMD:=$(BOOT_JDK)/bin/javac
JAVAH_CMD:=$(BOOT_JDK)/bin/javah
JAR_CMD:=$(BOOT_JDK)/bin/jar
JLINK_CMD := $(JDK_OUTPUTDIR)/bin/jlink
JMOD_CMD := $(JDK_OUTPUTDIR)/bin/jmod
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner

# These variables are meant to be used. They are defined with = instead of := to make
# it possible to override only the *_CMD variables.
JAVA=$(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
JAVA_SMALL=$(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
JAVA_JAVAC=$(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
JAVAC=$(FIXPATH) $(JAVAC_CMD)
JAVAH=$(FIXPATH) $(JAVAH_CMD)
JAR=$(FIXPATH) $(JAR_CMD)
JLINK = $(FIXPATH) $(JLINK_CMD) $(JAVA_TOOL_FLAGS_SMALL)
JMOD = $(FIXPATH) $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
JARSIGNER=$(FIXPATH) $(JARSIGNER_CMD)

# Tools adhering to a minimal and common standard of posix compliance.
AWK := awk
BASENAME := basename
CAT := cat
CD := cd
CHMOD := chmod
CP := cp
CUT := cut
DATE := date
DIFF := diff
DIRNAME := dirname
FIND := find
FIND_DELETE := -delete
ECHO := echo
EGREP := grep -E
FGREP := grep -F
GREP := grep
GZIP := gzip
HEAD := head
LS := ls
LN := ln
MKDIR := mkdir
MV := mv
NAWK := nawk
NICE := nice
PATCH := patch
PRINTF := printf
RM := rm -f
RMDIR := rmdir
SED := sed
SH := sh
SORT := sort
TAR := tar
TAIL := tail
TEE := tee
TR := tr
TOUCH := touch
UNIQ := uniq
WC := wc
XARGS := xargs
ZIPEXE := zip
UNZIP := unzip
EXPR := expr
FILE := file
HG := hg

####################################################
#
# Misc
#

JRE_IMAGE_DIR := $(JDK_IMAGE_DIR)