make/hotspot/gensrc/GensrcJvmti.gmk
changeset 50113 caf115bb98ad
parent 48009 9fe60f7e366f
child 53995 ecc2bcc3beb0
child 57155 ba61956ea598
equal deleted inserted replaced
50112:7a2a740815b7 50113:caf115bb98ad
     1 #
     1 #
     2 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    48 
    48 
    49 TOOL_JVMTI_GEN := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiGen
    49 TOOL_JVMTI_GEN := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiGen
    50 TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
    50 TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
    51 
    51 
    52 ################################################################################
    52 ################################################################################
    53 # Setup make rules for an xml transform for jvmti/trace file generation.
    53 # Setup make rules for an xml transform for jvmti file generation.
    54 #
    54 #
    55 # Parameter 1 is the name of the rule. This name is used as variable prefix,
    55 # Parameter 1 is the name of the rule. This name is used as variable prefix,
    56 # and the targets generated are listed in a variable by that name. This name is
    56 # and the targets generated are listed in a variable by that name. This name is
    57 # also used as the name of the output file.
    57 # also used as the name of the output file.
    58 #
    58 #
   124       FILES := $(JVMTI_OUTPUTDIR)/jvmti.h, \
   124       FILES := $(JVMTI_OUTPUTDIR)/jvmti.h, \
   125   ))
   125   ))
   126 
   126 
   127   TARGETS += $(COPY_JVMTI_H)
   127   TARGETS += $(COPY_JVMTI_H)
   128 endif
   128 endif
   129 
       
   130 ################################################################################
       
   131 # Create trace files in gensrc/tracefiles
       
   132 
       
   133 TRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/tracefiles
       
   134 TRACE_SRCDIR := $(TOPDIR)/src/hotspot/share/trace
       
   135 
       
   136 # Append list of XSL files to search (might have been set by custom extensions)
       
   137 TRACE_XSL_FILES += $(wildcard $(TRACE_SRCDIR)/*.xsl)
       
   138 
       
   139 TRACE_XML ?= $(TRACE_SRCDIR)/trace.xml
       
   140 
       
   141 # Changing these will trigger a rebuild of generated trace files.
       
   142 TRACE_DEPS += \
       
   143     $(TRACE_XML) \
       
   144     $(TRACE_SRCDIR)/tracetypes.xml \
       
   145     $(TRACE_SRCDIR)/tracerelationdecls.xml \
       
   146     $(TRACE_SRCDIR)/traceevents.xml \
       
   147     $(TRACE_SRCDIR)/trace.dtd \
       
   148     $(TRACE_SRCDIR)/xinclude.mod \
       
   149     #
       
   150 
       
   151 # Setup rule for generating a trace file
       
   152 #
       
   153 # $1 is generated source file name in $(TRACE_OUTPUTDIR)
       
   154 define SetupTraceGeneration
       
   155   $$(eval $$(call SetupXslTransform, $1, \
       
   156       XML_FILE := $$(TRACE_XML), \
       
   157       XSL_FILE := $$(firstword $$(filter %/$$(basename $1).xsl, $$(TRACE_XSL_FILES))), \
       
   158       OUTPUT_DIR := $$(TRACE_OUTPUTDIR), \
       
   159       DEPS := $$(TRACE_DEPS), \
       
   160   ))
       
   161 endef
       
   162 
       
   163 # Append files to generated (might have been set by custom extensions)
       
   164 TRACE_GENSRC_FILES += \
       
   165     traceEventClasses.hpp \
       
   166     traceEventIds.hpp \
       
   167     traceTypes.hpp \
       
   168     #
       
   169 
       
   170 # Call SetupTraceGeneration for all trace gensrc files
       
   171 $(foreach tracefile, $(TRACE_GENSRC_FILES), \
       
   172   $(eval $(call SetupTraceGeneration, $(tracefile))) \
       
   173 )