author | redestad |
Fri, 19 Oct 2018 12:20:44 +0200 | |
branch | JEP-230-microbenchmarks-branch |
changeset 56991 | 924fbbfdf07a |
parent 56930 | 079075866d11 |
permissions | -rw-r--r-- |
56905 | 1 |
# |
2 |
# Copyright (c) 2018, 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. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
# This must be the first rule |
|
27 |
default: all |
|
28 |
||
29 |
include $(SPEC) |
|
30 |
include MakeBase.gmk |
|
31 |
include JavaCompilation.gmk |
|
32 |
include SetupJavaCompilers.gmk |
|
33 |
||
56907 | 34 |
ifeq ($(JMH_CORE_JAR), ) |
35 |
$(info Error: JMH is missing. Please use configure --with-jmh.) |
|
36 |
$(error Cannot continue) |
|
37 |
endif |
|
56905 | 38 |
|
39 |
#### Variables |
|
40 |
||
56930
079075866d11
Reorganize micro sources (classes/resources), add tests using resources as a PoC
redestad
parents:
56919
diff
changeset
|
41 |
MICROBENCHMARK_SRC := $(TOPDIR)/test/micro/classes |
56991
924fbbfdf07a
JAVA_SMALL -> JAVA, comment out MICROBENCHMARK_RES
redestad
parents:
56930
diff
changeset
|
42 |
# Uncomment this if/when resources are added |
924fbbfdf07a
JAVA_SMALL -> JAVA, comment out MICROBENCHMARK_RES
redestad
parents:
56930
diff
changeset
|
43 |
#MICROBENCHMARK_RES := $(TOPDIR)/test/micro/resources |
56907 | 44 |
MICROBENCHMARK_JAR := $(IMAGES_OUTPUTDIR)/test/micro/microbenchmarks.jar |
45 |
||
46 |
MICROBENCHMARK_OUTPUT := $(SUPPORT_OUTPUTDIR)/test/micro |
|
47 |
MICROBENCHMARK_CLASSES := $(MICROBENCHMARK_OUTPUT)/classes |
|
56918
c331ac5bc80a
Only output resulting jar, not build support files, in image.
ihse
parents:
56913
diff
changeset
|
48 |
MICROBENCHMARK_JAR_BIN := $(MICROBENCHMARK_OUTPUT)/jar |
56907 | 49 |
|
50 |
JMH_UNPACKED_DIR := $(MICROBENCHMARK_OUTPUT)/jmh_jars |
|
51 |
JMH_UNPACKED_JARS_DONE := $(JMH_UNPACKED_DIR)/_unpacked.marker |
|
56905 | 52 |
|
56907 | 53 |
# External dependencies |
54 |
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR) |
|
55 |
JMH_RUNTIME_JARS := $(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JAR) |
|
56 |
||
57 |
MICROBENCHMARK_CLASSPATH := $(call PathList, $(JMH_COMPILE_JARS)) |
|
56905 | 58 |
|
56907 | 59 |
### |
60 |
||
61 |
# Need double \n to get new lines and no trailing spaces |
|
62 |
MICROBENCHMARK_MANIFEST := Build: $(FULL_VERSION)\n\ |
|
63 |
\nJMH-Version: $(JMH_VERSION)\n\ |
|
64 |
\nName: OpenJDK Microbenchmark Suite |
|
65 |
||
56905 | 66 |
|
67 |
#### Compile Targets |
|
68 |
||
56907 | 69 |
# Building microbenchmark requires the jdk.unsupported and java.management modules, |
70 |
# and to have sjavac disabled. |
|
71 |
$(eval $(call SetupJavaCompiler, MICROBENCHMARK_JAVA_COMPILER, \ |
|
56991
924fbbfdf07a
JAVA_SMALL -> JAVA, comment out MICROBENCHMARK_RES
redestad
parents:
56930
diff
changeset
|
72 |
JVM := $(JAVA) --add-modules jdk.unsupported --limit-modules java.management, \ |
56905 | 73 |
JAVAC := $(NEW_JAVAC), \ |
56907 | 74 |
DISABLE_SJAVAC := true, \ |
56905 | 75 |
FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \ |
76 |
SERVER_DIR := $(SJAVAC_SERVER_DIR), \ |
|
56907 | 77 |
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ |
78 |
)) |
|
56905 | 79 |
|
80 |
# Build microbenchmark suite for the current JDK |
|
56907 | 81 |
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \ |
82 |
SETUP := MICROBENCHMARK_JAVA_COMPILER, \ |
|
83 |
ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH) -Xlint -Werror, \ |
|
56905 | 84 |
SRC := $(MICROBENCHMARK_SRC), \ |
56907 | 85 |
BIN := $(MICROBENCHMARK_CLASSES), \ |
86 |
)) |
|
56905 | 87 |
|
56907 | 88 |
$(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS) |
56905 | 89 |
|
90 |
# Unpacking dependencies for inclusion in the benchmark JARs |
|
56907 | 91 |
$(JMH_UNPACKED_JARS_DONE): $(JMH_RUNTIME_JARS) |
92 |
$(RM) -r $(JMH_UNPACKED_DIR) |
|
93 |
$(MKDIR) -p $(JMH_UNPACKED_DIR) |
|
56905 | 94 |
$(foreach jar, $(JMH_RUNTIME_JARS), \ |
56907 | 95 |
$$($(UNZIP) -oq $(jar) -d $(JMH_UNPACKED_DIR))) |
96 |
$(RM) -r $(JMH_UNPACKED_DIR)/META-INF |
|
97 |
$(RM) $(JMH_UNPACKED_DIR)/*.xml |
|
56905 | 98 |
$(TOUCH) $@ |
99 |
||
100 |
# Create benchmarks JAR file with benchmarks for both the old and new JDK |
|
56907 | 101 |
$(eval $(call SetupJarArchive, BUILD_JDK_JAR, \ |
102 |
DEPENDENCIES := $(BUILD_JDK_MICROBENCHMARK) $(JMH_UNPACKED_JARS_DONE), \ |
|
56930
079075866d11
Reorganize micro sources (classes/resources), add tests using resources as a PoC
redestad
parents:
56919
diff
changeset
|
103 |
SRCS := $(MICROBENCHMARK_CLASSES) $(JMH_UNPACKED_DIR) $(MICROBENCHMARK_RES), \ |
56918
c331ac5bc80a
Only output resulting jar, not build support files, in image.
ihse
parents:
56913
diff
changeset
|
104 |
BIN := $(MICROBENCHMARK_JAR_BIN), \ |
56905 | 105 |
SUFFIXES := .*, \ |
106 |
EXCLUDE_FILES:= _the.BUILD_JDK_MICROBENCHMARK_batch \ |
|
56907 | 107 |
_the.BUILD_JDK_MICROBENCHMARK.vardeps _unpacked.marker, \ |
108 |
EXTRA_MANIFEST_ATTR := $(MICROBENCHMARK_MANIFEST), \ |
|
56905 | 109 |
JARMAIN := org.openjdk.jmh.Main, \ |
56907 | 110 |
JAR := $(MICROBENCHMARK_JAR), \ |
111 |
)) |
|
56905 | 112 |
|
113 |
all: $(MICROBENCHMARK_JAR) |
|
114 |
||
115 |
.PHONY: all |