make/linux/makefiles/jfr.make

Wed, 14 Oct 2020 17:44:48 +0800

author
aoqi
date
Wed, 14 Oct 2020 17:44:48 +0800
changeset 9931
fd44df5e3bc3
parent 9858
b985cbb00e68
permissions
-rw-r--r--

Merge

     1 #
     2 # Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     3 # Copyright (c) 2018-2019, Azul Systems, Inc. All rights reserved.
     4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5 #
     6 # This code is free software; you can redistribute it and/or modify it
     7 # under the terms of the GNU General Public License version 2 only, as
     8 # published by the Free Software Foundation.
     9 #
    10 # This code is distributed in the hope that it will be useful, but WITHOUT
    11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    13 # version 2 for more details (a copy is included in the LICENSE file that
    14 # accompanied this code).
    15 #
    16 # You should have received a copy of the GNU General Public License version
    17 # 2 along with this work; if not, write to the Free Software Foundation,
    18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    19 #
    20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21 # or visit www.oracle.com if you need additional information or have any
    22 # questions.
    23 #  
    24 #
    26 # This makefile (jfr.make) is included from the jfr.make in the
    27 # build directories.
    28 #
    29 # It knows how to build and run the tools to generate jfr.
    31 include $(GAMMADIR)/make/linux/makefiles/rules.make
    33 # #########################################################################
    34 # Build tools needed for the Jfr source code generation
    36 TOPDIR      = $(shell echo `pwd`)
    37 GENERATED   = $(TOPDIR)/../generated
    39 JFR_TOOLS_SRCDIR := $(GAMMADIR)/src/share/vm/jfr
    40 JFR_TOOLS_OUTPUTDIR := $(GENERATED)/tools/jfr
    42 JFR_OUTPUTDIR := $(GENERATED)/jfrfiles
    43 JFR_SRCDIR := $(GAMMADIR)/src/share/vm/jfr/metadata
    45 METADATA_XML ?= $(JFR_SRCDIR)/metadata.xml
    46 METADATA_XSD ?= $(JFR_SRCDIR)/metadata.xsd
    48 # Changing these will trigger a rebuild of generated jfr files.
    49 JFR_DEPS += \
    50     $(METADATA_XML) \
    51     $(METADATA_XSD) \
    52     #
    54 JfrGeneratedNames = \
    55 	jfrEventClasses.hpp \
    56 	jfrEventControl.hpp \
    57 	jfrEventIds.hpp \
    58 	jfrPeriodic.hpp \
    59 	jfrTypes.hpp
    61 JfrGenSource = $(JFR_TOOLS_SRCDIR)/GenerateJfrFiles.java
    62 JfrGenClass = $(JFR_TOOLS_OUTPUTDIR)/build/tools/jfr/GenerateJfrFiles.class
    64 JfrGeneratedFiles = $(JfrGeneratedNames:%=$(JFR_OUTPUTDIR/%)
    66 .PHONY: all clean cleanall
    68 # #########################################################################
    70 all: $(JfrGeneratedFiles)
    72 $(JfrGenClass): $(JfrGenSource)
    73 	mkdir -p $(@D)
    74 	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -d $(JFR_TOOLS_OUTPUTDIR) $(JfrGenSource)
    76 $(JFR_OUTPUTDIR)/jfrEventClasses.hpp: $(METADATA_XML) $(METADATA_XSD) $(JfrGenClass)
    77 	$(QUIETLY) echo Generating $(@F)
    78 	mkdir -p $(@D)
    79 	$(QUIETLY) $(REMOTE) $(RUN.JAVA) -cp $(JFR_TOOLS_OUTPUTDIR) build.tools.jfr.GenerateJfrFiles $(METADATA_XML) $(METADATA_XSD) $(JFR_OUTPUTDIR)
    80 	test -f $@
    82 $(filter-out $(JFR_OUTPUTDIR)/jfrEventClasses.hpp, $(JfrGeneratedFiles)): $(JFR_OUTPUTDIR)/jfrEventClasses.hpp
    84 TARGETS += $(JFR_OUTPUTDIR)/jfrEventClasses.hpp
    86 # #########################################################################
    88 clean cleanall :
    89 	rm $(JfrGenClass) $(JfrGeneratedFiles)
    91 # #########################################################################

mercurial