jdk

Форк
0
/
GensrcJvmti.gmk 
122 строки · 4.9 Кб
1
#
2
# Copyright (c) 2013, 2020, 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
include CopyFiles.gmk
27

28
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
29

30
################################################################################
31
# Build tools needed for the JVMTI source code generation
32

33
# FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed.
34
JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
35
JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
36

37
$(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \
38
    COMPILER := bootjdk, \
39
    SMALL_JAVA := false, \
40
    SRC := $(JVMTI_TOOLS_SRCDIR), \
41
    DISABLED_WARNINGS := rawtypes cast, \
42
    INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \
43
    BIN := $(JVMTI_TOOLS_OUTPUTDIR), \
44
))
45

46
TOOL_JVMTI_GEN := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiGen
47
TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
48

49
################################################################################
50
# Setup make rules for an xml transform for jvmti file generation.
51
#
52
# Parameter 1 is the name of the rule. This name is used as variable prefix,
53
# and the targets generated are listed in a variable by that name. This name is
54
# also used as the name of the output file.
55
#
56
# Remaining parameters are named arguments. These include:
57
#   XML_FILE -- The input source file to use
58
#   XSL_FILE -- The xsl file to use
59
#   OUTPUT_DIR -- The directory to put the generated file in
60
#   ARGS -- Additional arguments to the jvmtiGen tool
61
#   DEPS -- Additional dependencies
62
SetupXslTransform = $(NamedParamsMacroTemplate)
63
define SetupXslTransformBody
64
  $1_OUTPUT_FILE := $$($1_OUTPUT_DIR)/$1
65

66
  $$(eval $$(call SetupExecute, jvmti_gen_$1, \
67
      INFO := Generating jvmti file $1, \
68
      DEPS := $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS), \
69
      OUTPUT_FILE := $$($1_OUTPUT_FILE), \
70
      COMMAND := $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
71
          -XSL $$($1_XSL_FILE) -OUT $$($1_OUTPUT_FILE) $$($1_ARGS), \
72
  ))
73

74
  TARGETS += $$(jvmti_gen_$1_TARGET)
75
endef
76

77
################################################################################
78
# Create JVMTI files in gensrc/jvmtifiles
79

80
JVMTI_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
81
JVMTI_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles
82

83
# Setup rule for generating a jvmti file
84
#
85
# $1 is generated source file name in $(JVMTI_OUTPUTDIR)
86
# $2 is XSL file to use in $(JVMTI_SRCDIR)
87
# $3 is optional extra arguments to jvmtiGen
88
define SetupJvmtiGeneration
89
  $$(eval $$(call SetupXslTransform, $1, \
90
      XML_FILE := $$(JVMTI_SRCDIR)/jvmti.xml, \
91
      XSL_FILE := $$(JVMTI_SRCDIR)/$(strip $2), \
92
      OUTPUT_DIR := $$(JVMTI_OUTPUTDIR), \
93
      ARGS := $3, \
94
      DEPS := $$(JVMTI_SRCDIR)/jvmtiLib.xsl, \
95
  ))
96
endef
97

98
$(eval $(call SetupJvmtiGeneration, jvmtiEnter.cpp, jvmtiEnter.xsl, \
99
    -PARAM majorversion $(VERSION_FEATURE) \
100
    -PARAM interface jvmti))
101
$(eval $(call SetupJvmtiGeneration, jvmtiEnterTrace.cpp, jvmtiEnter.xsl, \
102
    -PARAM majorversion $(VERSION_FEATURE) \
103
    -PARAM interface jvmti -PARAM trace Trace))
104
$(eval $(call SetupJvmtiGeneration, jvmtiEnv.hpp, jvmtiHpp.xsl, \
105
    -PARAM majorversion $(VERSION_FEATURE)))
106
$(eval $(call SetupJvmtiGeneration, jvmti.h, jvmtiH.xsl, \
107
    -PARAM majorversion $(VERSION_FEATURE)))
108
$(eval $(call SetupJvmtiGeneration, jvmti.html, jvmti.xsl, \
109
    -PARAM majorversion $(VERSION_FEATURE)))
110

111
################################################################################
112
# Copy jvmti.h to include dir
113

114
# The file is the same regardless of jvm variant. Only let one do the copy.
115
ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS)))
116
  $(eval $(call SetupCopyFiles, COPY_JVMTI_H, \
117
      DEST := $(SUPPORT_OUTPUTDIR)/modules_include/java.base, \
118
      FILES := $(JVMTI_OUTPUTDIR)/jvmti.h, \
119
  ))
120

121
  TARGETS += $(COPY_JVMTI_H)
122
endif
123

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

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

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

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