make/FakeSpecForLegacyTests.gmk
author ihse
Mon, 27 Nov 2017 12:29:28 +0100
branchihse-testmakefiles-branch
changeset 55882 79c94bfb654e
parent 55881 dbf68259f80e
permissions -rw-r--r--
Use OUTPUTDIR instead of OUTPUT_ROOT.

#
# Copyright (c) 2016, 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 RunTestsLegacy.gmk.

# FIXME: HACK.
TEST_ROOT := $(TOPDIR)/jdk/test

ifdef ALT_OUTPUTDIR
  LEGACY_OUTPUTDIR := $(ALT_OUTPUTDIR)
else
  LEGACY_OUTPUTDIR := $(TEST_ROOT)/..
endif

# We need a proper PRODUCT_HOME
ifeq ($(PRODUCT_HOME), )
  PRODUCT_HOME := $(LEGACY_OUTPUTDIR)/images/jdk
  ifeq ($(wildcard $(PRODUCT_HOME)/bin/java), )
    PRODUCT_HOME := $(LEGACY_OUTPUTDIR)
    ifeq ($(wildcard $(PRODUCT_HOME)/bin/java), )
      ifeq ($(wildcard $(PRODUCT_HOME)/bin/java), )
        $(info Error: PRODUCT_HOME must be specified)
        $(error Cannot continue)
      endif
    endif
  endif
  $(info Warning: No PRODUCT_HOME given, will use $(PRODUCT_HOME))
else
  ifeq ($(wildcard $(PRODUCT_HOME)/bin/java), )
    $(info Error: Cannot find bin/java at PRODUCT_HOME=$(PRODUCT_HOME))
    $(error Cannot continue)
  endif
endif
$(info Using PRODUCT_HOME=$(PRODUCT_HOME))

# We need a proper JT_HOME

JDK_IMAGE_DIR := $(PRODUCT_HOME)
# PRODUCT_HOME

# ???
BOOT_JDK := /var/tmp/jib-ihse/install/java/re/jdk/8/promoted/latest/bundles/linux-x64/jdk-8-linux-x64.tar.gz/jdk1.8.0

# MUST BE SET
JT_HOME := /var/tmp/jib-ihse/install/java/re/jtreg/4.2/promoted/all/b04/bundles/jtreg_bin-4.2.zip/jtreg

$(info using JT_HOME $(JT_HOME))
$(info using BOOT_JDK $(BOOT_JDK))
$(info using PRODUCT_HOME $(PRODUCT_HOME))

CONF_NAME := linux-x64

OUTPUT_ROOT := $(TOPDIR)/build/$(CONF_NAME)

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

NUM_CORES := 4
JOBS ?= 3
TEST_JOBS ?= 0

USE_JTREG_EXECUTABLE := true

# These needs som special handling on Windows to get right
PATH_SEP := :
FIXPATH :=
CYGPATH :=

# Make sure we're using bash as shell with -e and pipefail.
BASH := bash
BASH_ARGS := -o pipefail -e
SHELL := $(BASH) $(BASH_ARGS)

# Set up default names for common tools
AWK := awk
BASENAME := basename
CAT := cat
CHMOD := chmod
CP := cp
CUT := cut
DATE := date
DIFF := diff
DIRNAME := dirname
ECHO := echo
EXPR := expr
FILE := file
FIND := find
GREP := grep
EGREP := grep -E
FGREP := grep -F
HEAD := head
LN := ln
LS := ls
MKDIR := mkdir
MV := mv
NAWK := nawk
PRINTF := printf
PWD := pwd
RMDIR := rmdir
RM := rm -f
SED := sed
SH := sh
SORT := sort
TAIL := tail
TEE := tee
TOUCH := touch
TR := tr
UNIQ := uniq
WC := wc
XARGS := xargs

# Create composite variables from what have been defined above
SRC_ROOT := $(TOPDIR)
BUILD_OUTPUT := $(OUTPUT_ROOT)
IMAGES_OUTPUTDIR := $(OUTPUT_ROOT)/images
TEST_IMAGE_SUBDIR := test
TEST_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
SYMBOLS_IMAGE_SUBDIR := symbols
SYMBOLS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)

# 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)