make/bsd/makefiles/trace.make

changeset 0
f90c822e73f8
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/make/bsd/makefiles/trace.make	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,121 @@
     1.4 +#
     1.5 +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.
    1.11 +#
    1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 +# version 2 for more details (a copy is included in the LICENSE file that
    1.16 +# accompanied this code).
    1.17 +#
    1.18 +# You should have received a copy of the GNU General Public License version
    1.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 +#
    1.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.23 +# or visit www.oracle.com if you need additional information or have any
    1.24 +# questions.
    1.25 +#
    1.26 +#
    1.27 +
    1.28 +# This makefile (trace.make) is included from the trace.make in the
    1.29 +# build directories.
    1.30 +#
    1.31 +# It knows how to build and run the tools to generate trace files.
    1.32 +
    1.33 +include $(GAMMADIR)/make/bsd/makefiles/rules.make
    1.34 +include $(GAMMADIR)/make/altsrc.make
    1.35 +
    1.36 +# #########################################################################
    1.37 +
    1.38 +HAS_ALT_SRC:=$(shell if [ -d $(HS_ALT_SRC)/share/vm/trace ]; then \
    1.39 +  echo "true"; else echo "false";\
    1.40 +  fi)
    1.41 +
    1.42 +TOPDIR      = $(shell echo `pwd`)
    1.43 +GENERATED   = $(TOPDIR)/../generated
    1.44 +JvmtiOutDir = $(GENERATED)/jvmtifiles
    1.45 +TraceOutDir   = $(GENERATED)/tracefiles
    1.46 +
    1.47 +TraceAltSrcDir = $(HS_ALT_SRC)/share/vm/trace
    1.48 +TraceSrcDir = $(HS_COMMON_SRC)/share/vm/trace
    1.49 +
    1.50 +# set VPATH so make knows where to look for source files
    1.51 +Src_Dirs_V += $(TraceSrcDir) $(TraceAltSrcDir)
    1.52 +VPATH += $(Src_Dirs_V:%=%:)
    1.53 +
    1.54 +TraceGeneratedNames =     \
    1.55 +    traceEventClasses.hpp \
    1.56 +	traceEventIds.hpp     \
    1.57 +	traceTypes.hpp
    1.58 +
    1.59 +ifeq ($(HAS_ALT_SRC), true)
    1.60 +TraceGeneratedNames +=  \
    1.61 +	traceRequestables.hpp \
    1.62 +    traceEventControl.hpp
    1.63 +
    1.64 +ifneq ($(INCLUDE_TRACE), false)
    1.65 +TraceGeneratedNames += traceProducer.cpp
    1.66 +endif
    1.67 +
    1.68 +endif
    1.69 +
    1.70 +
    1.71 +TraceGeneratedFiles = $(TraceGeneratedNames:%=$(TraceOutDir)/%)
    1.72 +
    1.73 +XSLT = $(REMOTE) $(RUN.JAVA) -classpath $(JvmtiOutDir) jvmtiGen
    1.74 +
    1.75 +XML_DEPS =  $(TraceSrcDir)/trace.xml  $(TraceSrcDir)/tracetypes.xml \
    1.76 +	$(TraceSrcDir)/trace.dtd $(TraceSrcDir)/xinclude.mod
    1.77 +ifeq ($(HAS_ALT_SRC), true)
    1.78 +	XML_DEPS += $(TraceAltSrcDir)/traceevents.xml
    1.79 +endif
    1.80 +
    1.81 +.PHONY: all clean cleanall
    1.82 +
    1.83 +# #########################################################################
    1.84 +
    1.85 +all: $(TraceGeneratedFiles)
    1.86 +
    1.87 +GENERATE_CODE= \
    1.88 +  $(QUIETLY) echo Generating $@; \
    1.89 +  $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@; \
    1.90 +  test -f $@
    1.91 +
    1.92 +$(TraceOutDir)/traceEventIds.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventIds.xsl $(XML_DEPS)
    1.93 +	$(GENERATE_CODE)
    1.94 +
    1.95 +$(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceTypes.xsl $(XML_DEPS)
    1.96 +	$(GENERATE_CODE)
    1.97 +
    1.98 +ifeq ($(HAS_ALT_SRC), false)
    1.99 +
   1.100 +$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS)
   1.101 +	$(GENERATE_CODE)
   1.102 +
   1.103 +else
   1.104 +
   1.105 +$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS)
   1.106 +	$(GENERATE_CODE)
   1.107 +
   1.108 +$(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS)
   1.109 +	$(GENERATE_CODE)
   1.110 +
   1.111 +$(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS)
   1.112 +	$(GENERATE_CODE)
   1.113 +
   1.114 +$(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS)
   1.115 +	$(GENERATE_CODE)
   1.116 +
   1.117 +endif
   1.118 +
   1.119 +# #########################################################################
   1.120 +
   1.121 +
   1.122 +clean cleanall:
   1.123 +	rm $(TraceGeneratedFiles)
   1.124 +

mercurial