jdk

Форк
0
109 строк · 4.2 Кб
1
#
2
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.
8
#
9
# This code is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
# version 2 for more details (a copy is included in the LICENSE file that
13
# accompanied this code).
14
#
15
# You should have received a copy of the GNU General Public License version
16
# 2 along with this work; if not, write to the Free Software Foundation,
17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
#
19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
# or visit www.oracle.com if you need additional information or have any
21
# questions.
22
#
23

24
#
25
# This is a temporary standalone makefile
26
#
27

28
BUILD_DIR := $(shell pwd)/build
29
CLASSES_DIR := ${BUILD_DIR}/classes
30
IMAGE_DIR := ${BUILD_DIR}/image
31
RUN_DIR := $(shell pwd)/run
32
CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar
33
SRC_DIR := src/share/classes/
34
SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java                   \
35
           ${SRC_DIR}/jdk/test/failurehandler/action/*.java            \
36
           ${SRC_DIR}/jdk/test/failurehandler/jtreg/*.java             \
37
           ${SRC_DIR}/jdk/test/failurehandler/value/*.java
38

39
CONF_DIR = src/share/conf
40

41
JAVA_RELEASE = 15
42

43
TARGET_JAR = ${IMAGE_DIR}/lib/jtregFailureHandler.jar
44

45
OS_NAME := $(shell uname -o 2>&1)
46

47
ifeq ("${OS_NAME}", "Cygwin")
48
BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}")
49
CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}")
50
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}")
51
RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
52
SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
53
JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
54
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
55
CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
56
endif
57

58
all: clean test
59

60
check_defined = $(foreach 1,$1,$(__check_defined))
61
__check_defined = $(if $(value $1),, $(error $1 is not set))
62

63
classes: require_env
64
	mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
65
	"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
66
		-sourcepath "$(shell pwd)"                                           \
67
		-cp "${CLASSPATH}" 													 \
68
		-d ${CLASSES_DIR}                                  					 \
69
        ${SOURCES}
70
	"${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" .
71
	"${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" .
72

73
#
74
# Use JTREG_TEST_OPTS for test VM options
75
# Use JTREG_TESTS for jtreg tests parameter
76
#
77
test: require_env build
78
	rm -rf "${RUN_DIR}"
79
	mkdir -p "${RUN_DIR}"
80
	"${JTREG_HOME}"/bin/jtreg                                           \
81
        -jdk:"${JAVA_HOME}"                                                 \
82
        ${JTREG_TEST_OPTS}                                                  \
83
        -timeout:0.1 -va -retain:all                                        \
84
        -noreport                                                           \
85
        -agentvm                                                            \
86
        -thd:"${TARGET_JAR}"                                                \
87
        -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler   \
88
        -thtimeout:0                                                        \
89
        -od:"${TARGET_JAR}"                                                 \
90
        -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver       \
91
        -w:"${RUN_DIR}/JTwork"                                              \
92
        -r:"${RUN_DIR}/JTreport"                                            \
93
        $(if ${JTREG_TESTS}, ${JTREG_TESTS}, test)                          \
94
        && false || true
95

96
debug: JTREG_TEST_OPTS += "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'"
97
debug: test
98

99
require_env:
100
	$(call check_defined, JAVA_HOME)
101
	$(call check_defined, JTREG_HOME)
102

103
clean:
104
	rm -rf "${BUILD_DIR}" "${RUN_DIR}"
105

106
build: classes
107

108
.PHONY: all build classes test require_env clean
109
.DEFAULT: all
110

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.