make/hotspot/gensrc/GensrcJvmti.gmk
changeset 53995 ecc2bcc3beb0
parent 50113 caf115bb98ad
child 54836 e2ed0691ae79
--- a/make/hotspot/gensrc/GensrcJvmti.gmk	Mon Mar 04 19:38:50 2019 -0500
+++ b/make/hotspot/gensrc/GensrcJvmti.gmk	Tue Mar 05 11:07:19 2019 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 ################################################################################
 # Build tools needed for the JVMTI source code generation
 
+# FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed.
 JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
 JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
 
@@ -64,16 +65,17 @@
 #   DEPS -- Additional dependencies
 SetupXslTransform = $(NamedParamsMacroTemplate)
 define SetupXslTransformBody
-  $$($1_OUTPUT_DIR)/$1: $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS)
-	$$(call LogInfo, Generating $$(@F))
-	$$(call MakeDir, $$(@D))
-	$$(call ExecuteWithLog, $$@, $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
-	    -XSL $$($1_XSL_FILE) -OUT $$@ $$($1_ARGS))
-        # jvmtiGen does not return error code properly on fail.
-        # NOTE: We should really fix jvmtiGen.java instead.
-	test -f $$@
+  $1_OUTPUT_FILE := $$($1_OUTPUT_DIR)/$1
 
-  TARGETS += $$($1_OUTPUT_DIR)/$1
+  $$(eval $$(call SetupExecute, jvmti_gen_$1, \
+      INFO := Generating jvmti file $1, \
+      DEPS := $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS), \
+      OUTPUT_FILE := $$($1_OUTPUT_FILE), \
+      COMMAND := $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
+          -XSL $$($1_XSL_FILE) -OUT $$($1_OUTPUT_FILE) $$($1_ARGS), \
+  ))
+
+  TARGETS += $$(jvmti_gen_$1_TARGET)
 endef
 
 ################################################################################