make/hotspot/gensrc/GensrcJvmti.gmk
author ihse
Tue, 22 Oct 2019 09:51:52 +0200
branchihse-cflags-rewrite-branch
changeset 58736 e878a0b7cff0
parent 54836 e2ed0691ae79
child 58834 f78e7ce060b0
permissions -rw-r--r--
Add doubunder on solaris in two places.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
     2
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    26
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
# Build tools needed for the JVMTI source code generation
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    31
# FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed.
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    32
JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
$(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
    JAVAC := $(JAVAC), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
    FLAGS := $(DISABLE_WARNINGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
    SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
    DISABLE_SJAVAC := true, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
$(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
    SETUP := GENERATE_OLDBYTECODE, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
    SRC := $(JVMTI_TOOLS_SRCDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
    INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
    BIN := $(JVMTI_TOOLS_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
TOOL_JVMTI_GEN := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiGen
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
################################################################################
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents: 48009
diff changeset
    54
# Setup make rules for an xml transform for jvmti file generation.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
# Parameter 1 is the name of the rule. This name is used as variable prefix,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
# and the targets generated are listed in a variable by that name. This name is
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
# also used as the name of the output file.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
# Remaining parameters are named arguments. These include:
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
#   XML_FILE -- The input source file to use
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
#   XSL_FILE -- The xsl file to use
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
#   OUTPUT_DIR -- The directory to put the generated file in
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
#   ARGS -- Additional arguments to the jvmtiGen tool
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
#   DEPS -- Additional dependencies
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
SetupXslTransform = $(NamedParamsMacroTemplate)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
define SetupXslTransformBody
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    68
  $1_OUTPUT_FILE := $$($1_OUTPUT_DIR)/$1
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    70
  $$(eval $$(call SetupExecute, jvmti_gen_$1, \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    71
      INFO := Generating jvmti file $1, \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    72
      DEPS := $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS), \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    73
      OUTPUT_FILE := $$($1_OUTPUT_FILE), \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    74
      COMMAND := $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    75
          -XSL $$($1_XSL_FILE) -OUT $$($1_OUTPUT_FILE) $$($1_ARGS), \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    76
  ))
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    77
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 50113
diff changeset
    78
  TARGETS += $$(jvmti_gen_$1_TARGET)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
endef
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
# Create JVMTI files in gensrc/jvmtifiles
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    84
JVMTI_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
JVMTI_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
# Setup rule for generating a jvmti file
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
# $1 is generated source file name in $(JVMTI_OUTPUTDIR)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
# $2 is XSL file to use in $(JVMTI_SRCDIR)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
# $3 is optional extra arguments to jvmtiGen
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
define SetupJvmtiGeneration
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
  $$(eval $$(call SetupXslTransform, $1, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
      XML_FILE := $$(JVMTI_SRCDIR)/jvmti.xml, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
      XSL_FILE := $$(JVMTI_SRCDIR)/$(strip $2), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
      OUTPUT_DIR := $$(JVMTI_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
      ARGS := $3, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
      DEPS := $$(JVMTI_SRCDIR)/jvmtiLib.xsl, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
  ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
endef
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
$(eval $(call SetupJvmtiGeneration, jvmtiEnter.cpp, jvmtiEnter.xsl, \
54836
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   103
    -PARAM majorversion $(VERSION_FEATURE) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
    -PARAM interface jvmti))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
$(eval $(call SetupJvmtiGeneration, jvmtiEnterTrace.cpp, jvmtiEnter.xsl, \
54836
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   106
    -PARAM majorversion $(VERSION_FEATURE) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
    -PARAM interface jvmti -PARAM trace Trace))
54836
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   108
$(eval $(call SetupJvmtiGeneration, jvmtiEnv.hpp, jvmtiHpp.xsl, \
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   109
    -PARAM majorversion $(VERSION_FEATURE)))
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   110
$(eval $(call SetupJvmtiGeneration, jvmti.h, jvmtiH.xsl, \
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   111
    -PARAM majorversion $(VERSION_FEATURE)))
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   112
$(eval $(call SetupJvmtiGeneration, jvmti.html, jvmti.xsl, \
e2ed0691ae79 8219023: Investigate syncing JVMTI spec version with JDK version
sspitsyn
parents: 53995
diff changeset
   113
    -PARAM majorversion $(VERSION_FEATURE)))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   115
JVMTI_BC_SRCDIR := $(TOPDIR)/src/hotspot/share/interpreter
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
$(eval $(call SetupXslTransform, bytecodeInterpreterWithChecks.cpp, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
    XML_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xml, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
    XSL_FILE := $(JVMTI_BC_SRCDIR)/bytecodeInterpreterWithChecks.xsl, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
    OUTPUT_DIR := $(JVMTI_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
    DEPS := $(JVMTI_BC_SRCDIR)/bytecodeInterpreter.cpp, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
################################################################################
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   125
# Copy jvmti.h to include dir
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   126
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   127
# The file is the same regardless of jvm variant. Only let one do the copy.
41746
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   128
ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS)))
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   129
  $(eval $(call SetupCopyFiles, COPY_JVMTI_H, \
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   130
      DEST := $(SUPPORT_OUTPUTDIR)/modules_include/java.base, \
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   131
      FILES := $(JVMTI_OUTPUTDIR)/jvmti.h, \
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   132
  ))
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   133
41746
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   134
  TARGETS += $(COPY_JVMTI_H)
621dfac78ca1 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41344
diff changeset
   135
endif